google.auth.transport package¶
Transport - HTTP client library support.
google.auth
is designed to work with various HTTP client libraries such
as urllib3 and requests. In order to work across these libraries with different
interfaces some abstraction is needed.
This module provides two interfaces that are implemented by transport adapters
to support HTTP libraries. Request
defines the interface expected by
google.auth
to make requests. Response
defines the interface
for the return value of Request
.
- DEFAULT_RETRYABLE_STATUS_CODES = (HTTPStatus.INTERNAL_SERVER_ERROR, HTTPStatus.SERVICE_UNAVAILABLE, HTTPStatus.REQUEST_TIMEOUT, HTTPStatus.TOO_MANY_REQUESTS)¶
HTTP status codes indicating a request can be retried.
- DEFAULT_REFRESH_STATUS_CODES = (HTTPStatus.UNAUTHORIZED,)¶
Which HTTP status code indicate that credentials should be refreshed.
- DEFAULT_MAX_REFRESH_ATTEMPTS = 2¶
How many times to refresh the credentials and retry a request.
- Type:
- class Request[source]¶
Bases:
object
Interface for a callable that makes HTTP requests.
Specific transport implementations should provide an implementation of this that adapts their specific request / response API.
- abstract __call__(url, method='GET', body=None, headers=None, timeout=None, **kwargs)[source]¶
Make an HTTP request.
- Parameters:
url (str) – The URI to be requested.
method (str) – The HTTP method to use for the request. Defaults to ‘GET’.
body (bytes) – The payload / body in HTTP request.
timeout (
Optional
int
) – The number of seconds to wait for a response from the server. If not specified or if None, the transport-specific default timeout will be used.kwargs – Additionally arguments passed on to the transport’s request method.
- Returns:
The HTTP response.
- Return type:
- Raises:
google.auth.exceptions.TransportError – If any exception occurred.
Submodules¶
- google.auth.transport.aiohttp_requests module
Request
AuthorizedSession
AuthorizedSession.request()
AuthorizedSession.auth
AuthorizedSession.auto_decompress
AuthorizedSession.close()
AuthorizedSession.closed
AuthorizedSession.connector
AuthorizedSession.connector_owner
AuthorizedSession.cookie_jar
AuthorizedSession.delete()
AuthorizedSession.detach()
AuthorizedSession.get()
AuthorizedSession.head()
AuthorizedSession.headers
AuthorizedSession.json_serialize
AuthorizedSession.loop
AuthorizedSession.options()
AuthorizedSession.patch()
AuthorizedSession.post()
AuthorizedSession.put()
AuthorizedSession.raise_for_status
AuthorizedSession.requote_redirect_url
AuthorizedSession.skip_auto_headers
AuthorizedSession.timeout
AuthorizedSession.trace_configs
AuthorizedSession.trust_env
AuthorizedSession.version
AuthorizedSession.ws_connect()
- google.auth.transport.grpc module
- google.auth.transport.mtls module
- google.auth.transport.requests module
TimeoutGuard
Request
AuthorizedSession
AuthorizedSession.configure_mtls_channel()
AuthorizedSession.request()
AuthorizedSession.is_mtls
AuthorizedSession.close()
AuthorizedSession.delete()
AuthorizedSession.get()
AuthorizedSession.get_adapter()
AuthorizedSession.get_redirect_target()
AuthorizedSession.head()
AuthorizedSession.merge_environment_settings()
AuthorizedSession.mount()
AuthorizedSession.options()
AuthorizedSession.patch()
AuthorizedSession.post()
AuthorizedSession.prepare_request()
AuthorizedSession.put()
AuthorizedSession.rebuild_auth()
AuthorizedSession.rebuild_method()
AuthorizedSession.rebuild_proxies()
AuthorizedSession.resolve_redirects()
AuthorizedSession.send()
AuthorizedSession.should_strip_auth()
AuthorizedSession.headers
AuthorizedSession.auth
AuthorizedSession.proxies
AuthorizedSession.hooks
AuthorizedSession.params
AuthorizedSession.stream
AuthorizedSession.verify
AuthorizedSession.cert
AuthorizedSession.max_redirects
AuthorizedSession.trust_env
AuthorizedSession.cookies
- google.auth.transport.urllib3 module