kafka: decouple security SASL types from Sarama - #5952
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughChangesThe Kafka sink now owns internal SASL, OAuth2, GSSAPI, and SCRAM configuration types. The exported security SASL definitions were removed. Kafka options, Sarama integration, OAuth2 token provisioning, and tests now use the internal types and local parsers. Kafka SASL decoupling
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related PRs
Suggested labels: Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
/test all |
|
/test pull-error-log-review |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lidezhu, wk989898 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What problem does this PR solve?
Issue Number: close #5892
Kafka SASL configuration and SCRAM authentication were owned by
pkg/security. The configuration model also derived protocol values from Sarama, coupling Kafka-independent security code and Kafka configuration parsing to a specific Kafka client.What is changed and how it works?
pkg/sink/kafka.pkg/securityintopkg/sink/kafkaas private implementation details.pkg/security.PLAIN,SCRAM-SHA-256,SCRAM-SHA-512,GSSAPI, andOAUTHBEARER.0, user=1, and keytab=2.ErrKafkaInvalidConfigerrors without intermediate generic errors or duplicate wrapping.Check List
Tests
go test ./pkg/security ./pkg/sink/kafkago test -race -tags=intest ./pkg/security ./pkg/sink/kafkago test -tags=intest ./downstreamadapter/sink/kafka ./downstreamadapter/sink/topicmanagergit diff --checkQuestions
Will it cause performance regression or break compatibility?
No performance regression is expected. SASL parsing and validation run while creating or verifying a Kafka sink, not on the message production path.
Existing configuration keys, accepted values, case-insensitive parsing, and authentication behavior remain compatible. Invalid configuration errors now consistently use the
CDC:ErrKafkaInvalidConfigRFC code.Do you need to update user documentation, design documentation or monitoring documentation?
No. This refactor does not change user-facing configuration or monitoring behavior.
Release note
Summary by CodeRabbit
New Features
Refactor