Skip to content

Validate Sidecar forwarded header configuration - #4018

Merged
Iarek Kovtunenko (iarekk) merged 4 commits into
masterfrom
iinglese/sidecar-forwarded-header-validation-minimal
Sep 14, 2026
Merged

Iarek Kovtunenko (iarekk) merged 4 commits into
masterfrom
iinglese/sidecar-forwarded-header-validation-minimal

Conversation

@iNinja

Copy link
Copy Markdown
Contributor

Summary

  • Reject automatic forwarded-header processing in Sidecar outside Development when ASP.NET Core would enable it.
  • Preserve framework-inactive values and Development behavior.

Release notes

Sidecar startup now rejects automatic forwarded-header processing outside
Development when ForwardedHeaders_Enabled is set to true.

Testing

  • 7 focused startup-path tests passed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a Sidecar startup guard against automatic forwarded-header processing outside Development.

Changes:

  • Validates ForwardedHeaders_Enabled during builder creation.
  • Adds focused environment and configuration tests.
  • Exposes the internal builder factory to the signed test assembly.

Reviewed changes

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

File Description
src/Microsoft.Identity.Web.Sidecar/Program.cs Adds startup validation.
src/Microsoft.Identity.Web.Sidecar/Properties/InternalsVisibleTo.cs Grants test access to internals.
tests/E2E Tests/Sidecar.Tests/ForwardedHeadersConfigurationTests.cs Covers accepted and rejected configurations.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@iNinja

Copy link
Copy Markdown
Contributor Author

Copilot resolve the merge conflicts in this pull request

…rwarded-header-validation-minimal

# Conflicts:
#	src/Microsoft.Identity.Web.Sidecar/Properties/InternalsVisibleTo.cs

Co-authored-by: iNinja <538318+iNinja@users.noreply.github.com>

Copilot AI commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Copilot resolve the merge conflicts in this pull request

Resolved the merge conflict with current master in commit 85eb0e6. The shared InternalsVisibleTo declaration is preserved along with master’s Sidecar test-access documentation, and the 7 focused forwarded-header tests pass.

@iarekk
Iarek Kovtunenko (iarekk) merged commit 6cbbf09 into master Sep 14, 2026
9 checks passed
@iarekk
Iarek Kovtunenko (iarekk) deleted the iinglese/sidecar-forwarded-header-validation-minimal branch September 14, 2026 17:43
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.

6 participants