Skip to content

Update module github.com/go-chi/chi/v5 to v5.3.0#17

Open
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/github.com-go-chi-chi-v5-5.x
Open

Update module github.com/go-chi/chi/v5 to v5.3.0#17
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/github.com-go-chi-chi-v5-5.x

Conversation

@renovate
Copy link
Copy Markdown
Contributor

@renovate renovate Bot commented Jul 13, 2023

This PR contains the following updates:

Package Change Age Confidence
github.com/go-chi/chi/v5 v5.0.8v5.3.0 age confidence

Release Notes

go-chi/chi (github.com/go-chi/chi/v5)

v5.3.0

Compare Source

What's Changed

New Contributors

SECURITY: middleware.ClientIP, a replacement for middleware.RealIP

PR #​967 introduced middleware.ClientIP, a replacement for middleware.RealIP that closes the three open spoofing advisories:

It also addresses issues outlined at:

middleware.RealIP is deprecated in this PR with pointers to the new API.

The deprecation only adds a // Deprecated: doc comment; the function keeps working for backward compatibility.

Why a new middleware (not "fix RealIP in place")

RealIP has two unfixable design choices: it mutates r.RemoteAddr, and it tries to be a one-size-fits-all default by walking a hard-coded list of headers any client can supply. Per adam-p's "The perils of the 'real' client IP" (which calls chi out by name on this), there is no safe default — the user must pick their trust source explicitly.

The new API

Four middlewares, two accessors. Pick exactly one middleware based on your
infrastructure, read the result with one of the two accessors:

// One of the four. There is no safe default — pick exactly one.
func ClientIPFromHeader(trustedHeader string) func(http.Handler) http.Handler
func ClientIPFromXFF(trustedIPPrefixes ...string) func(http.Handler) http.Handler
func ClientIPFromXFFTrustedProxies(numTrustedProxies int) func(http.Handler) http.Handler
func ClientIPFromRemoteAddr(h http.Handler) http.Handler

// Read the result.
func GetClientIP(ctx context.Context) string         // for logs, rate-limit keys
func GetClientIPAddr(ctx context.Context) netip.Addr // for typed work

Example usage:

// Pick a single ClientIP middleware based on your deployment
  
// Cloudflare.
r.Use(middleware.ClientIPFromHeader("CF-Connecting-IP"))

// Nginx with ngx_http_realip_module.
r.Use(middleware.ClientIPFromHeader("X-Real-IP"))

// Apache with mod_remoteip.
r.Use(middleware.ClientIPFromHeader("X-Client-IP"))

// AWS CloudFront, or any proxy fleet with known CIDRs.
r.Use(middleware.ClientIPFromXFF(
    "13.32.0.0/15",   // CloudFront IPv4
    "52.46.0.0/18",   // CloudFront IPv4
    "2600:9000::/28", // CloudFront IPv6
))

// Behind exactly 2 trusted proxies with dynamic IPs (autoscaling pools,
// ephemeral containers, dynamic CDN edges).
r.Use(middleware.ClientIPFromXFFTrustedProxies(2))

// Server directly on the public internet, no proxy in front.
r.Use(middleware.ClientIPFromRemoteAddr)

And in your handler or downstream middleware:

clientIP := middleware.GetClientIP(r.Context())
// log it, use it as a rate-limit key, etc.

Thanks to @​adam-p, @​c2h5oh, @​rezmoss, @​Saku0512, @​convto, @​Dirbaio, @​jawnsy, @​lrstanley, @​mfridman, @​n33pm, @​pkieltyka for the prior discussions, detailed reviews, advisory reports, and test contributions that shaped this PR.

Full Changelog: go-chi/chi@v5.2.5...v5.3.0

v5.2.5

Compare Source

What's Changed

New Contributors

Full Changelog: go-chi/chi@v5.2.3...v5.2.5

v5.2.4

Compare Source

v5.2.3

Compare Source

What's Changed

New Contributors

Full Changelog: go-chi/chi@v5.2.2...v5.2.3

v5.2.2

Compare Source

What's Changed

Security fix

  • Fixes GHSA-vrw8-fxc6-2r93 - "Host Header Injection Leads to Open Redirect in RedirectSlashes" commit
    • a lower-severity Open Redirect that can't be exploited in browser or email client, as it requires manipulation of a Host header
    • reported by Anuraag Baishya, @​anuraagbaishya. Thank you!

New Contributors

Full Changelog: go-chi/chi@v5.2.1...v5.2.2

v5.2.1

Compare Source

⚠️ Chi supports Go 1.20+

