Added TTL to tokens

This commit is contained in:
2025-02-10 17:36:13 +11:00
parent e46a55e76d
commit 04049bb73a
3 changed files with 55 additions and 44 deletions

View File

@@ -4,21 +4,20 @@ import "github.com/google/uuid"
// Access token
type AccessToken struct {
ISS string
Scope string
IAT int64
EXP int64
SUB int
Fresh int64
Roles []string
ISS string // Issuer, generally TrustedHost
IAT int64 // Time issued at
EXP int64 // Time expiring at
TTL string // Time-to-live: "session" or "exp". Used with 'remember me'
SUB int // Subject (user) ID
Fresh int64 // Time freshness expiring at
}
// Refresh token
type RefreshToken struct {
ISS string
Scope string
IAT int64
EXP int64
SUB int
JTI uuid.UUID
ISS string // Issuer, generally TrustedHost
IAT int64 // Time issued at
EXP int64 // Time expiring at
TTL string // Time-to-live: "session" or "exp". Used with 'remember me'
SUB int // Subject (user) ID
JTI uuid.UUID // UUID-4 used for identifying blacklisted refresh tokens
}