Skip to content

Reuse selected-file authorization for document previews - #28410

Closed
nwparker wants to merge 1 commit into
nwparker/plugin-app-18-authoringfrom
nwparker/plugin-app-19-file-access
Closed

nwparker wants to merge 1 commit into
nwparker/plugin-app-18-authoringfrom
nwparker/plugin-app-19-file-access

Conversation

@nwparker

@nwparker nwparker commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 0 0 0 0
Prod 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​22 $\color{#cf222e}{\Huge{\mathbf{−}}}$​76 $\color{#cf222e}{\Huge{\mathbf{−}}}$​54

ELI5

Document previews and plugin viewers use the same check for which files an opened document may read.

What Changed

Replaces the document preview's duplicated path/open checks with the existing selected-regular-file authority introduced for viewer documents. Keeps preview read limits, MIME handling and its public authorization error. The filesystem provider contract gains an optional viewer-document method, so unsupported hosts can still refuse the operation.

Why

The two file surfaces should share canonical path, workspace root, symlink, regular-file and open-handle identity rules. One implementation keeps later security fixes consistent, without widening a document's authorized directories or changing a remote opcode.

Linked Issue

Maintainer-requested plugin work. Draft layer 19, based on author tooling. No new issue created.

Visual Proof

N/A — shared filesystem authorization and an optional provider contract; no renderer change.

Testing

  • Existing security tests reused against the changed implementation.
  • Exact isolated draft: 42 tests across three files pass: document preview access, viewer document access and strict worktree authority. Node typing passes.
  • Covers explicit-root containment, canonical symlink escape, entry-only access, regular-file/refusal and read limits, plus host-bound viewer access.
  • Run on macOS. Existing remote ownership remains unchanged; no actual Windows/WSL qualification is inferred.

Review

Access still belongs to the filesystem execution host. Canonical roots and file identity are checked after opening; nonblocking open refuses special files. The preview retains its established authorization error while other I/O errors remain errors. The optional method preserves old provider compatibility; no desktop fallback is introduced.

Agent skill upstream boundary

  • Not applicable; no upstream skill-installer source copied.

Checklist

  • Two-file foundation kept separate from packages and catalog UI.
  • Reviewed boundary/root, symlink/open identity, file caps and errors.
  • SSH/host ownership, folder workspaces and old provider compatibility considered.
  • Visual proof is N/A with reason.
  • CI and remaining platform/release checks pass.

@nwparker

Copy link
Copy Markdown
Contributor Author

Superseded. This 90-PR stack was replaced by two smaller stacks rebuilt on current main: machines (#30670 → #30793, plus #30708) and plugins (#30636 → #30773). Remote/Node control hosts and the managed-workspace gateway were deferred. Closing; branches are left in place for reference.

@nwparker nwparker closed this Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant