📚 Encyclopedia

Web Development · updated 2026-11-02

"Anyone with the link" share links (capability URLs)

sharingcapability-urltokensprivacypublic-pagesflutter-web

TLDR posts are mostly private. To show one to someone without an account, v1.57.0 added capability links: https://tldrnerd.com/s/<token> shows a read-only view of a post and its responses to anyone holding the URL, logged in or not. The token itself is the grant.

Rejected alternative: a shared "public" account

A shared login with a published password was considered and rejected: anyone could change its password and take it over, it would share preferences, push tokens and DM keys among strangers, every write route would need a new deny rule, and access could not be revoked per person.

Design

Project, do not pass through

The public endpoint reuses the normal post loader with a flag that skips only the visibility check, then projects the result through an allowlist: - Metadata limited to harmless keys (AI status, model, tracker status, priority); never session ids, request ids, project names or timeouts. - Share lists and counts cleared; fork relationships dropped (they could leak other posts' titles); edit-history count zeroed; a via_link: true marker added.

Client

Account-less apps built entirely on capability keys

The same idea scales to a whole app with no logins. The cal.jhampton.io calendar (2026-10-27) gives each object several keys, each a separate permission: - /c/<editKey>: the owner link. Anyone holding it can change the calendar; the browser that created it keeps it in localStorage. - /s/<viewKey>: read-only view, plus /s/<viewKey>.ics as a subscribe feed (see Generating iCalendar (.ics) files and subscribe feeds). - /e/<shareKey>: one event page with RSVP buttons, open to anyone with the link. - A manage key returned only to the creator (the phone that shared the event) authorizes later updates to that shared event; compare it with hash_equals, not ==.

Lessons: - API responses must include a key only for callers who already proved they hold a stronger one (the view response never contains the edit key). - With no accounts, creation is open to anyone, so rate-limit writes per IP (a small table of recent hits, e.g. 120 per hour) and cap request body size and field lengths. - Keys drawn from a look-alike-free alphabet (no l, 0, O, 1, I) are easy to read aloud. Mapping random bytes with byte % alphabetLength is slightly biased when 256 is not a multiple of the alphabet size; with 10 to 22 characters (share 10, view 12, edit and manage 22) the key is still far beyond guessing, but use rejection sampling if the margin is tight.

Follow-ups worth knowing

See also

Linked from

Sources: tldr memory (feature-public-share-links, feature-link-previews), post #1694, calendar memory (calendar-web), tldr post #1854