Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 14, 2025

Reverse proxy setups vary in their authentication header conventions (X-User-Email, X-Authenticated-User, X-Remote-User, etc.). The header name was hardcoded, preventing deployment flexibility.

Changes

  • Config: Added auth_user_header to AppSettings (default: X-User-Email)
  • Middleware: AuthMiddleware now accepts auth_header_name parameter
  • Integration: Main app passes config value to middleware
  • Documentation: Added AUTH_USER_HEADER to .env.example with common examples

Usage

# Default (no change needed)
# Uses X-User-Email

# Override for different reverse proxy
AUTH_USER_HEADER=X-Authenticated-User

# Apache mod_auth setup
AUTH_USER_HEADER=X-Remote-User

Tests verify custom headers work in both debug and production modes, and that incorrect headers are rejected.

Original prompt

This section details on the original issue you should resolve

<issue_title>enable a .env config value to determine the exact header to extract the username from the reverse proxy</issue_title>
<issue_description>make the app more flexible.
different systems have different reverse proxy setups and inject different header keys.
make it so that the header to extract can be configured by a .env var with the current setup as the default. </issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…ER env var

Co-authored-by: garland3 <1162675+garland3@users.noreply.github.com>
Copilot AI changed the title [WIP] Enable .env config value for header extraction Make authentication header name configurable via AUTH_USER_HEADER Nov 14, 2025
Copilot AI requested a review from garland3 November 14, 2025 16:31
Copilot finished work on behalf of garland3 November 14, 2025 16:31
Add documentation for the configurable authentication header (`AUTH_USER_HEADER`), explaining how to customize it for different reverse proxy setups (e.g., `X-User-Email`, `X-Remote-User`). This provides flexibility to integrate with various authentication infrastructures without code changes.
@github-actions
Copy link

🔒 Security Scan Results

Security Scan Summary

Scan Results

Python SAST (Bandit)

⚠️ Security issues found in Python code

Recommendations

  • Review all SARIF files uploaded to GitHub Security tab
  • Address high and critical severity vulnerabilities immediately
  • Run npm audit fix and pip-audit locally to fix dependencies
  • Consider implementing additional security controls

@garland3 garland3 marked this pull request as ready for review November 15, 2025 02:32
@garland3 garland3 merged commit d7864e6 into main Nov 15, 2025
9 checks passed
@garland3 garland3 deleted the copilot/add-env-variable-for-header branch November 15, 2025 02:34
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.

enable a .env config value to determine the exact header to extract the username from the reverse proxy

2 participants