class documentation

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_manager Undocumented
Method _get_url Undocumented
Method _http_request Perform HTTP request.
Instance Variable _auth_callback Undocumented
Instance Variable _extra_headers Undocumented
Instance Variable _proxy_auth_callback Undocumented
Instance Variable _timeout Undocumented

Inherited from AbstractHttpGitClient:

Class Method from_parsedurl Create an AbstractHttpGitClient from a parsed URL.
Method __repr__ Return string representation of this client.
Method fetch_pack Retrieve a pack from a git smart server.
Method get_refs Retrieve the current refs from a git smart server.
Method get_url Get the HTTP URL for a path.
Method send_pack Upload a pack to a remote repository.
Instance Variable dumb Undocumented
Instance Variable protocol_version Undocumented
Method _discover_references Undocumented
Method _smart_request Send a 'smart' HTTP request.
Instance Variable _base_url Undocumented
Instance Variable _password Undocumented
Instance Variable _report_status_parser Undocumented
Instance Variable _url_with_auth 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_with_bundle_uri Fetch into a target repository, using bundle URIs for bootstrap.
Static Method _should_send_pack Undocumented
Static Method _warn_filter_objects Undocumented
Method _handle_receive_pack_tail Handle the tail of a 'git-receive-pack' request.
Method _negotiate_receive_pack_capabilities Undocumented
Method _negotiate_upload_pack_capabilities Undocumented
Instance Variable _fetch_capabilities Undocumented
Instance Variable _report_activity Undocumented
Instance Variable _send_capabilities 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.

config =

Undocumented

pool_manager: urllib3.PoolManager | urllib3.ProxyManager | AuthCallbackPoolManager =

Undocumented

def _get_url(self, path: str | bytes) -> str:
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:strRequest URL.
headers:dict[str, str] | NoneOptional custom headers to override defaults.
data:bytes | Iterator[bytes] | NoneRequest data.
raise_for_status:boolWhether to raise an exception for HTTP errors.
Returns
tuple[HTTPResponse, Callable[[int], bytes]]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
_auth_callback =

Undocumented

_extra_headers =

Undocumented

_proxy_auth_callback =

Undocumented

_timeout =

Undocumented