With Tauri 2.12 every app command was refused ("Command … not allowed by
ACL"): the app is served from http://localhost:44548 (tauri-plugin-
localhost), which Tauri treats as a remote origin, and since the
GHSA-7gmj-67g7-phm9 fix app commands need an explicit capability. The
Windows smoke test caught it (keychain, hotkeys, tray/taskbar/thumbbar,
token migration all failed).
build.rs now declares the 35 commands as an app manifest, and
capabilities/migrated.json (scoped to http://localhost:44548 only) grants
allow-<command> for each. The call page (http://127.0.0.1:44548) and any
remote frame still get no IPC. gen/schemas regenerated by tauri-build.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5
49 lines
1.6 KiB
Rust
49 lines
1.6 KiB
Rust
fn main() {
|
|
// Tauri 2.11+ only lets a page call app commands that a capability allows
|
|
// (GHSA-7gmj-67g7-phm9). Declaring them here generates an `allow-<name>`
|
|
// permission for each; capabilities/migrated.json grants them to the app's
|
|
// own origin (http://localhost:44548) and nothing else, so the call page
|
|
// (http://127.0.0.1:44548) and remote frames still get no IPC.
|
|
// Keep this list in sync with `generate_handler!` in src/lib.rs.
|
|
tauri_build::try_build(tauri_build::Attributes::new().app_manifest(
|
|
tauri_build::AppManifest::new().commands(&[
|
|
"check_for_update",
|
|
"flash_window",
|
|
"focus_main_window",
|
|
"get_close_behavior",
|
|
"get_focus_assist",
|
|
"get_start_minimized",
|
|
"get_tray_dnd",
|
|
"global_hotkeys_supported",
|
|
"has_tray_host",
|
|
"install_update",
|
|
"resolve_close_request",
|
|
"secure_session_clear",
|
|
"secure_session_get",
|
|
"secure_session_set",
|
|
"secure_session_supported",
|
|
"send_notification",
|
|
"set_badge_count",
|
|
"set_call_active",
|
|
"set_close_behavior",
|
|
"set_custom_chrome",
|
|
"set_global_hotkeys",
|
|
"set_jump_list",
|
|
"set_smtc_call_state",
|
|
"set_start_minimized",
|
|
"set_taskbar_progress",
|
|
"set_thumbbar",
|
|
"set_tray_call_state",
|
|
"set_tray_unread",
|
|
"set_tray_update_ready",
|
|
"show_rich_toast",
|
|
"update_install_kind",
|
|
"window_close",
|
|
"window_minimize",
|
|
"window_start_drag",
|
|
"window_toggle_maximize",
|
|
]),
|
|
))
|
|
.expect("failed to run tauri-build");
|
|
}
|