tokens
etl_craft.services.operations.tokens ¶
Create, revoke and authenticate opaque API tokens without retaining their values.
TokenView
dataclass
¶
A token's identity and lifetime, without its value or hash.
TokensView
dataclass
¶
Token metadata visible to an administrator.
CreatedToken
dataclass
¶
The value returned once, alongside safe token metadata.
create_token ¶
create_token(ctx: OperationContext, name: str, role: str, expires: str | None = None) -> CreatedToken
Print-once credentials contain 256 random bits; only their SHA-256 is stored.
list_tokens ¶
Return safe metadata; credential hashes never enter operation JSON.
revoke_token ¶
Revoke a token immediately; each request authenticates against current storage.
authenticate ¶
Refuse unknown, expired, revoked and unsupported project-scoped tokens.