mantik.authentication.tokens

Attributes

logger

Classes

Tokens

Holds AWS Cognito auth tokens.

Functions

get_user_id_from_token(→ str)

Module Contents

class mantik.authentication.tokens.Tokens[source]

Holds AWS Cognito auth tokens.

access_token: str[source]
expires_at: datetime.datetime[source]
classmethod from_file(path: pathlib.Path) Tokens[source]

Create from a JSON file.

classmethod from_json_response(response: Dict, refresh_token: str | None = None) Tokens[source]

Create from JSON response.

property has_expired: bool[source]

Return whether the token has expired.

refresh_token: str[source]
write_to_file(path: pathlib.Path) None[source]

Write tokens to file.

mantik.authentication.tokens.get_user_id_from_token(token: str) str[source]
mantik.authentication.tokens.logger[source]