fix(common): streaming.secret requires SASL username with the mechanism - #1798
Merged
Conversation
The SASL fail-fast only checked STREAMING_SASL_PASSWORD; a mechanism configured with a password but no username still rendered (STREAMING_SASL_USERNAME: "") and crashed at boot, since lib-streaming rejects a SASL mechanism without BOTH credentials. Accept the resolved saslUsername (ConfigMap value, configmap.STREAMING_SASL_USERNAME -> global.streaming.saslUsername precedence) and fail the render when a mechanism is set without it. Usage example updated to pass saslUsername.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe streaming Secret helper now resolves SASL mechanism and username with ConfigMap-over-global precedence. It passes both values to the Secret helper and fails rendering when a configured mechanism has no username. ChangesStreaming Secret credentials
✨ Finishing Touches✨ Simplify code
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@charts/lerian-common/templates/_streaming.tpl`:
- Around line 113-122: Update the call to lerian-common.streaming.secret to
resolve saslMechanism and saslUsername using the same hasKey-based
ConfigMap-over-global precedence as lerian-common.streaming.env. Preserve
explicit empty ConfigMap values, then pass both resolved values so validation
handles ConfigMap-only settings correctly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 98f8d180-b50f-472f-9cf4-5156160647b8
📒 Files selected for processing (1)
charts/lerian-common/templates/_streaming.tpl
…figmap precedence The streaming.secret usage example read saslMechanism/saslUsername from global only, so a copied consumer would bypass validation on a ConfigMap-only mechanism and hit a false failure on a ConfigMap-only username. Show the configmap-over-global hasKey resolution (matching streaming.env and the real midaz call sites).
This was referenced Aug 2, 2026
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.
Addresses a fail-fast gap raised on midaz #1741 (Gandalf 5th review).
Problem
The SASL fail-fast (added earlier) only required
STREAMING_SASL_PASSWORD. With a mechanism (e.g.SCRAM-SHA-512) and a password but no username, the render passed (Ledger and CRM), the ConfigMap emittedSTREAMING_SASL_USERNAME: "", and the workload crashed at bootstrap — lib-streaming rejects a SASL mechanism without both credentials.Fix
lerian-common.streaming.secretnow accepts the resolvedsaslUsername(a ConfigMap value, resolved by the caller withconfigmap.STREAMING_SASL_USERNAME → global.streaming.saslUsername) and fails the render when a mechanism is set without it — same shape as the existing password check.Validation
helm lintpasses. The midaz call sites passsaslUsernameand negative assertions (username missing, Ledger + CRM) land with the re-pin in #1741.