Kitaru

ApiToken

Cached bearer token.

Attributes

attributeaccess_tokenstr
attributeexpires_atdatetime | None
= None
attributeleeway_secondsint
= 0
attributeexpiredbool

Report whether the token is expired or about to be.

Functions

funcfrom_response(cls, response) -> Self

Build a cached token from a login response.

paramcls
paramresponseTokenResponse

Token response returned by the server.

Returns

typing.Self

Token with its absolute expiry and leeway resolved.

funcissued(cls, access_token, expires_in) -> Self

Build a cached token from a bearer token and its lifetime.

paramcls
paramaccess_tokenstr

Bearer token.

paramexpires_inint

Token lifetime in seconds.

Returns

typing.Self

Token with its absolute expiry and leeway resolved.

On this page