Starting this release, we will now support the four most recent major versions of Go. See #​963 for related discussion.

What's Changed

Full Changelog: go-chi/chi@v5.2.0...v5.2.1

v5.2.0

Compare Source

What's Changed

New Contributors

Full Changelog: go-chi/chi@v5.1.0...v5.2.0

v5.1.0

Compare Source

What's Changed

  • middleware: add Discard method to WrapResponseWriter by @​patrislav in #​926
    • Adds Discard() method to the middleware.WrapResponseWriter interface. This is technically an API breaking change. However after some discussion at #​926 (comment), we decided to move forward, and release as minor version, as we don't expect anyone to rely on this interface / implement it externally.

New Contributors

Full Changelog: go-chi/chi@v5.0.14...v5.1.0

v5.0.14

Compare Source

What's Changed

New Contributors

Full Changelog: go-chi/chi@v5.0.12...v5.0.14

v5.0.13

Compare Source

What's Changed

New Contributors

Full Changelog: go-chi/chi@v5.0.12...v5.0.13

v5.0.12

Compare Source

v5.0.11

Compare Source

v5.0.10

Compare Source

v5.0.9

Compare Source


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate
Copy link
Copy Markdown
Contributor Author

renovate Bot commented Jul 13, 2023

⚠ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: go.sum
Command failed: go get -d -t ./...
go: downloading github.com/spf13/viper v1.15.0
go: downloading github.com/lib/pq v1.10.8
go: downloading github.com/go-chi/chi/v5 v5.0.12
go: downloading github.com/fsnotify/fsnotify v1.6.0
go: downloading github.com/mitchellh/mapstructure v1.5.0
go: downloading github.com/spf13/afero v1.9.3
go: downloading github.com/spf13/cast v1.5.0
go: downloading github.com/spf13/jwalterweatherman v1.1.0
go: downloading github.com/spf13/pflag v1.0.5
go: downloading golang.org/x/sys v0.3.0
go: downloading golang.org/x/text v0.5.0
go: downloading github.com/subosito/gotenv v1.4.2
go: downloading github.com/hashicorp/hcl v1.0.0
go: downloading gopkg.in/ini.v1 v1.67.0
go: downloading github.com/magiconair/properties v1.8.7
go: downloading github.com/pelletier/go-toml/v2 v2.0.6
go: downloading gopkg.in/yaml.v3 v3.0.1
go: downloading github.com/pelletier/go-toml v1.9.5
go: github.com/Amad3eu/api-pstg-go/handlers imports
	http: package http is not in std (/opt/containerbase/tools/golang/1.22.0/src/http)
go: github.com/Amad3eu/api-pstg-go/handlers imports
	json: package json is not in std (/opt/containerbase/tools/golang/1.22.0/src/json)
go: github.com/Amad3eu/api-pstg-go/handlers imports
	models: package models is not in std (/opt/containerbase/tools/golang/1.22.0/src/models)
go: github.com/Amad3eu/api-pstg-go/handlers imports
	srtconv: package srtconv is not in std (/opt/containerbase/tools/golang/1.22.0/src/srtconv)

@renovate renovate Bot changed the title Update module github.com/go-chi/chi/v5 to v5.0.10 Update module github.com/go-chi/chi/v5 to v5.0.10 - autoclosed Oct 23, 2023
@renovate renovate Bot closed this Oct 23, 2023
@renovate renovate Bot deleted the renovate/github.com-go-chi-chi-v5-5.x branch October 23, 2023 11:33
@renovate renovate Bot changed the title Update module github.com/go-chi/chi/v5 to v5.0.10 - autoclosed Update module github.com/go-chi/chi/v5 to v5.0.10 Oct 23, 2023
@renovate renovate Bot reopened this Oct 23, 2023
@renovate renovate Bot restored the renovate/github.com-go-chi-chi-v5-5.x branch October 23, 2023 12:16
@renovate renovate Bot force-pushed the renovate/github.com-go-chi-chi-v5-5.x branch from fd7ba25 to 2657e12 Compare October 23, 2023 12:17
@renovate renovate Bot force-pushed the renovate/github.com-go-chi-chi-v5-5.x branch from 2657e12 to 783ab02 Compare December 20, 2023 04:16
@renovate renovate Bot changed the title Update module github.com/go-chi/chi/v5 to v5.0.10 Update module github.com/go-chi/chi/v5 to v5.0.11 Dec 20, 2023
@renovate renovate Bot force-pushed the renovate/github.com-go-chi-chi-v5-5.x branch from 783ab02 to 6e955ee Compare February 17, 2024 05:04
@renovate renovate Bot changed the title Update module github.com/go-chi/chi/v5 to v5.0.11 Update module github.com/go-chi/chi/v5 to v5.0.12 Feb 17, 2024
@renovate renovate Bot force-pushed the renovate/github.com-go-chi-chi-v5-5.x branch from 6e955ee to db541ff Compare June 18, 2024 16:19
@renovate renovate Bot changed the title Update module github.com/go-chi/chi/v5 to v5.0.12 Update module github.com/go-chi/chi/v5 to v5.0.13 Jun 18, 2024
@renovate
Copy link
Copy Markdown
Contributor Author

