module documentation

Convenience bearer for federated credentials.

This module exposes FederatedCredentialsBearer, a convenience wrapper that composes the low-level federated credentials reader/token requester implementations with the exchangeable and renewable bearers to provide a ready-to-use bearer producing short-lived access tokens.

The class accepts one of several inputs for federated_credentials:

The resulting bearer performs the token exchange via nebius.aio.token.exchangeable.Bearer and adds background refresh via nebius.aio.token.renewable.Bearer. When the underlying credentials originate from a file the resulting bearer is wrapped in a nebius.aio.token.token.NamedBearer to provide a stable diagnostic name.

Example

Using a file path:

from nebius.aio.token.federated_credentials import FederatedCredentialsBearer
bearer = FederatedCredentialsBearer(
    "/path/to/fed-credentials.json",
    service_account_id="sa-123",
)
token = await bearer.receiver().fetch()

Using an existing reader/token requester:

reader = SomeReader(...)
bearer = FederatedCredentialsBearer(reader, service_account_id="sa-123")
Class FederatedCredentialsBearer Bearer that exchanges federated credentials for access tokens.