Skip to main content

Module token

Module token 

Source
Expand description

Credentials seen by the shared HTTP layer: a TokenSource gives a bearer token (or signs a request in the auth-* crates), and TokenCache keeps it until exp - 5 min with one forced refresh on 401 (plan §6, C8).

Structs§

AccessToken
A token and how long it stays valid.
SecretString
A secret string whose Debug / Display never print the value.
StaticToken
A token that never changes (Fly deploy token, tests).
TokenCache
Caches a TokenFetcher’s token until exp - REFRESH_MARGIN. Concurrent callers share one fetch (the lock is held while fetching).

Constants§

REFRESH_MARGIN
Refresh margin before expiry.

Traits§

TokenFetcher
Fetches fresh tokens (metadata server, STS, Entra, a static deploy token).
TokenSource
What the HTTP client asks for: a current token, or a forced refresh after a 401.