Adds a configurable OAuth provider for Kafka SASL/OAUTHBEARER#1731
Merged
Conversation
…es the MSK IAM token refresh, which panicked at runtime on first refresh. | Provider | Token source | Required config | |---|---|---| | `aws-msk` (default when a region resolves) | aws-msk-iam-sasl-signer, app-managed refresh | region via `--aws-region`/`AWS_REGION`, or AWS profile/IMDS | | `oidc` (Google Managed Kafka, generic OIDC) | librdkafka built-in OIDC handler | token endpoint URL, client id, client secret | Existing MSK IAM configs work unchanged; the provider is inferred when unset. - Nested `Handle::block_on` panic in the OAUTHBEARER refresh callback (fired inside the consumer poll loop's `block_on`) — signer now runs on a dedicated thread with its own single-use runtime, 30s timeout. - Invalid Kafka config aborted only with a `warn!` and silently skipped ingestion — now a hard startup failure when Kafka is configured. - AWS region resolution falls back to the SDK default chain (profile/IMDS), matching where credentials come from; resolved once and cached. - Consumer creation no longer logs the full `ClientConfig` (contains secrets). `rdkafka/curl` + `curl-static` added for librdkafka's OIDC handler; `aws-config` added (already transitive via the signer).
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
WalkthroughKafka security now supports AWS MSK and OIDC OAuthBearer flows, expanded parsing, mechanism-specific prompts, bounded token generation, conditional startup validation, safer logging, and shutdown-safe worker runtimes. ChangesKafka OAuth and configuration
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant librdkafka
participant KafkaContext
participant DefaultRegionChain
participant MSKIAMSigner
librdkafka->>KafkaContext: request OAuth token
KafkaContext->>DefaultRegionChain: resolve signing region
DefaultRegionChain-->>KafkaContext: return region
KafkaContext->>MSKIAMSigner: generate signed token
MSKIAMSigner-->>KafkaContext: return token
KafkaContext-->>librdkafka: provide OAuthToken
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
nitisht
approved these changes
Jul 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
and fixes the MSK IAM token refresh, which panicked at runtime on first refresh.
aws-msk(default when a region resolves)--aws-region/AWS_REGION, or AWS profile/IMDSExisting MSK IAM configs work unchanged; the provider is inferred when unset.
Handle::block_onpanic in the OAUTHBEARER refresh callback (fired inside the consumer poll loop'sblock_on) — signer now runs on a dedicated thread with its own single-use runtime, 30s timeout.warn!and silently skipped ingestion — now a hard startup failure when Kafka is configured.ClientConfig(contains secrets).rdkafka/curl+curl-staticadded for librdkafka's OIDC handler;aws-configadded (already transitive via the signer).Summary by CodeRabbit
New Features
SASL-SSL,OAUTH-BEARER).Bug Fixes
auto.offset.resetonly for earliest/latest sources.Tests