Skip to content

Feat/enable sasl types - #3

Merged
bubunyo merged 2 commits into
mainfrom
feat/enable-sasl-types
Jun 11, 2026
Merged

Feat/enable sasl types#3
bubunyo merged 2 commits into
mainfrom
feat/enable-sasl-types

Conversation

@bubunyo

@bubunyo bubunyo commented Jun 11, 2026

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for configuring kroxy to authenticate upstream Kafka connections for PLAIN clients using SCRAM-SHA-256/512, enabling a PLAIN→SCRAM bridging mode while keeping existing SCRAM pass-through behavior intact.

Changes:

  • Introduces upstream.DialSCRAM and SCRAM client-side authentication flow using franz-go’s SCRAM mechanism.
  • Adds proxy-side decision logic to translate PLAIN client auth into upstream SCRAM auth when upstream.sasl.mechanism is configured.
  • Documents the new configuration and behavior, and adds targeted unit/integration-style tests.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
upstream/scram_test.go New in-process fake SCRAM broker test validating DialSCRAM end-to-end.
upstream/conn.go Adds DialSCRAM and SCRAM client handshake driver (scramAuthenticate).
README.md Documents upstream.sasl.mechanism and explains PLAIN→SCRAM translation semantics.
proxy/translate_internal_test.go Adds unit test for PLAIN→SCRAM translation decision logic.
proxy/listener.go Extends ServerConfig with UpstreamSASLMechanism.
proxy/conn.go Dials upstream via DialSCRAM when translation is enabled; improves upstream logging.
dockerfiles/kroxy.yaml Example/commented config snippet for upstream SCRAM translation.
config/config.go Adds upstream.sasl.mechanism config struct and validates SCRAM-only values.
config/config_test.go Adds config coverage for valid/invalid upstream.sasl.mechanism values.
cmd/kroxy/main.go Wires config value into proxy.ServerConfig.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread upstream/scram_test.go
Comment thread upstream/scram_test.go
Comment thread proxy/translate_internal_test.go
@bubunyo
bubunyo merged commit 6ce32c6 into main Jun 11, 2026
9 checks passed
@bubunyo
bubunyo deleted the feat/enable-sasl-types branch June 11, 2026 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants