class documentation
class Urllib3HttpGitClient(AbstractHttpGitClient):
Constructor: Urllib3HttpGitClient(base_url, dumb, pool_manager, config, ...)
HTTP Git client using urllib3.
Supports callback-based authentication for both HTTP and proxy authentication, allowing dynamic credential handling without intercepting exceptions.
Example
>>> def auth_callback(url, www_authenticate, attempt): ... # Parse www_authenticate header to determine auth scheme ... # Return credentials or None to cancel ... return {"username": "user", "password": "pass"} >>> >>> client = Urllib3HttpGitClient( ... "https://github.com/private/repo.git", ... auth_callback=auth_callback ... )
| Method | __init__ |
Initialize Urllib3HttpGitClient. |
| Instance Variable | config |
Undocumented |
| Instance Variable | pool |
Undocumented |
| Method | _get |
Undocumented |
| Method | _http |
Perform HTTP request. |
| Instance Variable | _auth |
Undocumented |
| Instance Variable | _extra |
Undocumented |
| Instance Variable | _proxy |
Undocumented |
| Instance Variable | _timeout |
Undocumented |
Inherited from AbstractHttpGitClient:
| Class Method | from |
Create an AbstractHttpGitClient from a parsed URL. |
| Method | __repr__ |
Return string representation of this client. |
| Method | fetch |
Retrieve a pack from a git smart server. |
| Method | get |
Retrieve the current refs from a git smart server. |
| Method | get |
Get the HTTP URL for a path. |
| Method | send |
Upload a pack to a remote repository. |
| Instance Variable | dumb |
Undocumented |
| Instance Variable | protocol |
Undocumented |
| Method | _discover |
Undocumented |
| Method | _smart |
Send a 'smart' HTTP request. |
| Instance Variable | _base |
Undocumented |
| Instance Variable | _password |
Undocumented |
| Instance Variable | _report |
Undocumented |
| Instance Variable | _url |
Undocumented |
| Instance Variable | _username |
Undocumented |
Inherited from GitClient (via AbstractHttpGitClient):
| Method | archive |
Retrieve an archive of the specified tree. |
| Method | clone |
Clone a repository. |
| Method | close |
Close the client and release any resources. |
| Method | fetch |
Fetch into a target repository. |
| Method | fetch |
Fetch into a target repository, using bundle URIs for bootstrap. |
| Static Method | _should |
Undocumented |
| Static Method | _warn |
Undocumented |
| Method | _handle |
Handle the tail of a 'git-receive-pack' request. |
| Method | _negotiate |
Undocumented |
| Method | _negotiate |
Undocumented |
| Instance Variable | _fetch |
Undocumented |
| Instance Variable | _report |
Undocumented |
| Instance Variable | _send |
Undocumented |
def __init__(self, base_url:
str, dumb: bool | None = None, pool_manager: urllib3.PoolManager | urllib3.ProxyManager | AuthCallbackPoolManager | None = None, config: Config | None = None, username: str | None = None, password: str | None = None, timeout: float | None = None, extra_headers: dict[ str, str] | None = None, thin_packs: bool = True, report_activity: Callable[ [ int, str], None] | None = None, quiet: bool = False, include_tags: bool = False, auth_callback: Callable[ [ str, str, int], dict[ str, str] | None] | None = None, proxy_auth_callback: Callable[ [ str, str, int], dict[ str, str] | None] | None = None):
¶
Initialize Urllib3HttpGitClient.
def _http_request(self, url:
str, headers: dict[ str, str] | None = None, data: bytes | Iterator[ bytes] | None = None, raise_for_status: bool = True) -> tuple[ HTTPResponse, Callable[ [ int], bytes]]:
¶
Perform HTTP request.
| Parameters | |
url:str | Request URL. |
headers:dict[ | Optional custom headers to override defaults. |
data:bytes | Iterator[ | Request data. |
raisebool | Whether to raise an exception for HTTP errors. |
| Returns | |
tuple[ | Tuple (response, read), where response is an urllib3 response object with additional content_type and redirect_location properties, and read is a consumable read method for the response data. |
| Raises | |
GitProtocolError | |