module documentation
Token exchange bearer and receiver.
This module implements a bearer that exchanges a permanent service-account JWT
or similar credentials for a short-lived access token using the
TokenExchangeService. The exchange is performed via a gRPC call
and the response is converted into a Token instance.
The primary classes are:
Receiver-- performs the token exchange request for a single- fetch and exposes can_retry logic.
Bearer-- holds the channel and requester and constructs- per-request receivers.
Examples
Create a bearer with a preconfigured channel:
from nebius.aio.token.exchangeable import Bearer bearer = Bearer(requester, channel=my_channel) token = await bearer.receiver().fetch()
| Class | |
Bearer that creates receivers performing token exchange. |
| Class | |
Receiver that performs a token exchange over gRPC. |
| Exception | |
Raised when the token exchange returned an unexpected response type. |
| Exception | |
Raised when the token exchange returned a non-Bearer token. |
| Variable | log |
Undocumented |
| Variable | sanitizer |
Undocumented |