fabro/lib/foundation
Bryan Helmkamp c69a47c4e6
Add auth_sessions and refresh_tokens schema
A CLI auth session is a rotation chain, but the SlateDB records that back
it today store identity and profile per token, so a chain has no owner and
nothing stops its rows from disagreeing. These two tables give the chain a
home: `auth_sessions` holds the identity and profile once, `refresh_tokens`
holds only per-token facts.

Two invariants the current code relies on but never states become
constraints. The partial unique index on `(session_id) WHERE used_at_ms IS
NULL` enforces that rotation leaves exactly one live token per chain --
which is what makes the session listing an indexed lookup instead of a
scan-and-group. The foreign key with `ON DELETE CASCADE` makes revoking a
session remove its tokens without a second statement.

Tokens are retained after rotation until they expire so a replayed token
stays distinguishable from a forgery.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-25 15:15:58 -04:00
..
build-support refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
fabro-api Merge origin/main into feat/inference-observability 2026-07-24 22:55:15 -04:00
fabro-auth refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
fabro-client refactor(events): simplify backward pagination internals 2026-07-24 08:34:02 -04:00
fabro-config fix(glob): harden artifact traversal 2026-07-25 11:56:57 -04:00
fabro-core refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
fabro-db Add auth_sessions and refresh_tokens schema 2026-07-25 15:15:58 -04:00
fabro-dev Merge origin/main into feat/sandbox-bash-contract 2026-07-24 22:42:28 -04:00
fabro-http refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
fabro-macros refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
fabro-model fix(agent): simplify GPT-5.6 tool routing 2026-07-25 11:49:40 -04:00
fabro-oauth refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
fabro-options-metadata refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
fabro-proc refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
fabro-redact refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
fabro-static feat(llm): add Fireworks AI as an opt-in provider 2026-07-24 08:03:39 -04:00
fabro-telemetry refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
fabro-template refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
fabro-test refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
fabro-types Merge origin/main into feat/inference-observability 2026-07-24 22:55:15 -04:00
fabro-util fix(glob): harden artifact traversal 2026-07-25 11:56:57 -04:00
fabro-vault refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00