feat(07-01): add JWT mint, refresh, and blacklist primitives

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Jakub Zych
2026-09-22 13:34:58 +02:00
parent 251f3cc4a0
commit cad445a235
6 changed files with 348 additions and 11 deletions

View File

@@ -1,13 +1,19 @@
package bouncer
import "context"
import (
"context"
"time"
)
type userKey struct{}
// Principal is the authenticated identity stored on the request context.
// PreferredLocale empty means no override. TokensValidAfter zero means no cutoff.
type Principal struct {
ID uint
MustChangePassword bool
PreferredLocale string
TokensValidAfter time.Time
}
// WithUser stores the verified principal on ctx.