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

feat: Trusted Proxies #624

Merged
merged 3 commits into from Feb 10, 2024
Merged

Conversation

LaurenceJJones
Copy link
Contributor

@LaurenceJJones LaurenceJJones commented Jan 20, 2024

Fix #554

Added the option to configuration to allow trusted proxies, is handled the same way as every other []string

However, I had to find a workaround for unix sockets since there was no "official" way for Gin to handle these.

So in short if the request comes from unix socket then the RemoteAddr is set to 127.0.0.1 so if the user would like to trust a webserver that communicates on the socket then they would need to trust 127.0.0.1 via the new option.

By default the RemoteAddr is set to @ on unix socket requests , however, gin only allows IP's within the trusted proxies

@LaurenceJJones LaurenceJJones requested a review from a team as a code owner January 20, 2024 17:48
Copy link

codecov bot commented Jan 20, 2024

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (d32d131) 86.89% compared to head (2953d75) 86.81%.

Files Patch % Lines
router/router.go 66.66% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #624      +/-   ##
==========================================
- Coverage   86.89%   86.81%   -0.08%     
==========================================
  Files          44       44              
  Lines        1587     1593       +6     
==========================================
+ Hits         1379     1383       +4     
- Misses        124      125       +1     
- Partials       84       85       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

router/router.go Outdated Show resolved Hide resolved
router/router.go Outdated Show resolved Hide resolved
@jmattheis jmattheis merged commit 46281d6 into gotify:master Feb 10, 2024
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Option to log X-Forwarded-For client IP
2 participants