Expand description
Token management — exchanging credentials for JWTs.
The Chalk API uses OAuth2 client-credentials flow:
- You POST your
client_id+client_secretto/v1/oauth/token. - The server returns a JWT (
access_token) that expires after some time. - You attach this JWT as a
Bearertoken on every subsequent request.
This module handles the exchange and caches the token so we don’t hit
the auth endpoint on every single query. The cache is thread-safe (using
tokio::sync::RwLock) so multiple async tasks can share a single
TokenManager.
Structs§
- Token
Manager - Manages authentication tokens for the Chalk client.