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:
2026-05-07 23:51:16 -06:00
parent d8773b0f9f
commit b9a5cc2f92
11 changed files with 32 additions and 23 deletions

View File

@@ -5,6 +5,15 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [1.0.0] — 2026-05-08 ## [1.0.0] — 2026-05-08
### Changed
- Package renamed from `jwtauth` to `httpauthjwt` — follows ecosystem convention
(`repo name = package name`, hyphens removed); import path is unchanged
(`code.nochebuena.dev/go/httpauth-jwt`); update all usages from `jwtauth.X` to
`httpauthjwt.X`
- Dependency `code.nochebuena.dev/go/httpauth` bumped to v1.0.0
- Dependency `code.nochebuena.dev/go/rbac` bumped to v1.0.0 (indirect)
### Added ### Added
**`Verifier` interface** — validates JWT strings. Narrowest interface; `AuthMiddleware` **`Verifier` interface** — validates JWT strings. Narrowest interface; `AuthMiddleware`

View File

@@ -19,7 +19,7 @@ verification — all downstream middleware in `httpauth` is provider-agnostic.
**Tier:** 4 (transport auth layer; depends on Tier 3 `httpauth` and `jwt/v5`) **Tier:** 4 (transport auth layer; depends on Tier 3 `httpauth` and `jwt/v5`)
**Module:** `code.nochebuena.dev/go/httpauth-jwt` **Module:** `code.nochebuena.dev/go/httpauth-jwt`
**Package name:** `jwtauth` **Package name:** `httpauthjwt`
**Direct imports:** `code.nochebuena.dev/go/httpauth`, `github.com/golang-jwt/jwt/v5` **Direct imports:** `code.nochebuena.dev/go/httpauth`, `github.com/golang-jwt/jwt/v5`
**Transitive:** `code.nochebuena.dev/go/rbac` (indirect, via `httpauth`) **Transitive:** `code.nochebuena.dev/go/rbac` (indirect, via `httpauth`)

View File

@@ -1,4 +1,4 @@
package jwtauth package httpauthjwt
import ( import (
"net/http" "net/http"

View File

@@ -1,10 +1,10 @@
package jwtauth_test package httpauthjwt_test
import ( import (
"context" "context"
"time" "time"
jwtauth "code.nochebuena.dev/go/httpauth-jwt" httpauthjwt "code.nochebuena.dev/go/httpauth-jwt"
"github.com/golang-jwt/jwt/v5" "github.com/golang-jwt/jwt/v5"
) )
@@ -25,6 +25,6 @@ func (m *mockBlacklist) Revoke(_ context.Context, _ string, _ time.Duration) err
} }
// Compile-time interface satisfaction checks. // Compile-time interface satisfaction checks.
var _ jwtauth.Signer = (*mockSigner)(nil) var _ httpauthjwt.Signer = (*mockSigner)(nil)
var _ jwtauth.Verifier = (*mockVerifier)(nil) var _ httpauthjwt.Verifier = (*mockVerifier)(nil)
var _ jwtauth.Blacklist = (*mockBlacklist)(nil) var _ httpauthjwt.Blacklist = (*mockBlacklist)(nil)

12
doc.go
View File

@@ -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. // management for HTTP services.
// //
// It integrates with code.nochebuena.dev/go/httpauth: AuthMiddleware verifies // It integrates with code.nochebuena.dev/go/httpauth: AuthMiddleware verifies
@@ -9,18 +9,18 @@
// //
// 1. Issue a token pair on login: // 1. Issue a token pair on login:
// //
// signer := jwtauth.NewHMACSigner([]byte(os.Getenv("JWT_SECRET"))) // signer := httpauthjwt.NewHMACSigner([]byte(os.Getenv("JWT_SECRET")))
// pair, err := jwtauth.IssueTokenPair(signer, uid, customClaims, cfg) // pair, err := httpauthjwt.IssueTokenPair(signer, uid, customClaims, cfg)
// //
// 2. Protect routes: // 2. Protect routes:
// //
// r.Use(jwtauth.AuthMiddleware(signer, publicPaths)) // r.Use(httpauthjwt.AuthMiddleware(signer, publicPaths))
// r.Use(httpauth.EnrichmentMiddleware(myEnricher)) // r.Use(httpauth.EnrichmentMiddleware(myEnricher))
// //
// 3. Rotate tokens on refresh: // 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 // For microservices that only verify tokens (not issue them), use NewRSAPublicKeyVerifier
// or NewRSAPublicKeyVerifierFromPEM with the public key only. // or NewRSAPublicKeyVerifierFromPEM with the public key only.
package jwtauth package httpauthjwt

4
go.mod
View File

@@ -3,8 +3,8 @@ module code.nochebuena.dev/go/httpauth-jwt
go 1.25 go 1.25
require ( require (
code.nochebuena.dev/go/httpauth v0.1.0 code.nochebuena.dev/go/httpauth v1.0.0
github.com/golang-jwt/jwt/v5 v5.2.1 github.com/golang-jwt/jwt/v5 v5.2.1
) )
require code.nochebuena.dev/go/rbac v0.9.0 // indirect require code.nochebuena.dev/go/rbac v1.0.0 // indirect

8
go.sum
View File

@@ -1,6 +1,6 @@
code.nochebuena.dev/go/httpauth v0.1.0 h1:86xldderCDBvBIvOYgbTg54C00nl1A1OaYVrTHL3BTY= code.nochebuena.dev/go/httpauth v1.0.0 h1:B2ypnlL7yQkePHC3EKo4LPgJbd5lWZ6RuA1o6sx84so=
code.nochebuena.dev/go/httpauth v0.1.0/go.mod h1:DzvGBZVo9npBa1llB+sWL9lOcqaltRMmvh/eGXm+3jQ= code.nochebuena.dev/go/httpauth v1.0.0/go.mod h1:rGaQDInGkavpk8nbiG7azPqcyYsrwo0+E+ZNocRW2MY=
code.nochebuena.dev/go/rbac v0.9.0 h1:2fQngWIOeluIaMmo+H2ajT0NVw8GjNFJVi6pbdB3f/o= code.nochebuena.dev/go/rbac v1.0.0 h1:FnsU1HU6vvwchKuZNxDa9RPIFeNwJi0vShWvHKABMws=
code.nochebuena.dev/go/rbac v0.9.0/go.mod h1:LzW8tTJmdbu6HHN26NZZ3HzzdlZAd1sp6aml25Cfz5c= code.nochebuena.dev/go/rbac v1.0.0/go.mod h1:LzW8tTJmdbu6HHN26NZZ3HzzdlZAd1sp6aml25Cfz5c=
github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk=
github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=

View File

@@ -1,4 +1,4 @@
package jwtauth package httpauthjwt
import ( import (
"context" "context"

View File

@@ -1,4 +1,4 @@
package jwtauth package httpauthjwt
import ( import (
"context" "context"

View File

@@ -1,4 +1,4 @@
package jwtauth package httpauthjwt
import ( import (
"crypto/rsa" "crypto/rsa"

View File

@@ -1,4 +1,4 @@
package jwtauth package httpauthjwt
import ( import (
"crypto/rand" "crypto/rand"