Skip to content

common_auth.contracts.tokens

Issued tokens and their declared bindings and authorization lineage.

Opaque values are supported without decoding. Binding facts do not establish trust or permission. Freshness, renewal, revocation, refresh-token retention and store coordination belong to runtime components, not these immutable values.

Classes

AccessToken

Bases: _TokenValue

An opaque resource-access credential with an explicit declared token type.

No Bearer default or JWT parsing is applied. The receiving authenticator validates that the type and binding are supported for its destination.

Fields and properties declared here; inherited members belong to the bases above.

token_type

token_type: TokenType

RefreshToken

Bases: _TokenValue

An opaque renewal credential with its own independently supplied binding.

Its permissions can exceed those of an associated access token. Construction does not copy access-token scopes, rotate the value or infer its lifetime.

TokenBinding

Bases: BaseModel

Known attribution and access/proof bindings for an issued token.

None means not supplied/unknown; an empty audience or scope set is known empty. A principal may name a federated authority different from the token issuer. Proof-binding absence never overrides a consumer’s proof policy. Collections are immutable and serialize deterministically.

Fields and properties declared here; inherited members belong to the bases above.

audiences

audiences: frozenset[Audience] | None = None

client_id

client_id: ClientId | None = None

issuer

issuer: IssuerId

principal

principal: PrincipalRef | None = None

proof_key

proof_key: KeyBinding | None = None

scopes

scopes: ScopeSet | None = None

TokenSet

Bases: BaseModel

An access/optional refresh pair associated with one authorization lineage.

Known issuer, client and principal identities must agree across the pair; audiences, scopes and proof bindings are independently represented. Multiple access selections can share a GrantRef. This is a value snapshot, not a refresh response patch: the runtime retains an existing refresh token when a response omits a replacement, before assembling the resulting snapshot.

Fields and properties declared here; inherited members belong to the bases above.

access

access: AccessToken

grant

grant: GrantRef

refresh

refresh: RefreshToken | None = None