Commit Graph
7 Commits
Author SHA1 Message Date
bchanot 4adbfcb608 feat(supabase): clients M2 with RPCs, search and per-workspace budget
V1-1.2 (contract V1-1_OWNERS_ANIMALS.md §5, §9, §10). public.clients (person or organization, display name only, optional contact, folded search keys), create/update/set_archived as definer RPCs (identical not_found, idempotent create with divergent-replay refusal, revisions, archive read-only), search_clients invoker with keyset pages and phone search, write budget per workspace in UTC hour/day windows under a row lock, 20 000-client cap, ids-only audit hidden from platform staff (N9), nothing for anon or service_role. pgTAP 013 (130), field-limits parity test, sandbox suite (concurrency, budget races, 20 000-client search), types regenerated.
2026-10-25 21:09:45 +01:00
bchanot 7bf4fb6079 feat(supabase): workspaces M1, one personal workspace per account
V1-1.1 (contract V1-1_OWNERS_ANIMALS.md §4, §8, §9). Tables workspaces and workspace_members, created with the profile by trigger through one atomic, idempotent write path; deferred invariant (a personal workspace has exactly its account as holder); backfill of existing profiles; access helpers caller_workspace_ids (active profile, confirmed email) and writable_workspace_ids; RLS select for members only; no privilege for anon or service_role. log_event keeps x-correlation-id only as a short token. pgTAP 012 (85 checks), census and types updated, config test.
2026-10-25 19:53:16 +01:00
bchanot 614887470c feat(supabase): files foundation — assets table, private buckets, avatar policies through assets, purge queue, browser and worker RPCs
Migration 20261013100000: asset_status enum, public.assets (server-built keys,
lease token, closed rejection reasons), seven private buckets (avatars open with
cap and MIME list, six closed), storage.objects SELECT/INSERT policies for
avatars evaluated through assets, private.object_purge_queue fed by status and
delete triggers (48 h / 1 h grace), storage ceiling, RPCs begin_avatar_upload /
confirm_asset_upload / remove_avatar (authenticated) and claim_avatar_jobs /
complete_avatar_job / reject_avatar_job / mark_quarantine_purged / claim_purges /
ack_purge / claim_quarantine_leftovers / expire_pending_uploads (service_role),
explicit revokes and column grants. pgTAP 010 (125 checks: allowed and denied
twins, policy census, stale lease, supersede, removal, leftovers, cascade,
ceiling), 001 census extended, database.types.ts regenerated from the real
stack, schema-types test counts input arguments only.
2026-10-13 19:32:15 +02:00
bchanot f4682cdba5 feat(supabase): sheet asset Storage bucket + read policy through the sheet, shim storage tables, seeds in the PGlite harness, upload script 2026-10-09 00:28:34 +02:00
bchanot d3fa65af29 fix(supabase): revoke PUBLIC EXECUTE on private helpers, audited visibility RPC, input caps, authz-first RPCs, +32 pgTAP checks 2026-10-08 23:59:39 +02:00
bchanot 1e7d0327cc fix(supabase): no USAGE on schema private for anon; pin it and RPC EXECUTE in pgTAP 2026-10-08 22:47:20 +02:00
bchanot 2d5ff0c33e feat(supabase): foundation migrations (audit, profiles, platform roles) + pgTAP suite
- schemas private/audit, set_updated_at, append-only audit.audit_logs, private.log_event
- profiles created by auth.users trigger; own-row RLS; column-level UPDATE grant
- platform_role enum (owner/admin/moderator/support), profile_roles history table,
  is_platform_* helpers, grant/revoke RPCs audited; writes only via RPC
- config.toml (public schema only, strong passwords, no edge runtime), local seed
- 79 pgTAP checks: allowed and denied paths for every policy
2026-10-08 22:20:54 +02:00