-
Notifications
You must be signed in to change notification settings - Fork 77
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
Add native Gasket trust proxy support to Express & Fastify #675
Merged
agerard-godaddy
merged 10 commits into
godaddy:main
from
cburton-godaddy:trust-proxy-support
Feb 12, 2024
Merged
Add native Gasket trust proxy support to Express & Fastify #675
agerard-godaddy
merged 10 commits into
godaddy:main
from
cburton-godaddy:trust-proxy-support
Feb 12, 2024
Conversation
This file contains 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
agerard-godaddy
previously approved these changes
Feb 8, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥇 Nice
rmarkins-godaddy
approved these changes
Feb 8, 2024
Need to skip req
assignment - opting for lifecycle context alignment in future work.
agerard-godaddy
approved these changes
Feb 12, 2024
agerard-godaddy
pushed a commit
that referenced
this pull request
Feb 15, 2024
* feat: add trustProxy option and req.trustProxy to express plugin * test: add tests for trust proxy option in express plugin * docs: add new trustProxy option to documentation for express plugin * feat: add trustProxy option and req.trustProxy to fastify plugin * test: add tests for trust proxy option in fastify plugin * docs: add new trustProxy option to documentation for fastify plugin * fix: incorrectly registered trust proxy middleware for fastify * fix: incorrectly registered trust proxy middleware for express * fix: removing default req.trustProxy assignment in favour of lifecycle in future * test: reduce middleware call numbers to reflect default req.trustProxy middleware removal (cherry picked from commit e708022)
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.
Summary
Both the Express and Fastify plugins do not support trust proxy natively in Gasket, this leads to custom patching in lifecycles and middlewares.
This change begins the support for the trust proxy option in both Express & Fastify. This PR adds native support for passing this option and enabling trust proxy in both frameworks via Gasket configuration.
Changelog
All commits adhere to conventional commits and can be used in the changelog.
Test Plan
I have added unit tests and tested this change locally.