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,12 @@
|
||||
package infra
|
||||
|
||||
// Session representa una sesion de usuario almacenada en SQLite.
|
||||
// Token es un valor aleatorio opaco (32 bytes hex = 64 chars).
|
||||
// ExpiresAt y CreatedAt son Unix epoch seconds.
|
||||
type Session struct {
|
||||
Token string `json:"token"`
|
||||
UserID string `json:"user_id"`
|
||||
ExpiresAt int64 `json:"expires_at"`
|
||||
CreatedAt int64 `json:"created_at"`
|
||||
Metadata map[string]any `json:"metadata,omitempty"`
|
||||
}
|
||||
Reference in New Issue
Block a user