This commit is contained in:
2025-12-04 10:56:54 +08:00
parent 60992c1e44
commit e4946b7ad7
2 changed files with 25 additions and 21 deletions
+14 -1
View File
@@ -1,6 +1,10 @@
package models
import "github.com/golang-jwt/jwt/v5"
import (
"time"
"github.com/golang-jwt/jwt/v5"
)
type AuthorizationRequest struct {
UserID string `json:"user_id"`
@@ -19,3 +23,12 @@ type Claims struct {
Role string `json:"role"`
jwt.RegisteredClaims
}
// ContextKey is a custom type for context keys to avoid collisions
type ContextKey string
// CacheEntry represents a token cache entry
type CacheEntry struct {
Claims *Claims
ExpiresAt time.Time
}