qcs_api_client.client._configuration.secrets#
Module Contents#
Classes#
TokenPayload represents a response from the OAuth2 POST /token endpoint. |
|
A set of credentials containing a |
|
The user's full set of QCS secrets. |
- class qcs_api_client.client._configuration.secrets.TokenPayload#
Bases:
pydantic.BaseModelTokenPayload represents a response from the OAuth2 POST /token endpoint.
It contains an access_token which may be set as a Bearer token in the Authorization header on HTTP requests to the QCS API.
QCSAuthwill use therefresh_tokento refresh theaccess_tokenif the token expires.- refresh_token :Optional[str]#
- access_token :Optional[str]#
- scope :Optional[str]#
- expires_in :Optional[int]#
- id_token :Optional[str]#
- token_type :Optional[str]#
- get_access_token_claims(key: Union[None, bytes, str] = None)#
Return the claims within the encoded access token.
If a JWK is provided as
key, verify the claims as well. If no key is provided, be aware that the returned claims might be forged or invalid.
- property access_token_expires_at Optional[datetime.datetime]#
Return the datetime that the token expires (if any).
- should_refresh() bool#
Return True if the token is past or nearing expiration and should be refreshed.
- class qcs_api_client.client._configuration.secrets.QCSClientConfigurationSecretsCredentials#
Bases:
pydantic.BaseModelA set of credentials containing a
TokenPayload.- token_payload :Optional[TokenPayload]#
- property access_token Optional[str]#
- property refresh_token Optional[str]#
- class qcs_api_client.client._configuration.secrets.QCSClientConfigurationSecrets#
Bases:
qcs_api_client.client._configuration.file.QCSClientConfigurationFileThe user’s full set of QCS secrets.
This class maps
QCSClientConfigurationSecretsCredentialsby user specified names. Each set of credentials, in turn, contains aTokenPayload.- credentials :Dict[str, QCSClientConfigurationSecretsCredentials]#
- update_token(*, credentials_name: str, token: TokenPayload) None#
Update the value of a token payload in memory and (if appropriate) on disk.