feat: tipos auth (JWTClaims, Session, OAuthConfig, OAuthTokens, Permission, Role)
Fase 1 del issue 0010 — tipos base del sistema de auth en dominio infra. Define las estructuras que usaran jwt_*, session_*, oauth2_* y rbac_*. Añade dep golang.org/x/crypto/bcrypt para el hashing de passwords.
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
package infra
|
||||
|
||||
// JWTClaims contiene claims estandar y custom para un JWT.
|
||||
// Incluye los campos registrados mas comunes (sub, iss, aud, exp, iat)
|
||||
// y un mapa libre `Custom` para claims de aplicacion (ej: role, email).
|
||||
type JWTClaims struct {
|
||||
Subject string `json:"sub"`
|
||||
Issuer string `json:"iss,omitempty"`
|
||||
Audience string `json:"aud,omitempty"`
|
||||
ExpiresAt int64 `json:"exp"`
|
||||
IssuedAt int64 `json:"iat"`
|
||||
Custom map[string]any `json:"custom,omitempty"`
|
||||
}
|
||||
Reference in New Issue
Block a user