TokenData#

class gafaelfawr.models.token.TokenData(**data)#

Bases: TokenBase, TokenUserInfo

Data about a token stored in Redis.

This holds all the token information stored in Redis, and thus all the token information required to support authentication decisions and (currently) user information queries. It should not be used directly as a response model; for that, see TokenInfo and TokenUserInfo.

Parameters:

data (Any)

Attributes Summary

model_config

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

Methods Summary

bootstrap_token()

Build authentication data for the bootstrap token.

internal_token()

Build authentication data for the internal token.

Attributes Documentation

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

Methods Documentation

classmethod bootstrap_token()#

Build authentication data for the bootstrap token.

This token doesn’t exist in the backing store, so instead synthesize a TokenData object for it.

Returns:

Artificial data for the bootstrap token.

Return type:

TokenData

classmethod internal_token()#

Build authentication data for the internal token.

Similar to the bootstrap token, this does not exist in the backing store. It is used by background jobs internal to Gafaelfawr.

Returns:

Artificial data for the bootstrap token.

Return type:

TokenData