files: a PUBLIC share link (Nextcloud /s/<token>) is bounced to the community sign-in — the front-door gate does not exempt Nextcloud's public-share paths #1720

Closed
opened 2026-09-22 05:22:35 +00:00 by ben · 3 comments
Owner

What happened (Ben, hand re-founding 2026-09-22)

In Files (Nextcloud) Ben created a public share link for a document and opened it: instead of the shared file, the community sign-in page. Verified from outside: GET https://files.<apex>/s/<token> → 302 → https://<apex>/authz/signin?rd=….

Cause

ADR 0074's browser gate fronts every files path except FilesExemptPaths (internal/clan/files.go:98-104): DAV, /public.php/dav*, /status.php, the users OCS subtree. Nextcloud's public-share browser paths are not in it: /s/<token> (and /index.php/s/<token>), the share's download/preview routes under /s/<token>/download, /apps/files_sharing/publicpreview/*, the public-share WOPI open for Collabora (/apps/richdocuments/public*), and /public.php/webdav is exempt but /s/ — the thing a person clicks — is not. So a public link is impossible on any community: a feature Nextcloud offers, IDSS silently breaks at the door.

Decision needed (sign-in trust surface — gate exemptions widen what an anonymous visitor can reach)

Proposed default: exempt the public-share browser paths on the files port — /s/*, /index.php/s/*, /apps/files_sharing/publicpreview/*, /apps/files_sharing/ajax/publicpreview*, /apps/richdocuments/public* — with the same reasoning the DAV exemptions carry: these paths are credential-governed by Nextcloud itself (a share token the owner minted, optionally password-protected/expiring; nothing is reachable without a valid token), and ADR 0258 already lets a service own the access decision on paths where the browser session cannot apply. A suspended member's shares: Nextcloud disables them with the account (member-orbit), so the suspend story holds. Alternative: keep them gated and remove/hide the share-link feature in Nextcloud (shareapi_allow_links = no) so the UI never offers what the door refuses — honest but loses the feature.

The same question exists for every co-host that has public links (Paperless share links, Omeka public items are already public by design, LimeSurvey public surveys — check LimeSurvey now, a survey nobody can answer without a community account is useless).

Test: seam — the rendered front door lists the paths; drive — the member-files leg mints a public link and fetches it session-less (200, file bytes), and a bogus token still 404s from Nextcloud, not the gate.

Why human

Ruling on which anonymous paths the front door admits (ADR 0074/0258 widening). Proposed default above.

## What happened (Ben, hand re-founding 2026-09-22) In Files (Nextcloud) Ben created a public share link for a document and opened it: instead of the shared file, the community sign-in page. Verified from outside: `GET https://files.<apex>/s/<token>` → 302 → `https://<apex>/authz/signin?rd=…`. ## Cause ADR 0074's browser gate fronts every files path except `FilesExemptPaths` (`internal/clan/files.go:98-104`): DAV, `/public.php/dav*`, `/status.php`, the users OCS subtree. Nextcloud's public-share **browser** paths are not in it: `/s/<token>` (and `/index.php/s/<token>`), the share's download/preview routes under `/s/<token>/download`, `/apps/files_sharing/publicpreview/*`, the public-share WOPI open for Collabora (`/apps/richdocuments/public*`), and `/public.php/webdav` is exempt but `/s/` — the thing a person clicks — is not. So a public link is impossible on any community: a feature Nextcloud offers, IDSS silently breaks at the door. ## Decision needed (sign-in trust surface — gate exemptions widen what an anonymous visitor can reach) Proposed default: exempt the public-share browser paths on the files port — `/s/*`, `/index.php/s/*`, `/apps/files_sharing/publicpreview/*`, `/apps/files_sharing/ajax/publicpreview*`, `/apps/richdocuments/public*` — with the same reasoning the DAV exemptions carry: these paths are **credential-governed by Nextcloud itself** (a share token the owner minted, optionally password-protected/expiring; nothing is reachable without a valid token), and ADR 0258 already lets a service own the access decision on paths where the browser session cannot apply. A suspended member's shares: Nextcloud disables them with the account (member-orbit), so the suspend story holds. Alternative: keep them gated and remove/hide the share-link feature in Nextcloud (`shareapi_allow_links = no`) so the UI never offers what the door refuses — honest but loses the feature. The same question exists for every co-host that has public links (Paperless share links, Omeka public items are already public by design, LimeSurvey public surveys — check LimeSurvey now, a survey nobody can answer without a community account is useless). Test: seam — the rendered front door lists the paths; drive — the member-files leg mints a public link and fetches it session-less (200, file bytes), and a bogus token still 404s from Nextcloud, not the gate. ## Why human Ruling on which anonymous paths the front door admits (ADR 0074/0258 widening). Proposed default above.
Author
Owner

RULED by Ben 2026-09-22 — exempt Nextcloud's public-share browser paths on the files port

Build the proposed default: add to FilesExemptPaths (internal/clan/files.go) — /s/*, /index.php/s/*, /apps/files_sharing/publicpreview/*, /apps/files_sharing/ajax/publicpreview*, /apps/richdocuments/public* — with the DAV exemptions' reasoning written beside them: credential-governed by Nextcloud (owner-minted share token, optional password/expiry; nothing reachable without a valid token), ADR 0258 lets the service own the access decision where the browser session cannot apply; a suspended member's shares die with the account (member-orbit). Verify the exact upstream route list against the pinned Nextcloud version before landing (a missed route = a half-working link).

Tests as in the body: rendered front door lists the paths; member-files leg mints a public link and fetches it session-less (200, bytes) and a bogus token 404s from Nextcloud, not the gate. ADR 0074/0258 amendment + docs/architecture front-door diagram in the same commit.

Follow-up (separate ticket, same ruling shape): audit every co-host with public links — LimeSurvey public surveys first (a survey nobody can answer without an account is useless), Paperless share links, Omeka.

Sign-in trust surface — ruled by Ben directly. Relabelled ready-for-agent.

## RULED by Ben 2026-09-22 — exempt Nextcloud's public-share browser paths on the files port Build the proposed default: add to `FilesExemptPaths` (`internal/clan/files.go`) — `/s/*`, `/index.php/s/*`, `/apps/files_sharing/publicpreview/*`, `/apps/files_sharing/ajax/publicpreview*`, `/apps/richdocuments/public*` — with the DAV exemptions' reasoning written beside them: credential-governed by Nextcloud (owner-minted share token, optional password/expiry; nothing reachable without a valid token), ADR 0258 lets the service own the access decision where the browser session cannot apply; a suspended member's shares die with the account (member-orbit). Verify the exact upstream route list against the pinned Nextcloud version before landing (a missed route = a half-working link). Tests as in the body: rendered front door lists the paths; member-files leg mints a public link and fetches it session-less (200, bytes) and a bogus token 404s from Nextcloud, not the gate. ADR 0074/0258 amendment + `docs/architecture` front-door diagram in the same commit. Follow-up (separate ticket, same ruling shape): audit every co-host with public links — LimeSurvey public surveys first (a survey nobody can answer without an account is useless), Paperless share links, Omeka. Sign-in trust surface — ruled by Ben directly. Relabelled `ready-for-agent`.

swarm-claim host=elitebook-distributed-server-03 run=29839
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=elitebook-distributed-server-03 run=29839 (automated multi-host claim — lowest live claim id works this ticket)

close-report for #1720 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 1720,
  "status": "success",
  "commits": [
    "c651e6d1"
  ],
  "changed_files": [
    "STATUS.md",
    "docs/adr/0074-suspension-enforced-at-gateway-identity-aware-ingress.md",
    "docs/adr/0258-the-editors-wopi-callback-bypasses-the-front-door-gate-only-from-the-gateways-own-addresses.md",
    "docs/architecture/05-identity-architecture.md",
    "internal/clan/files.go",
    "internal/clan/files_frontdoor_test.go",
    "internal/clan/frontdoor_test.go"
  ],
  "tests": [
    {
      "command": "go test ./internal/clan/",
      "exit_code": 0
    },
    {
      "command": "go vet ./internal/clan/",
      "exit_code": 0
    }
  ],
  "criteria": {
    "seam — the rendered front door lists the public-share paths": "TestFilesExemptPaths_ExemptThePublicShareBrowserPaths (internal/clan/files_frontdoor_test.go) renders the front door via AttachFrontDoor and asserts each of /s/*, /index.php/s/*, /apps/files_sharing/publicpreview/* (+index.php), /apps/files_sharing/ajax/publicpreview* (+index.php), /apps/richdocuments/public* (+index.php) is in the @files_exempt path matcher",
    "the public-share paths bypass the browser gate (never behind forward_auth)": "same test asserts the @files_exempt handle contains no forward_auth; paths added to FilesExemptPaths in internal/clan/files.go which the front door renders into the ungated exempt handle",
    "exempted paths are credential-governed by Nextcloud (owner-minted token), OPEN not source-bound": "internal/clan/files.go doc block + ADR 0074 amendment + ADR 0258 note record the reasoning; the TestFilesEditorCallbackPaths guard narrowed so /apps/richdocuments/public* is legitimately OPEN, distinct from source-bound callbacks",
    "verified against the pinned Nextcloud version (nextcloud32)": "internal/clan/files.go comment enumerates the nextcloud32 files_sharing/richdocuments routes; both bare and /index.php/ URL forms included per the #1642 FilesEditorCallbackPaths lesson",
    "drive — member-files leg mints a public link and fetches it session-less; bogus token 404s from Nextcloud not the gate": "LIVE drive, owed on the next member-files drive (no lab this iteration); recorded as live-proof-owed in STATUS.md and the ADR 0074 amendment"
  },
  "summary": "Public-share browser paths (both URL forms) join FilesExemptPaths so a Nextcloud public share link reaches the shared file instead of the community sign-in, per Ben's ADR 0074 amendment on #1720.",
  "blockers": []
}
**close-report** for #1720 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1720, "status": "success", "commits": [ "c651e6d1" ], "changed_files": [ "STATUS.md", "docs/adr/0074-suspension-enforced-at-gateway-identity-aware-ingress.md", "docs/adr/0258-the-editors-wopi-callback-bypasses-the-front-door-gate-only-from-the-gateways-own-addresses.md", "docs/architecture/05-identity-architecture.md", "internal/clan/files.go", "internal/clan/files_frontdoor_test.go", "internal/clan/frontdoor_test.go" ], "tests": [ { "command": "go test ./internal/clan/", "exit_code": 0 }, { "command": "go vet ./internal/clan/", "exit_code": 0 } ], "criteria": { "seam — the rendered front door lists the public-share paths": "TestFilesExemptPaths_ExemptThePublicShareBrowserPaths (internal/clan/files_frontdoor_test.go) renders the front door via AttachFrontDoor and asserts each of /s/*, /index.php/s/*, /apps/files_sharing/publicpreview/* (+index.php), /apps/files_sharing/ajax/publicpreview* (+index.php), /apps/richdocuments/public* (+index.php) is in the @files_exempt path matcher", "the public-share paths bypass the browser gate (never behind forward_auth)": "same test asserts the @files_exempt handle contains no forward_auth; paths added to FilesExemptPaths in internal/clan/files.go which the front door renders into the ungated exempt handle", "exempted paths are credential-governed by Nextcloud (owner-minted token), OPEN not source-bound": "internal/clan/files.go doc block + ADR 0074 amendment + ADR 0258 note record the reasoning; the TestFilesEditorCallbackPaths guard narrowed so /apps/richdocuments/public* is legitimately OPEN, distinct from source-bound callbacks", "verified against the pinned Nextcloud version (nextcloud32)": "internal/clan/files.go comment enumerates the nextcloud32 files_sharing/richdocuments routes; both bare and /index.php/ URL forms included per the #1642 FilesEditorCallbackPaths lesson", "drive — member-files leg mints a public link and fetches it session-less; bogus token 404s from Nextcloud not the gate": "LIVE drive, owed on the next member-files drive (no lab this iteration); recorded as live-proof-owed in STATUS.md and the ADR 0074 amendment" }, "summary": "Public-share browser paths (both URL forms) join FilesExemptPaths so a Nextcloud public share link reaches the shared file instead of the community sign-in, per Ben's ADR 0074 amendment on #1720.", "blockers": [] } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
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
Matou/idss#1720
No description provided.