feat(config): session correlation header injection configuration#197
Draft
SasSwart wants to merge 1 commit intosasswart/feat-audit-session-sequence-wiringfrom
Draft
Conversation
This was referenced Apr 30, 2026
Add YAML and CLI configuration surface for session correlation header injection per the Bridge/Boundaries Correlation RFC (FR 2). New configuration options: - --enable-session-correlation / session_correlation_enabled: top-level toggle to disable injection entirely for deployments without AI Bridge in front. - --inject-session-id-on / session_id_inject_targets (YAML): repeatable list of inject targets in "domain=<host> [path=<glob>]" format. - --session-id-header-name / session_id_header_name: configurable header name (default X-Coder-Agent-Firewall-Session-Id). - --sequence-number-header-name / sequence_number_header_name: configurable header name (default X-Coder-Agent-Firewall-Sequence-Number). Config validation ensures that when correlation is enabled at least one inject target is present and header names are non-empty. Parsing validates the domain=... path=... key-value format and rejects unknown keys. This commit adds config and validation only; runtime injection is wired in a follow-up PR.
c24a0fd to
c08f291
Compare
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.
PR Map
RFC: Bridge ↔ Boundaries Correlation
Add YAML and CLI configuration surface for session correlation header injection per FR 2 of the RFC.
Depends on #196.
Changes
config/session_correlation.go: New file. DefinesSessionCorrelationConfig,InjectTarget,ParseInjectTarget,ValidateSessionCorrelation, and default header name constants (X-Coder-Agent-Firewall-Session-Id,X-Coder-Agent-Firewall-Sequence-Number).config/session_correlation_test.go: New file. Table-driven tests forParseInjectTarget,ValidateSessionCorrelation, and the end-to-endNewAppConfigFromCliConfigsession correlation path.config/config.go: Wire session correlation fields intoCliConfig(five new fields for serpent bindings) andAppConfig(newSessionCorrelationfield). AddbuildSessionCorrelationhelper that merges YAML+CLI inject targets, applies header name defaults, and validates the result.cli/cli.go: Register five new serpent options:--enable-session-correlation,--inject-session-id-on(repeatable), YAML-onlysession_id_inject_targets,--session-id-header-name,--sequence-number-header-name.New CLI flags
--enable-session-correlationBOUNDARY_SESSION_CORRELATION_ENABLEDsession_correlation_enabledfalse--inject-session-id-onBOUNDARY_INJECT_SESSION_ID_ONdomain=<host> [path=<glob>])session_id_inject_targets--session-id-header-nameBOUNDARY_SESSION_ID_HEADER_NAMEsession_id_header_nameX-Coder-Agent-Firewall-Session-Id--sequence-number-header-nameBOUNDARY_SEQUENCE_NUMBER_HEADER_NAMEsequence_number_header_nameX-Coder-Agent-Firewall-Sequence-NumberThis commit adds config and validation only; runtime injection is wired in a follow-up PR.
Note
This PR was authored by Coder Agents.