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

Add native Gasket trust proxy support to Express & Fastify #675

Merged
merged 10 commits into from
Feb 12, 2024

Conversation

cburton-godaddy
Copy link
Contributor

@cburton-godaddy cburton-godaddy commented Feb 8, 2024

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.

agerard-godaddy
agerard-godaddy previously approved these changes Feb 8, 2024
Copy link
Contributor

@agerard-godaddy agerard-godaddy left a comment

Choose a reason for hiding this comment

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

🥇 Nice

@agerard-godaddy agerard-godaddy dismissed their stale review February 9, 2024 17:01

Need to skip req assignment - opting for lifecycle context alignment in future work.

@agerard-godaddy agerard-godaddy merged commit e708022 into godaddy:main Feb 12, 2024
4 checks passed
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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants