Public read-only share link (no login / no OIDC) #41

Closed
opened 2026-07-19 05:47:04 +00:00 by steve · 0 comments
Owner

A per-garden public link that anyone can open read-only, without logging in and without tripping OIDC.

  • Toggle on/off, and regenerate (new nonce invalidates the old URL).
  • Non-authenticated users can view; must NOT redirect to login/OIDC.

Backend

  • Migration 0004: gardens.public_token TEXT nullable + unique index (where not null).
  • Owner-only management: GET /gardens/:id/share-link (state), POST (enable / rotate), DELETE (disable).
  • Unauthenticated GET /api/v1/public/gardens/:token → read-only full garden (garden + objects + plantings + plants). No requireAuth; the token is the capability. Never leak the token to non-owners in the normal garden payload.

Frontend

  • /g/$token route with no auth guard (SPA fallback already serves any non-API GET); renders GardenCanvas read-only with minimal chrome; no login redirect.
  • "Public link" section in the share modal: toggle, copy URL, regenerate.

From a direct request during a working session.

A per-garden public link that anyone can open read-only, without logging in and without tripping OIDC. - Toggle on/off, and regenerate (new nonce invalidates the old URL). - Non-authenticated users can view; must NOT redirect to login/OIDC. ## Backend - Migration `0004`: `gardens.public_token TEXT` nullable + unique index (where not null). - Owner-only management: `GET /gardens/:id/share-link` (state), `POST` (enable / rotate), `DELETE` (disable). - **Unauthenticated** `GET /api/v1/public/gardens/:token` → read-only full garden (garden + objects + plantings + plants). No `requireAuth`; the token is the capability. Never leak the token to non-owners in the normal garden payload. ## Frontend - `/g/$token` route with **no** auth guard (SPA fallback already serves any non-API GET); renders `GardenCanvas` read-only with minimal chrome; no login redirect. - "Public link" section in the share modal: toggle, copy URL, regenerate. From a direct request during a working session.
steve closed this issue 2026-07-19 06:18:31 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: steve/pansy#41