scram support fails - #1
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR extends kroxy’s SASL pass-through model to support SCRAM-SHA-256 and SCRAM-SHA-512 in addition to PLAIN, enabling tenant routing based on the SCRAM client-first username while relaying SaslAuthenticate payloads to the upstream broker.
Changes:
- Refactors upstream connection setup to separate ApiVersions / SaslHandshake negotiation from mechanism-specific authentication, adding a SCRAM relay path.
- Adds proxy-side SCRAM handling: mechanism negotiation, username extraction from client-first-message for tenant routing, and SaslAuthenticate relay to upstream.
- Updates docs, metrics, and tests (unit + integration) to cover SCRAM mechanisms.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| upstream/conn.go | Splits dialing/negotiation vs auth; adds DialForSCRAM + SaslAuthenticate relay helper. |
| proxy/conn.go | Adds SCRAM state handling and SaslAuthenticate relay flow; introduces SASL handshake/auth outcome metric. |
| auth/sasl_scram.go | Adds SCRAM mechanism constants and parsing of SCRAM client-first-message username. |
| observability/metrics.go | Adds a new Prometheus counter for SASL handshake/auth outcomes. |
| README.md | Documents SCRAM support and updated authentication model/limitations. |
| proxy/upstream_test.go | Extends fake broker to support multi-round SCRAM-style SaslAuthenticate replies. |
| proxy/conn_scram_test.go | Adds unit tests for SCRAM handshake advertisement and relay behavior. |
| integration/scram_test.go | Adds end-to-end SCRAM-SHA-256 / SCRAM-SHA-512 integration coverage. |
| integration/kafka_test.go | Updates Kafka container startup to enable SCRAM and provision SCRAM credentials. |
| dockerfiles/kafka_jaas.conf | Adds SCRAM login module to demo JAAS config. |
| dockerfiles/docker-compose.yml | Advertises SCRAM mechanisms and documents how to bootstrap SCRAM users in the demo stack. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
No description provided.