Commit Graph
20 Commits
Author SHA1 Message Date
bchanot da8a0370cb fix(app): set lone-surrogate texts aside or refuse them with a message (L1)
A draft the core refuses as lone_surrogate is unreadable content: it
goes to osteo:quarantine:draft verbatim with the existing notice. An
import is refused as ImportError('lone_surrogate') with the owner's
wording (home.import.error_lone_surrogate, FR/EN), the file untouched.
The publish gate reads the kind as invalid_shape. Tests on the real
core: quarantine keeps the exact text, an editor action leaves the
report as it was, normal text with pairs and literal backslashes reads
unchanged.
2026-10-14 21:49:39 +02:00
bchanot 6891f9ea25 feat(supabase): publish gate on the Rust core's sheet.check, fail closed
publishSheetVersion(client, versionId, validate) takes the core's
sheet.check (the package never loads the module itself); anything but a
publishable verdict refuses publication before the RPC: invalid_shape,
not_publishable (same message as before: first error code), and
validator_unavailable when the core cannot run. Tests run on the real
Node core; the shape case now asserts the closed kind instead of any
throw. The package no longer depends on @faunosteo/domain.
2026-10-14 00:29:03 +02:00
bchanot cd2dbb3b79 fix(supabase): security pass on the files foundation — ceiling counts live bytes only, confirm checks the account, null sha256 refused, browser RPCs one role; worker: cleartext only on loopback or a service name, no env proxy, key ownership cross-check, no library text in logs
Security audit (PASS, 2 MEDIUM + LOW): the global ceiling summed every
non-deleted row, so rejected uploads ratcheted it toward storage_full with no
disk used → in-flight rows by declared size, clean rows by byte_size, nothing
else (pgTAP: rejected rows do not count, in-flight rows do); confirm refuses a
deactivated account like begin; complete_avatar_job refuses a null sha256;
begin / confirm / remove granted to authenticated only. Worker: SUPABASE_URL
over http:// accepted only for loopback or a single-label Docker service
name; ureq proxy(None); the job's keys must embed its owner and asset ids;
backend_failure / claim_failed / sweep_failure lines carry the closed kind and
the HTTP status, never the library's error text. e2e: uuid shape checked
before the psql query. Contract revision 2 (oracle fixes).
2026-10-13 19:49:58 +02:00
bchanot 0c6053c174 feat(workspace): real-stack avatar e2e, compose worker service, STORAGE.md contract
packages/supabase/tests/e2e/avatar-flow.e2e.ts (pnpm e2e:avatar through
scripts/avatar-e2e.sh: worker container on the Supabase network, 5 s sweep,
no quarantine grace; a fresh account per run): clean upload and owner-only
download (Bob, anon, quarantine key, direct final-key write refused),
replacement purged after the grace (queue clock shifted through psql), late
bytes through a still-valid signed upload URL swept, hostile and corrupted
uploads rejected with closed codes, removal with the purge queue drained.
Worker: the Storage API answers a missing object with HTTP 400 and
statusCode 404; normalised to 404 so a purge of a never-written key is acked.
docker-compose.yml: service worker under the worker profile (read-only,
cap_drop ALL, no-new-privileges, 512m, 1 cpu, 64 pids, .env.worker, external
Supabase network). docs/development/STORAGE.md: the implementation contract.
2026-10-13 19:39:51 +02:00
bchanot 926dd7df8c feat(app): profile photo — avatar upload in Mon compte, photo in the sidebar, drawer and top bar
packages/supabase assets module: closed AssetFailure kinds, begin / quarantine
upload (upsert off) / confirm / remove, own-row state read with an explicit
column list, download under the SELECT policy. App: client transport (magic
byte sniff, never SVG, createImageBitmap, canvas 1024 px, JPEG 0.9, 5 MiB
cap), AvatarSection (preview, save, 1 s polling up to 30 s, rejection and
failure messages per closed code, removal with confirmation, in-flight row
resumed at mount), auth store blob URL revoked on change and sign-out,
AvatarCircle in UserBadge and the top bar link to Mon compte (D3), FR/EN
strings, fake client extended, 27 new tests (app 300).
2026-10-13 19:32:37 +02: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 9771d997f4 fix(app): failed sign-out reported (local session still cleared); reauthentication_needed phrased; docs(docs): exact production redirect allowlist 2026-10-11 23:45:14 +02:00
bchanot aa1985eead test(app): identity step — auth store, locale sync, login/signup, guards, shell, dashboard, account
- tests/helpers/fakeSupabase: in-memory auth events + profiles/profile_roles builder
- validation schemas and safeNextPath; classifyAuthError mapping (packages/supabase)
- LoginRoute (unavailable, validation, next path, phrased failure, OAuth buttons, show password)
- SignupRoute (policy, mismatch, metadata + redirect, user exists)
- RequireAuth / RedirectIfSignedIn, AppLayout (nav, active, drawer, sign out), Dashboard, Account forms
2026-10-11 23:33:25 +02:00
bchanot c517ea267b feat(app): identity screens and /app shell — auth store, login/signup/reset flows, dashboard, account
- state/authStore: session subscription (initialize + onAuthStateChange), profile + roles load, recovery flag, URL failure; services/localeSync: profiles.locale <-> localeStore
- routes: /login, /signup, /forgot-password, /reset-password, /auth/callback; guards RequireAuth (next=) and RedirectIfSignedIn; /app (dashboard), /app/account behind the guard
- shell: AppLayout (desktop sidebar, light top bar, mobile drawer), SidebarNav, UserBadge, SignOutButton
- account: personal / professional / preferences / security sections, one save each, Zod validation with i18n keys
- ui: Icon, FormField, Notice, ButtonLink (buttonClassName shared), PasswordField, OAuthButtons (config-driven)
- Home header: Mon espace / Se connecter when Supabase is configured; local tool routes untouched
- i18n: auth.*, shell.*, dashboard.*, account.*, home.space.* in fr + en
2026-10-11 23:29:13 +02:00
bchanot b10b227ee9 feat(supabase): auth, profile and roles services; professional columns on profiles; OAuth + TOTP config
- packages/supabase: signIn/signUp/OAuth/reset/updatePassword/signOut wrappers with a closed AuthFailure kind, fetch/update own profile, own platform roles
- migration 20261011100000: practice_name, professional_title, siret (format-checked, column grants); pgTAP 009; database.types regenerated
- config.toml: TOTP enroll/verify on, [auth.external.google|apple] via env(), wildcard redirect URLs
- app config: authProviders (APP_AUTH_PROVIDERS / VITE_AUTH_PROVIDERS), entrypoint env.js, DEPLOY table
- TODO: Step 7 plan
2026-10-11 23:16:13 +02:00
bchanot 6870d87910 feat(anatomy): curation pipeline — changeset schema, applier with before/after records, cleaned single asset, draft seed, changelog + review report generators; seed layout legacy-import/curation/draft 2026-10-09 16:50:08 +02:00
bchanot 3dbbfdf1df feat(domain): sheet document schema v2 — references registry, review_status, vertebral count_range; SQL gate + pgTAP 008 2026-10-09 16:30:58 +02:00
bchanot dee4ce43d9 fix(supabase): confirmed uploads gate asset reads (hash claim), seeds-listed test, Dockerfile workspace manifests; importer declares every authored label, real in=out control 2026-10-09 00:50:36 +02:00
bchanot e5a0445b19 test(supabase): equine seed + storage pgTAP on both engines; docs for Step 4b; upload script resolves from caller dir 2026-10-09 00:38:49 +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 8cac8b1a68 feat(supabase): regenerated types, row aliases, publishSheetVersion gate, schema test 2026-10-08 23:42:44 +02:00
bchanot 8b233e5cf0 chore(supabase): adopt CLI-generated database.types.ts; db:types scripts pipe through prettier 2026-10-08 23:04:21 +02:00
bchanot ab04b2e43d style(supabase): prettier pass on the new TypeScript files 2026-10-08 22:46:37 +02:00
bchanot ce76c6597a feat(supabase): @faunosteo/supabase package with PGlite harness and typed client
- tests/db: PGlite (PostgreSQL 17 WASM) applies the Supabase shim + migrations and
  runs supabase/tests/*.sql through pgTAP without Docker
- schema-types test pins tables, columns, enums, RPC args, RLS-on, no using(true)
- database.types.ts in supabase gen types format; createBrowserClient (PKCE)
- Supabase CLI pinned as root devDependency; db:* root scripts
2026-10-08 22:20:54 +02:00