- tc-auth: argon2id passwords, hashed opaque bearer tokens in auth_sessions
(migration 0002), anti-enumeration login errors, redacted token Debug
- tc-api: axum router with /healthz, /api/auth/login|logout, /api/user/me,
/api/team/{claws,credits,permissions}; Authed bearer extractor + RBAC
permission derivation; integration-tested over real TCP vs real Postgres
- teamclaw-server: config -> pool -> self-migrate -> serve
Co-Authored-By: Claude Fable 5 <[email protected]>
11 lines
416 B
SQL
11 lines
416 B
SQL
-- Login sessions for both auth modes. Only a SHA-256 hash of the bearer
|
|
-- token is stored; possession of the database never yields valid tokens.
|
|
|
|
CREATE TABLE auth_sessions (
|
|
token_hash TEXT PRIMARY KEY,
|
|
user_id UUID NOT NULL REFERENCES users (id),
|
|
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
|
expires_at TIMESTAMPTZ NOT NULL
|
|
);
|
|
CREATE INDEX auth_sessions_user_idx ON auth_sessions (user_id);
|