feat: add support for custom context path
This PR adds support for custom context path.
Redirection was broken when using a custom context path. It follows the standard using "X-Forwarded-Prefix" header to get the correct context path for redirection.
Thanks for the project.
If you need me to update something feel free to comment ;)
I added the needs_docs label just so we don't forget to update the docs before creating a new release with this feature included
don't feel like you need to add the docs however, we can do that, unless of course you want to ;)
Codecov Report
Attention: Patch coverage is 64.51613% with 11 lines in your changes are missing coverage. Please review.
Project coverage is 72.24%. Comparing base (
f997fb9) to head (e439103). Report is 372 commits behind head on main.
:exclamation: Current head e439103 differs from pull request most recent head bb38dbd
Please upload reports for the commit bb38dbd to get more accurate results.
| Files | Patch % | Lines |
|---|---|---|
| internal/server/authn/method/github/server.go | 52.17% | 10 Missing and 1 partial :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## main #3127 +/- ##
==========================================
+ Coverage 70.78% 72.24% +1.45%
==========================================
Files 91 102 +11
Lines 8729 7673 -1056
==========================================
- Hits 6179 5543 -636
+ Misses 2165 1717 -448
- Partials 385 413 +28
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I added the
needs_docslabel just so we don't forget to update the docs before creating a new release with this feature includeddon't feel like you need to add the docs however, we can do that, unless of course you want to ;)
I will do the docs if needed no worries there
@GeorgeMac I will try to give you feedback on it still this week. But yeah I agree with you maybe we should split in 2 PRs.
I will try to have time tomorrow to split them and then provide feedback regarding the custom path topic.
Thanks for the comments and the collaboration
Thank you for your contributions @tvcsantos 🙌 We definitely want to get these changes in either way :D
Thank you for your hard work here @tvcsantos.
@GeorgeMac I've made some updates regarding the custom context path in #3135, specifically involving the X-Forwarded-Prefix header. These changes are intended to help advance this PR, but they might be somewhat bold. I would appreciate your feedback on it.
@markphelps @GeorgeMac created a separate PR to deal with the addition of GHE support #3136.
Since this thread on the PR is mostly about the context path feature. I will cleanup this PR having only the context path related code, change the title and maintain it open.
Regarding the context path fix, actually in order to test before opening the PR I have created a docker image on my GitHub
https://github.com/tvcsantos/flipt/tree/feature/add-self-hosted-v2
docker pull ghcr.io/tvcsantos/flipt:feature-add-self-hosted-v2
I will close this PR since this is being addressed on other #3135