Registry / auth / go-chi-jwtauth

go-chi-jwtauth

JSON →
library4.0.4+incompatiblegogounverified

JWT authentication middleware for the Chi router.

go get github.com/go-chi/jwtauth
INSTALL
IMPORT
SIG · GO-CHI-JWTAUTH
G
go-chi-jwtauth
authgov4.0.4+incompatible
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

jwtauth
github.com/go-chi/jwtauth

Minimal Chi router with JWT authentication middleware.

package main import ( "net/http" "github.com/go-chi/chi/v5" "github.com/go-chi/jwtauth" ) func main() { r := chi.NewRouter() tokenAuth := jwtauth.New("HS256", []byte("secret"), nil) r.Use(jwtauth.Verifier(tokenAuth)) r.Get("/protected", func(w http.ResponseWriter, r *http.Request) { _, claims, _ := jwtauth.FromContext(r.Context()) w.Write([]byte("Protected area. claims: %v", claims)) }) http.ListenAndServe(":3000", r) }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
4.0.4+incompatiblelatest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
24 hits · last 30 days
node
22
OpenAI (training)
1
Resources
go-chi-jwtauth — go get go-chi-jwtauth · libregistry