Repository navigation
Grant the packaged UI its folder picker, terminal replay and Tailscale opener - #6525
Merged
Merged
Conversation
…e opener The packaged main UI is served from the sidecar's loopback origin, where Tauri refused four app commands it calls: the folder picker, opening a folder, the terminal's scrollback replay and opening the Tailscale app (#6502). - shell_pick_directory and open_tailscale_app get their own exact loopback capabilities for the main webview. pty_snapshot joins the terminal grants in loopback-browser and still reads only the caller's own sessions. - The two open-folder callers (backup folder, workspace folder) now use the already-granted shell_reveal_path, which opens a plain folder but selects an app or document bundle instead of launching it. shell_open_path stays local-only. - The contract test's #6502 known-gap rows are removed, with tests for each grant's exact scope. Refs #6502
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.
Refs #6502
What changes
The packaged main UI runs on the sidecar's loopback origin (
http://127.0.0.1:3020), where Tauri refused four commands that worked only in dev. Per Val's decision (grant all four, narrowly):shell_pick_directoryloopback-folder-picker(main webview, loopback origins, one permission)open_tailscale_apploopback-tailscale-app. The command takes no arguments, and the launcher uses fixed onespty_snapshotallow-pty-snapshot, added toloopback-browserbeside the existing PTY grants. It still checksensure_trusted_pty_callerand reads only the caller's own sessionsshell_open_pathshell_reveal_pathWhy
shell_open_pathisn't granted: it opens any existing directory, and on macOSopenlaunches an.appor document bundle, which is a directory on disk.shell_reveal_pathopens a plain folder the same way, but selects a bundle in its parent instead of launching it. Moving the callers is narrower than the "limited to Cave-owned paths" grant Val approved, and it adds no new loopback authority. One visible difference: a workspace folder whose name has an extension (for examplesite.v2) is now selected in its parent instead of opened.The quick-chat tray gets none of these grants. The four #6502 rows are removed from the known-gap list in
src-tauri/permissions/desktop-permissions.test.mjs.Evidence
node --test src-tauri/permissions/desktop-permissions.test.mjs: 25/25. That includes two new tests (each grant's exact scope, no grant on remote origins or in the tray, no loopbackshell_open_pathgrant or caller) and the existing invoke-sweep contract with an empty Packaged main UI invokes app commands its loopback origin is not granted (folder picker, open path, PTY snapshot, Tailscale) #6502 gap list.loopback-folder-pickerfails the suite.cargo checkpasses (tauri-build validates the capability files).pnpm typecheckandeslinton the changed files pass. The callers' component tests are repinned toshell_reveal_path, and all 34 related component tests pass (run like CI).Not verified here
Packaged proof needs an installed build that contains this change. The drill used for #6503 applies: an argument-less invoke is denied before and admitted after (see #6502's table), the picker opens from First project, and the bottom terminal replays after a remount. Windows rows need the Windows guest.