test(supabase): concurrency seeding accepts Storage's duplicate answer

After e2e:shell seeds the same content-addressed drawing, Storage answers HTTP 400 with statusCode 409 (KeyAlreadyExists); any other 400 still fails. Docs: M7 adds no new write path; a TOTP code replays more than once within its span.
This commit is contained in:
bchanot committed 2026-11-02 23:31:49 +01:00
1 parent dcb1a94ee4
commit f5456f330d
4 files changed
+17 -6

No files matched your search

+2 -2
View File
@@ -163,8 +163,8 @@ rehearsed at V1-2.9; the paths and gaps are reviewed in §4.2.
N+1 is accepted too (one step of skew); a session E verifying C in step N+2
is refused (422 `mfa_verification_failed`). Measured span of one code: its
own step and the next, 30 to 60 s. Consequence: a code seen over a shoulder
or relayed by a phishing page can be replayed once by another password-holding
session within that span; it does not outlive it. Configuration that ran
or relayed by a phishing page can be replayed by any session holding the
password, more than once, within that span; it does not outlive it. Configuration that ran
the measurement: the sandbox GoTrue (`scripts/db-sandbox.sh`, image
`gotrue:v2.197.0`), which sets no MFA variable, so the image defaults apply.
The CLI and DEV stacks are configured by `supabase/config.toml` `[auth.mfa]`
+2 -2
View File
@@ -1756,7 +1756,7 @@ of the document's JSON text in one form, the same for every layer:
| M4 `sheet_access_hardening` | V1-2.1 | `anatomical_catalog_grants` and its RPCs; `has_mfa`, `grant_active`, `caller_has`; `can_read_official_catalog` and the reader row predicate; `can_edit_sheet` redefined (F14); AR-1 B on the platform role RPCs and the private write functions (F19, §5.7), F17, F18; F1, F2, F3 (fork closed), F5, F6, F8, F9, F12 (every catalogue table), F13, F15; asset-row immutability trigger (F16); historical-sheet protection trigger (§14.2); reader column grants narrowed; personal creation and visibility changes refused | no row changes |
| M5 `sheet_review_workflow` | V1-2.1 | version columns `revision`, `authors`, `source_version_id`, `published_review_id`, `document_fingerprint`; sheet column `working_copy_source_version_id`; revision, author and freeze triggers, the historical-sheet write rule; extended immutability guard (§6.8); rounds, comments, acknowledgments; `create_official_sheet`, `create_sheet_draft` adapted, `save_sheet_draft`, submit, withdraw, comment, acknowledge, decide, publish; `create_sheet_working_copy`; species RPCs; catalogue and version read RPCs; upload: `register_sheet_asset` extended, `confirm_sheet_asset_upload` with the storage check (F7), INSERT policy, bucket limit 2 MiB; mirror removal and status check (§12.2); superseded signatures dropped; the content-size CHECK replaced by the text measure (`octet_length(content::text)`, §12.2) | new columns take their defaults on the equine v1 row (`revision` 0, empty author set); its document, status, number and assets unchanged; the new size CHECK is validated against the existing rows when M5 is applied (the equine document measures 184 105 bytes as `content::text`, measured on the sandbox); bucket limit lowered; no round, no grant |
| M6 `sheet_verification_jobs` | V1-2.3 | worker RPCs (claim, input, complete with the verdict structure check, fail), service role only, with the retry delay (hidden `not_before` column on the round, `private.sheet_verification_retry_delay`: owner decision 2026-11-01, replaces « without backoff ») and the retry by cause (definitive codes close at the first occurrence, `private.sheet_worker_final_codes`); written as `20261101100000_sheet_verification_jobs.sql`, pgTAP `021`, rehearsed on the sandbox from the state before M4 (M4 to M6 in one `migration up`) and from the state before M6 | none |
| M7 `sheet_admin_reads` | V1-2.5 | read RPCs of the admin space (owner decision 2026-11-02, BDR-097): the official sheet list with its badges (historical, working copy), statuses and round counts, and one sheet's overview (versions, rounds); `get_sheet_version` redefined to return the fingerprint of deprecated versions too (BDR-098); the admin reads for capability holders at `aal2` only (`caller_can_see_official_sheet`); no write path, no new grant, no policy change; the one rule change is the species sort order: `create_species` and `update_inactive_species` are redefined to refuse an order outside 0..9 999 with `invalid_input` (null keeps today's meaning, owner 2026-11-02), `security definer`, `search_path = ''` and their privileges restated; pgTAP allowed and denied cases | none |
| M7 `sheet_admin_reads` | V1-2.5 | read RPCs of the admin space (owner decision 2026-11-02, BDR-097): the official sheet list with its badges (historical, working copy), statuses and round counts, and one sheet's overview (versions, rounds); `get_sheet_version` redefined to return the fingerprint of deprecated versions too (BDR-098); the admin reads for capability holders at `aal2` only (`caller_can_see_official_sheet`); no new write path (it redefines two existing write RPCs), no new grant, no policy change; the one rule change is the species sort order: `create_species` and `update_inactive_species` are redefined to refuse an order outside 0..9 999 with `invalid_input` (null keeps today's meaning, owner 2026-11-02), `security definer`, `search_path = ''` and their privileges restated; pgTAP allowed and denied cases | none |
Each migration ships its pgTAP file (allowed and denied cases), regenerated
`database.types.ts`, a `db:sandbox up upgrade` run from the DEV state (with a
@@ -2594,7 +2594,7 @@ VERIFIED (BDR-092), V1-2.4 approved (§17.9); V1-2.3 VERIFIED as well (BDR-093).
| Item | Decision | Where |
|---|---|---|
| Admin reads | the admin list needs the working-copy badge and round counts, which no table grant gives (§5.3) and no RPC returned: one read migration M7, capability holders at `aal2`, no write path | §12.3, §16.6 |
| Admin reads | the admin list needs the working-copy badge and round counts, which no table grant gives (§5.3) and no RPC returned: one read migration M7, capability holders at `aal2`, no new write path | §12.3, §16.6 |
| Working copy action | « Créer une copie de travail » built in V1-2.5 (board 10), landing on the copy's overview; the editor link arrives with V1-2.6 | §11.1, §16.6 |
| EN term | « Habilitation » reads « Permission » in the English interface; `capability` stays the technical term | §3 |
| Deprecated fingerprint | found while building the catalogue: `PreviewSheet` checks the fingerprint of published and deprecated versions, `get_sheet_version` returned it for published only, so no withdrawn version could open; `get_sheet_version` now returns it for both (redefined in M7, BDR-098) | §10, §12.3 |