Public link controls: edit a link, view only without download, note, download limit, several links per item #1105

Closed
opened 2026-11-04 03:11:20 +00:00 by Cordy · 5 comments
Owner

Gap (v0.7 feature-gap research, 2026-11-04, decided by Nikola). At 0e0885db (VERIFIED):

  • The link API can create, list, delete and resume, not edit (internal/api/shares.go:67-70): changing an expiry or password means a new link and a new URL.
  • "Can view" also allows download (docs/handbook/sharing.md:136); there is no view-only-without-download mode.
  • No note to the recipient, no download-count limit, one link per item.

Competitors. ownCloud 10 Secure View (view-only with watermark, manual); Nextcloud hide download, note, several labelled links; OpenCloud link roles (share roles); Seafile link editing requested for years (seahub #2184, #5233). Seafile's own manual calls its no-download mode "primarily a UI effect": be honest about what view-only can and cannot stop.

Folds in #721 (watermarks per group): the research found buyers ask for watermarks as part of view-only, not by group.

To research and decide when worked on. Which edits keep the URL; view-only implementation (server-rendered pages, the editor's read-only mode, watermark) and its honest limits; download counting across instances (#742); audit verbs; strings.

Refs: scratch/b7e/backlog/gap-v07/research-v07-gaps.md A6, #721.

**Gap (v0.7 feature-gap research, 2026-11-04, decided by Nikola).** At 0e0885db (VERIFIED): - The link API can create, list, delete and resume, not edit (`internal/api/shares.go:67-70`): changing an expiry or password means a new link and a new URL. - "Can view" also allows download (`docs/handbook/sharing.md:136`); there is no view-only-without-download mode. - No note to the recipient, no download-count limit, one link per item. **Competitors.** ownCloud 10 Secure View (view-only with watermark, [manual](https://doc.owncloud.com/server/10.16/admin_manual/enterprise/collaboration/collabora_secure_view.html)); Nextcloud hide download, note, several labelled links; OpenCloud link roles ([share roles](https://docs.opencloud.eu/docs/user/roles/share-roles)); Seafile link editing requested for years (seahub #2184, #5233). Seafile's own manual calls its no-download mode "primarily a UI effect": be honest about what view-only can and cannot stop. **Folds in #721** (watermarks per group): the research found buyers ask for watermarks as part of view-only, not by group. **To research and decide when worked on.** Which edits keep the URL; view-only implementation (server-rendered pages, the editor's read-only mode, watermark) and its honest limits; download counting across instances (#742); audit verbs; strings. Refs: `scratch/b7e/backlog/gap-v07/research-v07-gaps.md` A6, #721.
Author
Owner

Research done (2026-11-07, at 78c814d7; scratch/b7e/backlog/research-1105.md).

Recommended first version: PATCH /api/v1/shares/{token} edits label, note, expiry, password, download limit and role and keeps the URL (restricting always allowed, widening checked like a new link); four roles (view and download, view only, upload only, view + download + upload); a plain-text note shown after the password gate; a download limit counted per link in a coordination record before the first byte (link kept at the limit, owner can raise it); a password change signs out earlier visitors on every instance. View only goes through the editor (Collabora) in read-only mode with export, print and copy off and a per-link watermark, raw downloads refused. It needs one more safeguard first: WOPI reads for visitor tokens limited to the editor server (proof keys or an allow-list). The handbook will say plainly that screenshots cannot be stopped.

Findings filed separately: #1139 (plain-mode links serve HTML/SVG inline: security), #1140 (Copy link on an existing key link drops the key). "One link per item" is not a limit in the code (several links already work; labels are missing). #721 turns out to be about marking downloads for leak tracing, not visible watermarks; recommend keeping it as its own small item.

Decisions for Nikola follow.

**Research done** (2026-11-07, at 78c814d7; `scratch/b7e/backlog/research-1105.md`). Recommended first version: `PATCH /api/v1/shares/{token}` edits label, note, expiry, password, download limit and role and keeps the URL (restricting always allowed, widening checked like a new link); four roles (view and download, view only, upload only, view + download + upload); a plain-text note shown after the password gate; a download limit counted per link in a coordination record before the first byte (link kept at the limit, owner can raise it); a password change signs out earlier visitors on every instance. View only goes through the editor (Collabora) in read-only mode with export, print and copy off and a per-link watermark, raw downloads refused. It needs one more safeguard first: WOPI reads for visitor tokens limited to the editor server (proof keys or an allow-list). The handbook will say plainly that screenshots cannot be stopped. Findings filed separately: #1139 (plain-mode links serve HTML/SVG inline: security), #1140 (Copy link on an existing key link drops the key). "One link per item" is not a limit in the code (several links already work; labels are missing). #721 turns out to be about marking downloads for leak tracing, not visible watermarks; recommend keeping it as its own small item. Decisions for Nikola follow.
Author
Owner

Decisions (Nikola, 2026-11-07):

  • View only is in v1, through the editor (Collabora read-only, export/print/copy off, watermark), Office files and PDFs; the WOPI safeguard comes first (visitor-token file reads only from the editor server); shown disabled with a reason when no editor is set up; the handbook says plainly screenshots can't be stopped.
  • #721 is split out again (download marking for chosen groups), not part of #1105.
  • All other recommendations approved: PATCH edit keeps the URL; restricting always allowed, widening checked like a new link (max expiry from now, audited); four roles (view + download, view only, upload only, view + download + upload); note up to 1,000 characters after the password gate; download limit counted before the first byte, link kept at the limit, interrupted downloads count unless nothing was sent, one count per file or ZIP; password change signs everyone out; admins keep Revoke only; last write per field wins; audit verb share-link-edit always recorded; watermark {instance} · {label} · {date} with a preview. After launch: reactivating expired links, a "Can view (secure)" internal role.
  • #1140 (Copy link drops the key) is built in this batch; #1139 (security) ships first as its own release.
**Decisions (Nikola, 2026-11-07):** - View only is in v1, through the editor (Collabora read-only, export/print/copy off, watermark), Office files and PDFs; the WOPI safeguard comes first (visitor-token file reads only from the editor server); shown disabled with a reason when no editor is set up; the handbook says plainly screenshots can't be stopped. - #721 is split out again (download marking for chosen groups), not part of #1105. - All other recommendations approved: PATCH edit keeps the URL; restricting always allowed, widening checked like a new link (max expiry from now, audited); four roles (view + download, view only, upload only, view + download + upload); note up to 1,000 characters after the password gate; download limit counted before the first byte, link kept at the limit, interrupted downloads count unless nothing was sent, one count per file or ZIP; password change signs everyone out; admins keep Revoke only; last write per field wins; audit verb `share-link-edit` always recorded; watermark `{instance} · {label} · {date}` with a preview. After launch: reactivating expired links, a "Can view (secure)" internal role. - #1140 (Copy link drops the key) is built in this batch; #1139 (security) ships first as its own release.
Author
Owner

Mockup approved (Nikola, 2026-11-07): 1105-link-controls-mockup.html (with #1140), 20 frames, all open points as recommended: screenshot caveat in the owner's dialog and handbook (visitor page says what is off and that pages carry a watermark); one bell when a link reaches its download limit; "Allow view-only links" on by default, offered only once the editor is verified (WOPI proof keys, else an address list in the config file); watermark date 2026-11-07 style in server time; switching to view only keeps the stored limit and count hidden; Edit from Shares opens the item's pane with that row's form; create form folds behind "Add another link"; limit-reached rows keep Copy and Edit; no marker on links without a saved key in v1.

**Mockup approved** (Nikola, 2026-11-07): `1105-link-controls-mockup.html` (with #1140), 20 frames, all open points as recommended: screenshot caveat in the owner's dialog and handbook (visitor page says what is off and that pages carry a watermark); one bell when a link reaches its download limit; "Allow view-only links" on by default, offered only once the editor is verified (WOPI proof keys, else an address list in the config file); watermark date 2026-11-07 style in server time; switching to view only keeps the stored limit and count hidden; Edit from Shares opens the item's pane with that row's form; create form folds behind "Add another link"; limit-reached rows keep Copy and Edit; no marker on links without a saved key in v1.
Author
Owner

Spec decisions (Nikola, 2026-11-07; research research-b3v07-unsettled.md): failed proof-key check answers 500 (WOPI spec, as Nextcloud and oCIS), address-list mode 403, both with code wopi-proof-required; visitor editor tokens last 10 h capped at the link's end (security from the per-call link check); visitor OwnerId link + 8 hex; an unknown link role fails closed; a rolling upgrade with an older instance is listed as a #742 gate; "Too many attempts. Try again in a minute." on the public password page; CHANGELOG notes that the "Outside policy" bulk revoke reaches more links. FR/IT strings approved (IT "Sola visualizzazione"). Spec and plan: .superpowers/sdd/2026-11-07-b3v07/spec-1105.md, plan-1105.md. Build starts.

**Spec decisions** (Nikola, 2026-11-07; research `research-b3v07-unsettled.md`): failed proof-key check answers 500 (WOPI spec, as Nextcloud and oCIS), address-list mode 403, both with code `wopi-proof-required`; visitor editor tokens last 10 h capped at the link's end (security from the per-call link check); visitor OwnerId `link` + 8 hex; an unknown link role fails closed; a rolling upgrade with an older instance is listed as a #742 gate; "Too many attempts. Try again in a minute." on the public password page; CHANGELOG notes that the "Outside policy" bulk revoke reaches more links. FR/IT strings approved (IT "Sola visualizzazione"). Spec and plan: `.superpowers/sdd/2026-11-07-b3v07/spec-1105.md`, `plan-1105.md`. Build starts.
Author
Owner

Shipped in v0.6.403 (PR #1142, merge d02f2ba1), live on both dogfoods (pods on v0.6.403, ready, no restarts, no new WARN/ERROR lines, healthz 200).

What shipped:

  • Edit a public link in place: label, note (shown to visitors), role (view, download, upload, both), download limit, expiry, password. Make a new link from an old one.
  • View-only links: documents open read only in the document editor, with a watermark. The editor is verified by WOPI proof keys, or by office.serverAddresses when it publishes none. Visitor tokens carry no user claims, are re-checked on every editor call, end at the earlier of 10 h and the link's end, and stop at the next call when the link changes or the setting is turned off.
  • Download limits: every GET counts, limited links answer Accept-Ranges: none, a refund only when no byte was sent; a bell to the creator, the space owner and managers.
  • Administration › Sharing: View-only links, Watermark and Link keys boxes; Label and Downloads columns; Copy only on plain and password links.
  • Plain links count as outside policy while plain links are not allowed.

Reviews: four waves, fix rounds fx1-fx4, final review with adversarial probes on the visitor path, the limit, key copy/paste and PATCH widening; no holes found.

Multi-instance residuals R1-R6 are in ARCHITECTURE.md and on #742. Live checks go to #1005. After-launch items are filed separately.

Shipped in **v0.6.403** (PR #1142, merge d02f2ba1), live on both dogfoods (pods on v0.6.403, ready, no restarts, no new WARN/ERROR lines, healthz 200). What shipped: - Edit a public link in place: label, note (shown to visitors), role (view, download, upload, both), download limit, expiry, password. Make a new link from an old one. - View-only links: documents open read only in the document editor, with a watermark. The editor is verified by WOPI proof keys, or by `office.serverAddresses` when it publishes none. Visitor tokens carry no user claims, are re-checked on every editor call, end at the earlier of 10 h and the link's end, and stop at the next call when the link changes or the setting is turned off. - Download limits: every GET counts, limited links answer `Accept-Ranges: none`, a refund only when no byte was sent; a bell to the creator, the space owner and managers. - Administration › Sharing: View-only links, Watermark and Link keys boxes; Label and Downloads columns; Copy only on plain and password links. - Plain links count as outside policy while plain links are not allowed. Reviews: four waves, fix rounds fx1-fx4, final review with adversarial probes on the visitor path, the limit, key copy/paste and PATCH widening; no holes found. Multi-instance residuals R1-R6 are in ARCHITECTURE.md and on #742. Live checks go to #1005. After-launch items are filed separately.
Cordy closed this issue 2026-11-07 19:30:18 +00:00
Sign in to join this conversation.
No labels
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Cordy/Cairn#1105
No description provided.