flipt icon indicating copy to clipboard operation
flipt copied to clipboard

feat: add support for custom context path

Open tvcsantos opened this issue 1 year ago • 9 comments

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 ;)

tvcsantos avatar May 27 '24 19:05 tvcsantos

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 ;)

markphelps avatar May 27 '24 22:05 markphelps

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.

codecov[bot] avatar May 28 '24 13:05 codecov[bot]

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 ;)

I will do the docs if needed no worries there

tvcsantos avatar May 28 '24 22:05 tvcsantos

@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

tvcsantos avatar May 28 '24 22:05 tvcsantos

Thank you for your contributions @tvcsantos 🙌 We definitely want to get these changes in either way :D

GeorgeMac avatar May 29 '24 08:05 GeorgeMac

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.

erka avatar May 29 '24 15:05 erka

@markphelps @GeorgeMac created a separate PR to deal with the addition of GHE support #3136.

tvcsantos avatar May 30 '24 09:05 tvcsantos

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.

tvcsantos avatar May 30 '24 09:05 tvcsantos

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

tvcsantos avatar May 30 '24 11:05 tvcsantos

I will close this PR since this is being addressed on other #3135

tvcsantos avatar Jun 07 '24 10:06 tvcsantos