Skip to main content

Module federation

Module federation 

Source
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-beta value 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. force skips the cache, as after a 401.