renovate Bot commented Jun 18, 2024

⚠️ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: go.sum
Command failed: go get -t ./...
go: downloading github.com/go-chi/chi/v5 v5.3.0
go: downloading github.com/spf13/viper v1.21.0
go: downloading github.com/lib/pq v1.10.8
go: downloading github.com/fsnotify/fsnotify v1.9.0
go: downloading github.com/go-viper/mapstructure/v2 v2.4.0
go: downloading github.com/sagikazarmark/locafero v0.11.0
go: downloading github.com/spf13/afero v1.15.0
go: downloading github.com/spf13/cast v1.10.0
go: downloading github.com/spf13/pflag v1.0.10
go: downloading golang.org/x/sys v0.29.0
go: downloading github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8
go: downloading golang.org/x/text v0.28.0
go: downloading github.com/subosito/gotenv v1.6.0
go: downloading github.com/pelletier/go-toml/v2 v2.2.4
go: downloading github.com/pelletier/go-toml v1.9.5
go: downloading go.yaml.in/yaml/v3 v3.0.4
go: github.com/Amad3eu/api-pstg-go/handlers imports
	http: package http is not in std (/opt/containerbase/tools/golang/1.26.3/src/http)
go: github.com/Amad3eu/api-pstg-go/handlers imports
	json: package json is not in std (/opt/containerbase/tools/golang/1.26.3/src/json)
go: github.com/Amad3eu/api-pstg-go/handlers imports
	models: package models is not in std (/opt/containerbase/tools/golang/1.26.3/src/models)
go: github.com/Amad3eu/api-pstg-go/handlers imports
	srtconv: package srtconv is not in std (/opt/containerbase/tools/golang/1.26.3/src/srtconv)

