auth0 / go-jwt-middleware

A Middleware for Go Programming Language to check for JWTs on HTTP requests
MIT License
1.07k stars 205 forks source link

Examples do not work. jwtmiddleware missing in v2.2.0 #241

Closed bt-nia closed 7 months ago

bt-nia commented 8 months ago

Checklist

Description

The example in the README as well as (at least) the https://github.com/auth0/go-jwt-middleware/blob/master/examples/http-jwks-example/main.go do not work in the current state of the library.

Reproduction

copy code from readme into main.go go get github.com/auth0/go-jwt-middleware/v2@latest go run main.go

results in: ➜ golang-jwks-validation-test git:(main) ✗ go run main.go main.go:11:2: no required module provides package github.com/auth0/go-jwt-middleware/v2/jwtmiddleware; to add it: go get github.com/auth0/go-jwt-middleware/v2/jwtmiddleware

Go JWT Middleware version

2.2.0

Go version

1.21

bt-nia commented 8 months ago

I was able to figure out what was wrong. Since all the examples are outdated, I went ahead and updated them (untested): https://github.com/auth0/go-jwt-middleware/pull/242

The fix is to define jwtmiddleware "github.com/auth0/go-jwt-middleware/v2"

bt-nia commented 8 months ago

cc: @ewanharris