Access TokenΒΆ
- class AccessToken(*, token: SecretStr = SecretStr(''), expires: datetime = <factory>)[source]ΒΆ
Represents a Bearer Token used for authentication.
The token is held as
pydantic.SecretStrso accidentalrepr/model_dump/str()/ traceback rendering returns the masked placeholder rather than the actual bearer. Useaccess_token.token.get_secret_value()when constructing theAuthorizationheader or persisting to the keychain.- Parameters:
token (
pydantic.SecretStr) β The access token used for authentication.expires (datetime) β The expiration datetime of the token. The default is set to January 1, 1970.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.