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:
2026-04-18 17:37:19 +02:00
parent 5f282bedc5
commit 4bc6d1bced
14 changed files with 295 additions and 16 deletions
+12
View File
@@ -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"`
}