#[non_exhaustive]pub struct TokenManagerOptions {
pub client_id: String,
pub token_path: String,
pub base_path: String,
pub seed_refresh: Option<String>,
pub seed_jwt: Option<(String, u64)>,
pub on_persist: Option<PersistCallback>,
}Expand description
Tuning for TokenManager::with_options.
The default preserves the historical TokenManager::new behavior exactly:
client_id = CLIENT_ID (hotdata-rust-sdk), token_path = /v1/auth/jwt,
empty base_path, no seed, and no persistence callback. Hosts that mint
under a different attribution (e.g. the CLI’s hotdata-cli at /o/token/)
or that need to seed an existing session and persist rotations override the
relevant fields.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.client_id: Stringclient_id form param sent with every mint. Defaults to CLIENT_ID.
token_path: StringPath appended to base_path for the mint endpoint. Defaults to
/v1/auth/jwt.
base_path: StringAPI base URL the mint POSTs to (e.g. https://api.hotdata.dev). The
builder fills this from the resolved base path.
seed_refresh: Option<String>Optional refresh token to seed the cache with, so the first request can take the refresh path instead of re-minting from the API token.
seed_jwt: Option<(String, u64)>Optional (jwt, exp) to seed the cache with a known-valid JWT (absolute
unix-epoch expiry in seconds), avoiding a mint on the first request.
on_persist: Option<PersistCallback>Optional callback fired after each successful mint so the host can persist the rotated tokens.