Repository navigation
Conversation
Share in the artifact viewer publishes a version, or the artifact's newest, to `/pub/<token>`, which needs no sign-in. The page is the same sandboxed one `/a/…` serves, so it still cannot reach the app or its cookies. A share stays at the version it was made from, or follows the newest, and lasts until it is ended or for a day, a week, or a month. Ending it makes the address answer nothing. Only people who see every session publish or end one, never someone invited to a single session.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Publish an artifact so that anyone with the link can open it, with no sign-in.
GET/HEAD /pub/<token>: serves the artifact's own sandboxed page (same CSP, same rendering as/a/…), reading no cookie and requiring no sign-in. The token (16 random bytes, hex) is the whole of the access.Authorization
Only people who see every session (
user.sessions === undefined) and can steer may publish or end a share. A public page is out of the reach of whatever an invite to a single session granted, so session-scoped guests can never create one. The management routes live under/api/c/:id/sharesbehind the existingrequireSeecheck; the public route performs no sign-in check by design.Implementation notes
pocket.artifact-sharesdocument (scope: "session", a global singleton keyed by token). Session-scoped documents carry nohistory/forksemantics, so forking a conversation never touches shares: existing shares keep pointing at the conversation they were published from, which is the intended behavior./a/…route intoartifactResponse, shared verbatim by/a/…and/pub/…, so the page, the sandbox policy, and the Markdown look are one implementation./a/…behavior is unchanged and still answers 401 when signed out.sandbox allow-scripts …; frame-ancestors 'self'), so third-party sites cannot iframe it, and it cannot reach the app or its cookies. Responses carrycache-control: no-store(the sharedsend()default), so revoking a share takes effect immediately.app.access?.url(the same source webhooks use) when a tunnel provides one, else at the browser's own origin, which the sheet says in words.Known limits (deliberate)
/pub/<token>: tokens are unguessable, but a flood has no cost protection (unlike the hook route).noindex; consistent with "public".Verification
npm run check,npm run lint: pass.npm test: 390/390 pass, including 6 new tests intest/shares.test.ts(no-sign-in access, newest-vs-pinned, expiry/revoke, authorization, sandbox headers, gone artifact/version).node test/serve.ts): publish as owner, then acredentials: "omit"fetch of the link returns 200 with the right body.Server restart required after merge (touches
src/server/**outsideextensions/).