Skip to main content

Module oauth

Module oauth 

Source
Expand description

OAUTHBEARER tokens: the token provider seam, an OAuth 2 client credentials provider and a jwt-bearer client assertion provider (KIP-768), and a background refresh task for either.

Kafka’s OAuthBearerLoginCallbackHandler gets a token from a JwtRetriever. ClientCredentialsJwtRetriever posts a client_credentials grant to sasl.oauthbearer.token.endpoint.url, JwtBearerJwtRetriever instead posts the urn:ietf:params:oauth:grant-type:jwt-bearer grant with a signed client assertion, and ExpiringCredentialRefreshingLogin fetches a new token before the old one expires. spawn_background_refresh is this crate’s equivalent of that last part.

Structs§

ClientCredentialsConfig
The settings of ClientCredentialsTokenProvider, as Kafka’s SaslConfigs names them.
ClientCredentialsTokenProvider
An OAUTHBEARER token provider that uses the OAuth 2 client credentials grant, as Kafka’s ClientCredentialsJwtRetriever with ClientSecretRequestFormatter does.
JwtBearerConfig
The settings of JwtBearerTokenProvider, as Kafka’s SaslConfigs names them.
JwtBearerTokenProvider
An OAUTHBEARER token provider that uses the OAuth 2 jwt-bearer grant with a signed client assertion (RFC 7523), as Kafka’s JwtBearerJwtRetriever with JwtBearerRequestFormatter does.

Constants§

DEFAULT_LOGIN_REFRESH_BUFFER
Kafka’s sasl.login.refresh.buffer.seconds default.
DEFAULT_LOGIN_REFRESH_MIN_PERIOD
Kafka’s sasl.login.refresh.min.period.seconds default.
DEFAULT_LOGIN_REFRESH_WINDOW_FACTOR
Kafka’s sasl.login.refresh.window.factor default.
DEFAULT_LOGIN_REFRESH_WINDOW_JITTER
Kafka’s sasl.login.refresh.window.jitter default.
DEFAULT_LOGIN_RETRY_BACKOFF
Kafka’s sasl.login.retry.backoff.ms default.
DEFAULT_LOGIN_RETRY_BACKOFF_MAX
Kafka’s sasl.login.retry.backoff.max.ms default.

Traits§

OAuthBearerTokenProvider
A source of OAUTHBEARER tokens, as Kafka’s sasl.login.callback.handler.class with an OAuthBearerTokenCallback is.

Functions§

spawn_background_refresh
Starts a background task that keeps provider’s token fresh.

Type Aliases§

RefreshFuture
The future of OAuthBearerTokenProvider::refresh_at.
TokenFuture
The future of OAuthBearerTokenProvider::token.