Skip to main content

Module token

Module token 

Source
Expand description

The bearer-token abstraction the Client mints from.

App Store Connect wants a short-lived ES256 JWT on every request. The usual way to produce one is an ApiKey signing its own claims, but it isn’t the only way: CI often injects a token minted elsewhere, and tests want a fixed string. TokenSource is the seam that lets all three flow through the same client without the client caring which it holds.

Client::new takes impl IntoTokenSource, so Client::new(api_key) keeps working unchanged while a StaticToken or any custom source is equally accepted.

Structs§

MintedToken
A freshly minted bearer token and how long it stays valid.
StaticToken
A fixed, already-minted bearer token.

Traits§

IntoTokenSource
Conversion into a boxed TokenSource, so Client::new can accept an ApiKey, a StaticToken, a Box<dyn TokenSource>, or any custom source with one signature.
TokenSource
Anything that can produce a bearer token for the client.