Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix greatuk 1595 check x forward for header #851

Merged
merged 19 commits into from
Jan 27, 2025

Conversation

bobby-didcoding
Copy link
Contributor

@bobby-didcoding bobby-didcoding commented Jan 23, 2025

As Directory SSO is not behind an IP filter it needs to check for the x-forwarded-for header in GovPaaS only.

(Note: Although the HTTP header is called X-Forwarded-For, Django makes it available as request.META['HTTP_X_FORWARDED_FOR']. With the exception of content-length and content-type, any HTTP headers in the request are converted to request.META keys by converting all characters to uppercase, replacing any hyphens with underscores and adding an HTTP_ prefix to the name.)

The middleware I have introduced checks IP address that have been passed through via request.META['HTTP_X_FORWARDED_FOR'] against the ALLOWED_IPS settings.

Workflow

Merging

  • This PR can be merged by reviewers.

Copy link
Contributor

@hal274 hal274 left a comment

Choose a reason for hiding this comment

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

please ensure this is tested after deploying to dbt platform

@hal274 hal274 merged commit bb6fb54 into develop Jan 27, 2025
6 checks passed
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.

2 participants