fix(ci): replace deprecated chi RealIP + rename gomodguard linter#30
Merged
Conversation
chi's middleware.RealIP was deprecated for spoofing the X-Forwarded-For header even when upstreams don't strip it (GHSA-3fxj-6jh8-hvhx, GHSA-rjr7-jggh-pgcp, GHSA-9g5q-2w5x-hmxf), failing go-checks lint. Replace with internal/middleware.RealIP, which only honors XFF when the immediate TCP peer is in a configured trusted-proxy CIDR set. Empty config = no-op (r.RemoteAddr keeps the real peer address), the safe default. New server.trusted_proxies config field lists the CIDRs to trust — set it to your ingress / LB range when running behind one. Indexer's HTTP server doesn't need client-IP resolution (it's only reachable internally from the API server and Prometheus), so the deprecated line is removed there rather than rewired. Signed-off-by: Andre Nogueira <aanogueira@protonmail.com>
golangci-lint v2.12.0 deprecated gomodguard in favor of gomodguard_v2. Explicit enable + disable for the old name keeps the same module-guard behavior without the deprecation warning. Signed-off-by: Andre Nogueira <aanogueira@protonmail.com>
This file contains hidden or 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
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
Two Go-side fixes that were authored as part of #28 but didn't make it into the merge (the PR was merged before these two later commits were pushed). Same content; re-opening cleanly off main.
1. `chi` middleware.RealIP deprecated
Deprecated for spoofing the X-Forwarded-For header even when upstreams don't strip it (GHSA-3fxj-6jh8-hvhx, GHSA-rjr7-jggh-pgcp, GHSA-9g5q-2w5x-hmxf), failing the `go-checks` lint job.
Replace with `internal/middleware.RealIP`, which only honors XFF when the immediate TCP peer is in a configured trusted-proxy CIDR set:
2. `gomodguard` linter renamed to `gomodguard_v2`
golangci-lint v2.12.0 deprecation. Explicit enable + disable for the old name silences the warning.
Verification (locally on this branch)
Test plan
Follow-up