chore(deps): bump github.com/go-chi/chi/v5 from 5.2.5 to 5.3.0#4472
chore(deps): bump github.com/go-chi/chi/v5 from 5.2.5 to 5.3.0#4472dependabot[bot] wants to merge 3 commits into
Conversation
ed56627 to
631c9f0
Compare
631c9f0 to
1c83d21
Compare
Bumps [github.com/go-chi/chi/v5](https://github.com/go-chi/chi) from 5.2.5 to 5.3.0. - [Release notes](https://github.com/go-chi/chi/releases) - [Changelog](https://github.com/go-chi/chi/blob/master/CHANGELOG.md) - [Commits](go-chi/chi@v5.2.5...v5.3.0) --- updated-dependencies: - dependency-name: github.com/go-chi/chi/v5 dependency-version: 5.3.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
1c83d21 to
92d7ac1
Compare
92d7ac1 to
2c1fa13
Compare
2c1fa13 to
deb10c8
Compare
deb10c8 to
99b1a3f
Compare
Greptile SummaryThis PR bumps
Confidence Score: 4/5Safe to merge; the chi bump and ClientIP wiring are well-validated and the default remote-address source eliminates the IP-spoofing surface from the old RealIP middleware. The core change is a careful, well-tested migration away from middleware.RealIP. The only finding is that the r.RemoteAddr fallback in GetRequestAttributes carries a host:port string into a semconv attribute that expects a bare IP, causing inconsistent observability data when GetClientIPAddr is not set. pkg/server/attributes.go — the r.RemoteAddr fallback should strip the port before storing it in the network.peer.address attribute. Important Files Changed
|
| // Prefer the resolved client IP, falling back to the socket peer so telemetry | ||
| // never loses source attribution when client IP resolution fails closed. | ||
| peerAddr := r.RemoteAddr | ||
| if clientIP := middleware.GetClientIPAddr(ctx); clientIP.IsValid() { | ||
| peerAddr = clientIP.String() | ||
| } |
There was a problem hiding this comment.
The fallback
peerAddr = r.RemoteAddr stores a host:port string (Go's http.Request.RemoteAddr is always "IP:port"), while the OTel network.peer.address semconv expects a bare IP address. The happy-path value from clientIP.String() is already port-free, so the two branches are inconsistent and the fallback will produce malformed telemetry whenever the client-IP middleware is not in context.
| // Prefer the resolved client IP, falling back to the socket peer so telemetry | |
| // never loses source attribution when client IP resolution fails closed. | |
| peerAddr := r.RemoteAddr | |
| if clientIP := middleware.GetClientIPAddr(ctx); clientIP.IsValid() { | |
| peerAddr = clientIP.String() | |
| } | |
| // Prefer the resolved client IP, falling back to the socket peer so telemetry | |
| // never loses source attribution when client IP resolution fails closed. | |
| peerAddr := r.RemoteAddr | |
| if host, _, err := net.SplitHostPort(r.RemoteAddr); err == nil { | |
| peerAddr = host | |
| } | |
| if clientIP := middleware.GetClientIPAddr(ctx); clientIP.IsValid() { | |
| peerAddr = clientIP.String() | |
| } |
Bumps github.com/go-chi/chi/v5 from 5.2.5 to 5.3.0.
Release notes
Sourced from github.com/go-chi/chi/v5's releases.
... (truncated)
Commits
3b17157feat: middleware.ClientIP, a replacement for middleware.RealIP (#967)818fdcffix: set Request.Pattern from RoutePattern() (#1097)f975af0Fix typo in Route doc comment (#1073)4ef87eamiddleware: fix httpFancyWriter.ReadFrom double-counting bytes with Tee (#1085)a54874fBump minimum Go to 1.23, always use request.Pattern (#1048)3328d4dApply the stringscutprefix modernizer (#1051)be60b2eSimplify chi.walk with slices.Concat (#1053)a36a925Remove last uses of io/ioutil (#1054)7d93ee3add go 1.26 to ci (#1052)903cff2Propagate inline middlewares across mounted subrouters (#1049)