Expand description
Anthropic workload identity federation: exchanges an external OpenID Connect (OIDC) token for a short-lived Anthropic access token and caches it per configuration.
Port of the Anthropic SDK’s oidcFederationProvider and TokenCache
(@anthropic-ai/sdk 0.124.0), which pi v1.0.0 uses when the
ANTHROPIC_FEDERATION_RULE_ID, ANTHROPIC_ORGANIZATION_ID and
ANTHROPIC_IDENTITY_TOKEN_FILE provider settings are set.
Structs§
- Config
- What the exchange needs, from the provider settings.
Constants§
- OAUTH_
API_ BETA - The
anthropic-betavalue that requests with a federated bearer token send.
Functions§
- invalidate
- Drops the cached token for
config. - token
- An access token for
config: the cached one while it has more than 30s left, else a fresh exchange.forceskips the cache, as after a 401.