@renovate renovate Bot force-pushed the renovate/github.com-go-chi-chi-v5-5.x branch from db541ff to 199a991 Compare June 21, 2024 15:14
@renovate renovate Bot changed the title Update module github.com/go-chi/chi/v5 to v5.0.13 Update module github.com/go-chi/chi/v5 to v5.0.14 Jun 21, 2024
@renovate renovate Bot force-pushed the renovate/github.com-go-chi-chi-v5-5.x branch from 199a991 to e162578 Compare June 28, 2024 16:17
@renovate renovate Bot changed the title Update module github.com/go-chi/chi/v5 to v5.0.14 Update module github.com/go-chi/chi/v5 to v5.1.0 Jun 28, 2024
@renovate renovate Bot force-pushed the renovate/github.com-go-chi-chi-v5-5.x branch from e162578 to b6154d8 Compare December 16, 2024 01:12
@renovate renovate Bot changed the title Update module github.com/go-chi/chi/v5 to v5.1.0 Update module github.com/go-chi/chi/v5 to v5.2.0 Dec 16, 2024
@renovate renovate Bot changed the title Update module github.com/go-chi/chi/v5 to v5.2.0 Update module github.com/go-chi/chi/v5 to v5.2.0 - autoclosed Dec 30, 2024
@renovate renovate Bot closed this Dec 30, 2024
@renovate renovate Bot deleted the renovate/github.com-go-chi-chi-v5-5.x branch December 30, 2024 07:41
@renovate renovate Bot changed the title Update module github.com/go-chi/chi/v5 to v5.2.0 - autoclosed Update module github.com/go-chi/chi/v5 to v5.2.0 Dec 30, 2024
@renovate renovate Bot reopened this Dec 30, 2024
@renovate renovate Bot force-pushed the renovate/github.com-go-chi-chi-v5-5.x branch from e613ae0 to b6154d8 Compare December 30, 2024 12:20
@renovate renovate Bot changed the title Update module github.com/go-chi/chi/v5 to v5.2.0 Update module github.com/go-chi/chi/v5 to v5.2.0 - autoclosed Jan 24, 2025
@renovate renovate Bot closed this Jan 24, 2025
@renovate renovate Bot changed the title Update module github.com/go-chi/chi/v5 to v5.2.0 - autoclosed Update module github.com/go-chi/chi/v5 to v5.2.0 Jan 24, 2025
@renovate renovate Bot force-pushed the renovate/github.com-go-chi-chi-v5-5.x branch from b6154d8 to a620b15 Compare February 4, 2025 14:26
@renovate renovate Bot changed the title Update module github.com/go-chi/chi/v5 to v5.2.0 Update module github.com/go-chi/chi/v5 to v5.2.1 Feb 4, 2025
@renovate renovate Bot changed the title Update module github.com/go-chi/chi/v5 to v5.2.1 Update module github.com/go-chi/chi/v5 to v5.2.1 - autoclosed Apr 4, 2025
@renovate renovate Bot closed this Apr 4, 2025
@renovate renovate Bot changed the title Update module github.com/go-chi/chi/v5 to v5.2.1 - autoclosed Update module github.com/go-chi/chi/v5 to v5.2.1 Apr 4, 2025
@renovate renovate Bot reopened this Apr 4, 2025
@renovate renovate Bot force-pushed the renovate/github.com-go-chi-chi-v5-5.x branch from 1de0dd4 to a620b15 Compare April 4, 2025 05:45
@renovate renovate Bot force-pushed the renovate/github.com-go-chi-chi-v5-5.x branch from a620b15 to ee69f58 Compare June 20, 2025 16:47
@renovate renovate Bot changed the title Update module github.com/go-chi/chi/v5 to v5.2.1 Update module github.com/go-chi/chi/v5 to v5.2.2 Jun 20, 2025
@renovate renovate Bot changed the title Update module github.com/go-chi/chi/v5 to v5.2.2 Update module github.com/go-chi/chi/v5 to v5.2.2 - autoclosed Aug 13, 2025
@renovate renovate Bot closed this Aug 13, 2025
@renovate renovate Bot changed the title Update module github.com/go-chi/chi/v5 to v5.2.2 - autoclosed Update module github.com/go-chi/chi/v5 to v5.2.2 Aug 13, 2025
@renovate renovate Bot reopened this Aug 13, 2025
@renovate renovate Bot force-pushed the renovate/github.com-go-chi-chi-v5-5.x branch from 3b24144 to ee69f58 Compare August 13, 2025 14:02
@renovate renovate Bot force-pushed the renovate/github.com-go-chi-chi-v5-5.x branch from ee69f58 to 9594832 Compare August 27, 2025 12:35
@renovate renovate Bot changed the title Update module github.com/go-chi/chi/v5 to v5.2.2 Update module github.com/go-chi/chi/v5 to v5.2.3 Aug 27, 2025
@renovate renovate Bot force-pushed the renovate/github.com-go-chi-chi-v5-5.x branch from 9594832 to e0dfa09 Compare October 9, 2025 14:32
@renovate renovate Bot force-pushed the renovate/github.com-go-chi-chi-v5-5.x branch from e0dfa09 to f27d7c0 Compare January 14, 2026 18:54
@renovate renovate Bot changed the title Update module github.com/go-chi/chi/v5 to v5.2.3 Update module github.com/go-chi/chi/v5 to v5.2.4 Jan 14, 2026
@renovate renovate Bot force-pushed the renovate/github.com-go-chi-chi-v5-5.x branch from f27d7c0 to d6836ba Compare February 5, 2026 14:27
@renovate renovate Bot changed the title Update module github.com/go-chi/chi/v5 to v5.2.4 Update module github.com/go-chi/chi/v5 to v5.2.5 Feb 5, 2026
@renovate renovate Bot force-pushed the renovate/github.com-go-chi-chi-v5-5.x branch from d6836ba to 0324a51 Compare May 22, 2026 15:59
@renovate renovate Bot changed the title Update module github.com/go-chi/chi/v5 to v5.2.5 Update module github.com/go-chi/chi/v5 to v5.3.0 May 22, 2026
@renovate renovate Bot changed the title Update module github.com/go-chi/chi/v5 to v5.3.0 Update module github.com/go-chi/chi/v5 to v5.3.0 - autoclosed Jun 1, 2026
@renovate renovate Bot closed this Jun 1, 2026
@renovate renovate Bot changed the title Update module github.com/go-chi/chi/v5 to v5.3.0 - autoclosed Update module github.com/go-chi/chi/v5 to v5.3.0 Jun 1, 2026
@renovate renovate Bot reopened this Jun 1, 2026
@renovate renovate Bot force-pushed the renovate/github.com-go-chi-chi-v5-5.x branch 2 times, most recently from 0324a51 to 0b431cc Compare June 1, 2026 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants