Skip to content

[v25.2.x] rpk: add OAUTHBEARER SASL mechanism support#30315

Closed
david-yu wants to merge 2 commits intov25.2.xfrom
manual-backport-30169-v25.2.x
Closed

[v25.2.x] rpk: add OAUTHBEARER SASL mechanism support#30315
david-yu wants to merge 2 commits intov25.2.xfrom
manual-backport-30169-v25.2.x

Conversation

@david-yu
Copy link
Copy Markdown
Contributor

Summary

Backport of #30169 to v25.2.x.

  • Add OAUTHBEARER as a supported SASL mechanism in rpk, alongside the existing SCRAM-SHA-256 and SCRAM-SHA-512 mechanisms
  • toSASLConfig and NewFranzClient dispatch on OAUTHBEARER to set up bearer token auth for Kafka connections
  • toRpadminOptions calls WithOAuthBearerAuthentication for the admin client
  • OAUTHBEARER rejected early in remote debug bundle with a clear error pointing users at SCRAM (follow-up tracked in issue)
  • Updated -X help text and profile docs to list all four SASL mechanisms including PLAIN and OAUTHBEARER
  • Unit tests for SASL dispatch paths in adminapi, franz client, and schema registry client

Conflicts resolved from original backport

  • profile_doc.go: deleted — file does not exist in v25.2.x; equivalent params.go doc update auto-merged cleanly
  • schemaregistry/BUILD: dropped context_test.go from go_test srcs (does not exist in v25.2.x)

Release Notes

Features

  • Add OAUTHBEARER SASL mechanism support to rpk, enabling OIDC-based authentication for the Kafka client, admin API, and schema registry. Pass the token via --password (raw value or token:<TOKEN> format) with --sasl-mechanism OAUTHBEARER.

🤖 Generated with Claude Code

Add OAUTHBEARER as a supported SASL mechanism in rpk, alongside the
existing SCRAM-SHA-256 and SCRAM-SHA-512 mechanisms.

- toSASLConfig and NewFranzClient now dispatch on OAUTHBEARER to set
  up kgo.SASL with the bearer token from the profile's sasl.password
- toRpadminOptions similarly calls WithOAuthBearerAuthentication for
  the admin client
- OAUTHBEARER is rejected early in remote debug bundle (follow-up
  issue referenced in the guard comment)
- Update -X help text and profile docs to list all SASL mechanisms
  including PLAIN and OAUTHBEARER
- Add unit tests for the SASL dispatch paths in adminapi, franz client,
  and schema registry client; fix $HOME-unset failures in those tests
- Regenerate BUILD files for new test files

(cherry picked from commits in PR #30169)
@david-yu david-yu force-pushed the manual-backport-30169-v25.2.x branch from 3740b53 to 884b5c2 Compare April 28, 2026 03:04
Previous build failed fetching the LLVM 19.1.7 toolchain from GitHub
releases (502 Bad Gateway), unrelated to this PR's changes.
@david-yu david-yu linked an issue Apr 28, 2026 that may be closed by this pull request
@vbotbuildovich
Copy link
Copy Markdown
Collaborator

CI test results

test results on build#83732
test_status test_class test_method test_arguments test_kind job_url passed reason test_history
FLAKY(PASS) SimpleEndToEndTest test_relaxed_acks {"write_caching": false} integration https://buildkite.com/redpanda/redpanda/builds/83732#019dd216-dbd4-4265-a4df-8dfa48d13892 10/11 Test PASSES after retries.No significant increase in flaky rate(baseline=0.0000, p0=1.0000, reject_threshold=0.0100. adj_baseline=0.1000, p1=0.3487, trust_threshold=0.5000) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=SimpleEndToEndTest&test_method=test_relaxed_acks

@david-yu
Copy link
Copy Markdown
Contributor Author

Going to close since OAUTHBEARER SASL override landed for 25.3 and after: #27458

@david-yu david-yu closed this Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[v25.2.x] rpk: add OAUTHBEARER SASL mechanism support

2 participants