qcs_api_client.client.auth#
Module Contents#
Classes#
This configures how |
|
Implements |
- class qcs_api_client.client.auth.QCSAuthConfiguration#
Bases:
pydantic.BaseModelThis configures how
QCSAuthimplements its access token refresh mechanism.- pre :bool = False#
Pre-emptively refresh access tokens.
When set to True, this will check the access token’s expiration and refresh when necessary before setting the access token in the outgoing Authorization header.
- post :bool = True#
Refresh access tokens based on response status code.
When set to True, this will check responses for the status codes configured in
post_refresh_statuses. On match,QCSAuthwill refresh the access token and retry the request.
- post_refresh_statuses :Set[int]#
Response status codes which indicates a possible expired token payload.
This contains a set of HTTP status codes which
QCSAuthwill check on responses when post is set to True.
- exception qcs_api_client.client.auth.QCSAuthRefreshError(response: httpx.Response)#
Bases:
ExceptionCommon base class for all non-exit exceptions.
Initialize self. See help(type(self)) for accurate signature.
- class qcs_api_client.client.auth.QCSAuth(client_configuration: qcs_api_client.client._configuration.QCSClientConfiguration, auth_configuration: QCSAuthConfiguration = None)#
Bases:
httpx.AuthImplements
httpx.Authsync_auth_flowandasync_auth_flow.If the
QCSClientConfigurationthat initializes this class has a validTokenPayloadonQCSClientConfiguration.credentials, it will set the a refreshed access token as a Bearer token on the Authorization header of outgoing requests.Access tokens are refreshed via OAuth2 refresh mechanism as indicated by
QCSAuthConfiguration.- sync_refresh_token()#
- sync_auth_flow(request)#
- async async_refresh_token()#
- async async_auth_flow(request)#