From 8d46c0f98b2dec147f4453b131a56b662befb40d Mon Sep 17 00:00:00 2001 From: Julien Calixte Date: Fri, 26 Jun 2026 14:39:41 +0100 Subject: [PATCH] docs: add ADR-0001 for self-contained share links --- docs/adr/0001-self-contained-share-links.md | 25 +++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 docs/adr/0001-self-contained-share-links.md diff --git a/docs/adr/0001-self-contained-share-links.md b/docs/adr/0001-self-contained-share-links.md new file mode 100644 index 0000000..ce77bc5 --- /dev/null +++ b/docs/adr/0001-self-contained-share-links.md @@ -0,0 +1,25 @@ +# Self-contained share links + +Status: Accepted + +Sharing a Radar must work with **no backend** — the app is a static SPA deployed to +nginx (Coolify) and GitHub Pages. We encode the entire Radar as `base64url(JSON(payload))` +in a `/share?d=…` query parameter rather than storing it server-side behind a short id; +the importing client validates and clamps the untrusted payload (`useRadars.importRadar`) +before it ever touches the store. + +## Considered options + +- **Self-contained link (chosen)** — full Radar in the URL. +- **Server-stored short link** — POST the Radar, share a short id. Rejected: requires a + backend + datastore, which the zero-infra constraint forbids. +- **Compressed payload (LZ-string)** — shorter URLs, same self-contained property. + Deferred, not rejected: the §7 fallback if link length becomes a problem. + +## Consequences + +- **Got:** zero infrastructure; links never expire; works on any static host; offline-capable. +- **Paid:** long URLs (no compression today); the full Radar is exposed in the URL (no + privacy boundary); no revoke and no edit-after-share — a shared link is a frozen copy. +- Mitigated by the cardinality caps (≤7 Criteria, ≤5 Profiles) which bound payload size, + keeping URLs within browser limits at current scale.