fix(httpauth-jwt)!: rename package httpauthjwt, bump httpauth and rbac to v1.0.0
Rename package from jwtauth to httpauthjwt to follow ecosystem convention (repo name = package name, hyphens removed). Bump httpauth dependency from v0.1.0 to v1.0.0 and rbac indirect dependency from v0.9.0 to v1.0.0. BREAKING CHANGE: import path unchanged (code.nochebuena.dev/go/httpauth-jwt) but package identifier changes from jwtauth to httpauthjwt — update all usages accordingly.
This commit is contained in:
12
doc.go
12
doc.go
@@ -1,4 +1,4 @@
|
||||
// Package jwtauth provides self-issued JWT authentication middleware and token
|
||||
// Package httpauthjwt provides self-issued JWT authentication middleware and token
|
||||
// management for HTTP services.
|
||||
//
|
||||
// It integrates with code.nochebuena.dev/go/httpauth: AuthMiddleware verifies
|
||||
@@ -9,18 +9,18 @@
|
||||
//
|
||||
// 1. Issue a token pair on login:
|
||||
//
|
||||
// signer := jwtauth.NewHMACSigner([]byte(os.Getenv("JWT_SECRET")))
|
||||
// pair, err := jwtauth.IssueTokenPair(signer, uid, customClaims, cfg)
|
||||
// signer := httpauthjwt.NewHMACSigner([]byte(os.Getenv("JWT_SECRET")))
|
||||
// pair, err := httpauthjwt.IssueTokenPair(signer, uid, customClaims, cfg)
|
||||
//
|
||||
// 2. Protect routes:
|
||||
//
|
||||
// r.Use(jwtauth.AuthMiddleware(signer, publicPaths))
|
||||
// r.Use(httpauthjwt.AuthMiddleware(signer, publicPaths))
|
||||
// r.Use(httpauth.EnrichmentMiddleware(myEnricher))
|
||||
//
|
||||
// 3. Rotate tokens on refresh:
|
||||
//
|
||||
// newPair, err := jwtauth.RefreshTokenPair(ctx, signer, refreshToken, blacklist, cfg, freshClaims)
|
||||
// newPair, err := httpauthjwt.RefreshTokenPair(ctx, signer, refreshToken, blacklist, cfg, freshClaims)
|
||||
//
|
||||
// For microservices that only verify tokens (not issue them), use NewRSAPublicKeyVerifier
|
||||
// or NewRSAPublicKeyVerifierFromPEM with the public key only.
|
||||
package jwtauth
|
||||
package httpauthjwt
|
||||
|
||||
Reference in New Issue
Block a user