Public links on space content: bound to the folder name, invisible to the space owner, survive member removal #1034

Closed
opened 2026-10-28 09:52:05 +00:00 by Cordy · 2 comments
Owner

Found in the space-sharing research (2026-10-28, research-space-sharing.md §4). Code at v0.6.366.

  1. Folder name, not space id (security, same class as #983). A link stores the resolved backend path /spaces/<dir>/… (internal/api/shares.go:277-287) and is served through the unscoped store. Path rewrites deliberately skip links (internal/share/filestore.go:151-158). After a convergence, Finish rename or retired alias (#969/#931), a link can break, or serve the folder another space took over. Contradicts docs/handbook/spaces-rename.md:11, :83. INFERRED from code; no test covers it yet. First step: a red test.
  2. Any member can make a read link, including read-only members (shares.go:255-275; upload links need write). Peering send needs write, so the rules differ.
  3. The space owner can't list or revoke members' links; only the creator or an admin can (shares.go:357-372, :391-396).
  4. Removing a member leaves their links serving (spaces.go:774-796, share/public.go:126-139).

Item 1 is a fix regardless. Items 2 to 4 belong to the decision on sharing from spaces (see the research), since links should follow the same "who may share from this space" rule.

Found in the space-sharing research (2026-10-28, research-space-sharing.md §4). Code at v0.6.366. 1. **Folder name, not space id (security, same class as #983).** A link stores the resolved backend path `/spaces/<dir>/…` (`internal/api/shares.go:277-287`) and is served through the unscoped store. Path rewrites deliberately skip links (`internal/share/filestore.go:151-158`). After a convergence, Finish rename or retired alias (#969/#931), a link can break, or serve the folder another space took over. Contradicts `docs/handbook/spaces-rename.md:11, :83`. INFERRED from code; no test covers it yet. First step: a red test. 2. **Any member can make a read link, including read-only members** (`shares.go:255-275`; upload links need write). Peering send needs write, so the rules differ. 3. **The space owner can't list or revoke members' links**; only the creator or an admin can (`shares.go:357-372, :391-396`). 4. **Removing a member leaves their links serving** (`spaces.go:774-796`, `share/public.go:126-139`). Item 1 is a fix regardless. Items 2 to 4 belong to the decision on sharing from spaces (see the research), since links should follow the same "who may share from this space" rule.
Author
Owner

Confirmed and decided (2026-10-28)

Code trace (research-identity-996-1001-1034.md): after convergence or Finish rename a space link answers 404; after alias retirement and another space taking the folder name, the link serves that space's file, listing or (root link) everything, and an upload link writes into it through the unscoped store, bypassing membership. Same after delete + purge + a new space of that name.

Fix in the next batch (ahead of #1035), as ADR 0003 already prescribes:

  • links on space content store the space id + relative path; created through scope, served by id (unknown or deleted space → 404, folder moving → 503 Retry-After as #961, folder missing → 404 + WARN); restoring a deleted space brings its links back;
  • start migration binds existing links (by folder name, else a living former name), record-level, audited;
  • decision (Nikola): a link that can't be bound stops serving and is listed for admins.
  • docs corrected: spaces-rename.md, ADR 0003, spacerename.go header, sharing.md.

Who may make links in a space, and the owner's list/revoke, come with #1035.

## Confirmed and decided (2026-10-28) Code trace (research-identity-996-1001-1034.md): after convergence or Finish rename a space link answers 404; after alias retirement and another space taking the folder name, the link serves that space's file, listing or (root link) everything, and an upload link writes into it through the unscoped store, bypassing membership. Same after delete + purge + a new space of that name. Fix in the next batch (ahead of #1035), as ADR 0003 already prescribes: - links on space content store the space id + relative path; created through scope, served by id (unknown or deleted space → 404, folder moving → 503 Retry-After as #961, folder missing → 404 + WARN); restoring a deleted space brings its links back; - start migration binds existing links (by folder name, else a living former name), record-level, audited; - **decision (Nikola): a link that can't be bound stops serving and is listed for admins.** - docs corrected: spaces-rename.md, ADR 0003, spacerename.go header, sharing.md. Who may make links in a space, and the owner's list/revoke, come with #1035.
Author
Owner

Shipped item 1 in v0.6.367 (PR #1037), both dogfoods bumped.

  • Public links on space content store the space id + path inside it (spaceId, rel in the share store) and are served by id: unknown or deleted space 404, folder moving 503 space-folder-moving (after the password gate), folder missing 404 + the #961 WARN. A rename, convergence, retired alias or a new space of the old name can no longer move a link. Restoring a deleted space brings its links back.
  • Start migration (after the folder registration): binds old links by folder, or by a former name; only if the creator holds a role in that space (or is an admin). In directory spaces where membership can't be checked it binds with role=unchecked (Nikola's decision). Otherwise the link stops serving, audited share-link-unbound, and shows "Space not found" in Administration › Sharing › Shares. An unbound link re-binds at a later start only to the space it was refused for, on a definite yes; one with no space never.
  • The owner's own share list shows the current folder.

Items 2 to 4 (who may make links in a space, owner's list/revoke, member removal) move to #1035. Live check in #1005 (M).

Shipped item 1 in v0.6.367 (PR #1037), both dogfoods bumped. - Public links on space content store the space id + path inside it (`spaceId`, `rel` in the share store) and are served by id: unknown or deleted space 404, folder moving 503 `space-folder-moving` (after the password gate), folder missing 404 + the #961 WARN. A rename, convergence, retired alias or a new space of the old name can no longer move a link. Restoring a deleted space brings its links back. - Start migration (after the folder registration): binds old links by folder, or by a former name; only if the creator holds a role in that space (or is an admin). In directory spaces where membership can't be checked it binds with `role=unchecked` (Nikola's decision). Otherwise the link stops serving, audited `share-link-unbound`, and shows "Space not found" in Administration › Sharing › Shares. An unbound link re-binds at a later start only to the space it was refused for, on a definite yes; one with no space never. - The owner's own share list shows the current folder. Items 2 to 4 (who may make links in a space, owner's list/revoke, member removal) move to #1035. Live check in #1005 (M).
Cordy closed this issue 2026-10-28 12:43:28 +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#1034
No description provided.