Registry / auth / hertz-contrib-jwt

hertz-contrib-jwt

JSON →
library1.0.4gogounverified

JWT authentication middleware for the Hertz HTTP framework.

go get github.com/hertz-contrib/jwt
INSTALL
IMPORT
SIG · HERTZ-CONTRIB-JWT
H
hertz-contrib-jwt
authgov1.0.4
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.

jwt
github.com/hertz-contrib/jwt

Basic setup of JWT middleware for Hertz.

package main import ( "context" "github.com/cloudwego/hertz/pkg/app" "github.com/cloudwego/hertz/pkg/app/server" "github.com/hertz-contrib/jwt" ) func main() { h := server.Default() authMiddleware, _ := jwt.New(&jwt.HertzJWTMiddleware{ Realm: "test zone", Key: []byte("secret key"), Timeout: jwt.DefaultTimeout, MaxRefresh: jwt.DefaultMaxRefresh, Authenticator: func(ctx context.Context, c *app.RequestContext) (interface{}, error) { return nil, jwt.ErrMissingLoginValues }, }) h.POST("/login", authMiddleware.LoginHandler) h.Spin() }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
1.0.4latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
17 hits · last 30 days
node
16
OpenAI (training)
1
Resources
hertz-contrib-jwt — go get hertz-contrib-jwt · libregistry