feat: jwt_generate, jwt_validate, password_hash, password_verify

Fase 2 del issue 0010 — auth core:
- jwt_generate/validate: HS256 manual con crypto/hmac + crypto/sha256
- password_hash/verify: wrappers de golang.org/x/crypto/bcrypt (cost 12 default)
- JWT rechaza alg != HS256 para mitigar ataque 'alg=none'
- hmac.Equal para comparacion constant-time de firmas
This commit is contained in:
2026-04-18 17:39:00 +02:00
parent 1aab74467b
commit eff5771b03
14 changed files with 517 additions and 0 deletions
+1
View File
@@ -11,6 +11,7 @@ require (
github.com/jackc/pgx/v5 v5.9.1
github.com/marcboeker/go-duckdb v1.8.5
github.com/mattn/go-sqlite3 v1.14.37
golang.org/x/crypto v0.48.0
golang.org/x/sync v0.20.0
gopkg.in/yaml.v3 v3.0.1
nhooyr.io/websocket v1.8.17