TokenInfo¶
- pydantic model gafaelfawr.models.token.TokenInfo¶
Information about a token.
All information about the token that’s stored in the underlying database. It includes some fields not present in Redis.
- Parameters:
data (
Any
)
Show JSON schema
{ "title": "TokenInfo", "description": "Information about a token.\n\nAll information about the token that's stored in the underlying\ndatabase. It includes some fields not present in Redis.", "type": "object", "properties": { "username": { "description": "User to whom the token was issued", "examples": [ "someuser" ], "maxLength": 64, "minLength": 1, "title": "Username", "type": "string" }, "token_type": { "$ref": "#/$defs/TokenType", "examples": [ "session" ], "title": "Token type" }, "service": { "anyOf": [ { "maxLength": 64, "minLength": 1, "type": "string" }, { "type": "null" } ], "default": null, "description": "Service to which the token was delegated. Only present for internal tokens.", "examples": [ "some-service" ], "title": "Service" }, "scopes": { "description": "Scopes of the token", "examples": [ [ "read:all", "user:token" ] ], "items": { "type": "string" }, "title": "Token scopes", "type": "array" }, "created": { "description": "Creation timestamp of the token in seconds since epoch", "examples": [ 1614986130 ], "format": "date-time", "title": "Creation time", "type": "string" }, "expires": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "description": "Expiration timestamp of the token in seconds since epoch", "examples": [ 1616986130 ], "title": "Expiration time" }, "token": { "examples": [ "5KVApqcVbSQWtO3VIRgOhQ" ], "maxLength": 22, "minLength": 22, "title": "Token key", "type": "string" }, "token_name": { "anyOf": [ { "maxLength": 64, "minLength": 1, "type": "string" }, { "type": "null" } ], "default": null, "examples": [ "laptop token" ], "title": "User-given name of the token" }, "last_used": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "description": "When the token was last used in seconds since epoch", "examples": [ 1614986130 ], "title": "Last used" }, "parent": { "anyOf": [ { "maxLength": 22, "minLength": 22, "type": "string" }, { "type": "null" } ], "default": null, "examples": [ "DGO1OnPohl0r3C7wqhzRgQ" ], "title": "Parent token" } }, "$defs": { "TokenType": { "description": "The class of token.", "enum": [ "session", "user", "notebook", "internal", "service", "oidc" ], "title": "TokenType", "type": "string" } }, "required": [ "username", "token_type", "scopes", "token" ] }
- Fields:
- Validators:
- field created: Timestamp [Optional]¶
Creation timestamp of the token in seconds since epoch
- Constraints:
func = <function <lambda> at 0x7fe681f01260>
json_schema_input_type = PydanticUndefined
return_type = <class ‘int’>
when_used = always
- field expires: Timestamp | None = None¶
Expiration timestamp of the token in seconds since epoch
- field last_used: Timestamp | None = None¶
When the token was last used in seconds since epoch
- field parent: str | None = None¶
- Constraints:
min_length = 22
max_length = 22
- field scopes: list[str] [Required]¶
Scopes of the token
- Validated by:
- field service: str | None = None¶
Service to which the token was delegated. Only present for internal tokens.
- Constraints:
min_length = 1
max_length = 64
- field token: str [Required]¶
- Constraints:
min_length = 22
max_length = 22
- field token_name: str | None = None¶
- Constraints:
min_length = 1
max_length = 64
- field token_type: TokenType [Required]¶
- field username: str [Required]¶
User to whom the token was issued
- Constraints:
min_length = 1
max_length = 64