rpk: enable OAUTHBEARER for remote debug bundle#30277
Merged
Conversation
david-yu
added a commit
that referenced
this pull request
Apr 23, 2026
Add DebugBundleOAuthBearerAuthn, an end-to-end ducktape test that exercises the full OAUTHBEARER forwarding path introduced in #30225 and #30277. The test spins up a Keycloak OIDC provider alongside a single Redpanda broker configured with SASL OAUTHBEARER. It issues a client credentials token from Keycloak, then POSTs a debug bundle start request with authentication: {mechanism: OAUTHBEARER, token: <JWT>}. The broker forwards the token to the rpk subprocess via -Xsasl.mechanism and -Xpass=token:..., and the subprocess authenticates to Kafka using the JWT. The test verifies the bundle completes successfully and the expected topic appears in kafka.json. Supporting changes: - redpanda_types.py: add OAuthBearerCredentials dataclass, which serializes to {mechanism, token} (handled by the existing DebugBundleEncoder dataclass branch without any special-casing) - admin.py: widen DebugBundleStartConfigParams.authentication to accept OAuthBearerCredentials alongside the existing SaslCredentials Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Author
Collaborator
CI test resultstest results on build#83600
|
c-julin
approved these changes
Apr 27, 2026
e5e958e to
4eae801
Compare
Remove the early-exit guard that rejected OAUTHBEARER profiles in 'rpk debug remote-bundle start'. The broker-side admin API now accepts a bearer_creds payload (#30225), and rpadmin v0.2.6 exposes WithOAuthBearerAuthentication so rpk can forward the token. toRpadminOptions now dispatches on mechanism: OAUTHBEARER profiles call WithOAuthBearerAuthentication(token), all other SASL profiles fall through to the existing WithSCRAMAuthentication path. Add DebugBundleOAuthBearerAuthn, an end-to-end ducktape test that exercises the full OAUTHBEARER forwarding path. The test spins up a Keycloak OIDC provider alongside a single Redpanda broker configured with SASL OAUTHBEARER. It issues a client credentials token from Keycloak, then POSTs a debug bundle start request with authentication: {mechanism: OAUTHBEARER, token: <JWT>}. The broker forwards the token to the rpk subprocess via -Xsasl.mechanism and -Xpass=token:..., and the subprocess authenticates to Kafka using the JWT. The test verifies the bundle completes successfully and the expected topic appears in kafka.json. Supporting changes: - redpanda_types.py: add OAuthBearerCredentials dataclass, which serializes to {mechanism, token} - admin.py: widen DebugBundleStartConfigParams.authentication to accept OAuthBearerCredentials alongside the existing SaslCredentials Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
cc3901c to
87f3d57
Compare
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.
Follow-up to #30225 (broker-side OAUTHBEARER support, now merged) and #30169 (rpk OAUTHBEARER SASL support).
Changes
rpadminto v0.2.6 (tagged from common-go#165), which addsWithOAuthBearerAuthentication(token string)out.Dieguard inrpk debug remote-bundle startthat rejected OAUTHBEARER profiles with "not yet supported"toRpadminOptionsnow dispatches on mechanism: OAUTHBEARER callsWithOAuthBearerAuthentication, all other SASL profiles fall through to the existingWithSCRAMAuthenticationpathUsage
Obtain a bearer token from your OIDC provider and pass it via
--password(acceptstoken:<JWT>or a raw JWT) alongside-X kafka_api.sasl.mechanism=OAUTHBEARER:Or bake the mechanism into an rpk profile and pass the token at call time:
rpk debug remote-bundle start --password "token:$TOKEN"The token is forwarded to each broker in
admin_api.addresses. The broker-side rpk subprocess uses it as-Xsasl.mechanism=OAUTHBEARER -Xpass=token:<JWT>when authenticating to Kafka to collect the bundle.Testing
Includes a ducktape end-to-end test (
DebugBundleOAuthBearerAuthn) that exercises the full forwarding chain:{mechanism: OAUTHBEARER, token: <JWT>}-Xsasl.mechanism=OAUTHBEARER -Xpass=token:<JWT>successand the expected topic appears inkafka.jsonSupporting test infrastructure added alongside the test:
OAuthBearerCredentialsdataclass inredpanda_types.py— serializes to{mechanism, token}via the existingDebugBundleEncoderdataclass pathDebugBundleStartConfigParams.authenticationwidened to acceptSaslCredentials | OAuthBearerCredentialsBackports Required
Release Notes
Features
rpk debug remote-bundle startnow supports OAUTHBEARER (OIDC) profiles. Pass the bearer token via--password(orkafka_api.sasl.passwordin the rpk profile) whensasl.mechanismisOAUTHBEARER. Previously the command rejected OAUTHBEARER profiles with an error; broker-side support landed in debug_bundle: support OAUTHBEARER auth in broker-side admin API #30225.