Skip to content
Merged

fix ci #13076

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion crates/gitbutler-tauri/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,20 @@ fn main() {
};
println!("cargo:rustc-env=IDENTIFIER={identifier}");

tauri_build::build();
// Use `try_build` with an explicit `AppManifest` so that Tauri discovers
// the hand-written permission file in `./permissions/` and activates ACL
// enforcement for our custom (non-plugin) commands.
//
// Without this, custom commands registered via `invoke_handler` bypass the
// capability/permission system entirely — see `has_app_acl_manifest` in
// Tauri's `on_message` handler.
//
// We intentionally do *not* use `AppManifest::commands()` because that
// auto-generates one permission per command. Instead, we define a single
// `allow-custom-commands` permission in `permissions/default.toml` that
// covers all commands at once.
tauri_build::try_build(
tauri_build::Attributes::new().app_manifest(tauri_build::AppManifest::new()),
)
.expect("failed to run tauri_build");
}
3 changes: 2 additions & 1 deletion crates/gitbutler-tauri/capabilities/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"updater:default",
"clipboard-manager:allow-read-text",
"clipboard-manager:allow-write-text",
"deep-link:default"
"deep-link:default",
"allow-custom-commands"
]
}
224 changes: 224 additions & 0 deletions crates/gitbutler-tauri/permissions/default.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,224 @@
# Single permission that grants access to all application commands.
# Referenced as "allow-custom-commands" in capabilities/main.json.

[[permission]]
identifier = "allow-custom-commands"
description = "Enables all custom application commands."
commands.allow = [
"abort_edit_and_return_to_workspace",
"absorb",
"absorption_plan",
"add_project",
"add_project_best_effort",
"add_remote",
"amend_commit_from_worktree_changes",
"amend_virtual_branch",
"assign_hunk",
"auto_branch_changes",
"auto_commit",
"bot",
"branch_details",
"branch_diff",
"build_type",
"canned_branch_name",
"changes_in_worktree",
"check_github_auth_status",
"check_signing_settings",
"cherry_apply",
"cherry_apply_status",
"claude_answer_ask_user_question",
"claude_cancel_session",
"claude_check_available",
"claude_compact_history",
"claude_get_config",
"claude_get_messages",
"claude_get_prompt_dirs",
"claude_get_session_details",
"claude_get_sub_agents",
"claude_get_user_message",
"claude_is_stack_active",
"claude_list_permission_requests",
"claude_list_prompt_templates",
"claude_maybe_create_prompt_dir",
"claude_send_message",
"claude_update_permission_request",
"claude_verify_path",
"clear_all_github_tokens",
"clear_all_gitlab_tokens",
"cli_path",
"commit_amend",
"commit_create",
"commit_details",
"commit_details_with_line_stats",
"commit_insert_blank",
"commit_move_changes_between",
"commit_reword",
"commit_uncommit_changes",
"create_branch",
"create_commit_from_worktree_changes",
"create_reference",
"create_snapshot",
"create_virtual_branch",
"create_virtual_branch_from_branch",
"create_workspace_rule",
"delete_all_data",
"delete_local_branch",
"delete_project",
"delete_user",
"delete_workspace_rule",
"discard_worktree_changes",
"edit_changes_from_initial",
"edit_initial_index_state",
"enter_edit_mode",
"env_vars",
"fetch_from_remotes",
"find_files",
"forge_branch_chat",
"forget_github_account",
"forget_gitlab_account",
"get_anonymous_graph_path",
"get_app_settings",
"get_author_info",
"get_base_branch_data",
"get_blob_file",
"get_branch_listing_details",
"get_commit_file",
"get_gb_config",
"get_gh_user",
"get_gl_user",
"get_initial_integration_steps_for_branch",
"get_logs_archive_path",
"get_project",
"get_project_archive_path",
"get_user",
"get_workspace_file",
"git_clone_repository",
"git_get_global_config",
"git_index_size",
"git_remote_branches",
"git_remove_global_config",
"git_set_global_config",
"git_test_fetch",
"git_test_push",
"handle_changes",
"head_info",
"head_sha",
"init_github_device_oauth",
"install_cli",
"integrate_branch_with_steps",
"integrate_upstream",
"integrate_upstream_commits",
"irc_auto_join",
"irc_auto_leave",
"irc_channels",
"irc_clear_messages",
"irc_connect",
"irc_disconnect",
"irc_exists",
"irc_get_all_commit_reactions",
"irc_get_all_message_reactions",
"irc_get_file_message_reactions",
"irc_get_working_files",
"irc_join",
"irc_list_connections",
"irc_mark_read",
"irc_messages",
"irc_nick",
"irc_part",
"irc_redact_message",
"irc_remove_reaction",
"irc_request_history",
"irc_request_history_before",
"irc_send_message",
"irc_send_message_with_data",
"irc_send_raw",
"irc_send_reaction",
"irc_send_typing",
"irc_start_working_files_broadcast",
"irc_state",
"irc_stop_working_files_broadcast",
"irc_users",
"irc_wait_ready",
"is_gerrit",
"list_actions",
"list_branches",
"list_known_github_accounts",
"list_known_gitlab_accounts",
"list_projects",
"list_remotes",
"list_reviews",
"list_snapshots",
"list_workflows",
"list_workspace_rules",
"menu_item_set_enabled",
"merge_review",
"message_hook",
"move_branch_legacy",
"move_changes_between_commits",
"move_commit",
"normalize_branch_name",
"open_in_terminal",
"open_project_in_window",
"open_url",
"operating_mode",
"post_commit_hook",
"pr_template",
"pr_templates",
"pre_commit_hook_diffspecs",
"publish_review",
"push_base_branch",
"push_stack",
"remove_branch",
"reorder_stack",
"resolve_upstream_integration",
"restore_snapshot",
"save_edit_and_return_to_workspace",
"secret_delete_global",
"secret_get_global",
"secret_set_global",
"set_base_branch",
"set_gb_config",
"set_project_active",
"set_review_auto_merge",
"set_review_draftiness",
"set_user",
"show_graph_svg",
"show_in_finder",
"snapshot_diff",
"split_branch",
"split_branch_into_dependent_branch",
"squash_commits",
"stack_details",
"stacks",
"stash_into_branch",
"store_author_globally_if_unset",
"store_github_enterprise_pat",
"store_github_pat",
"store_gitlab_pat",
"store_gitlab_selfhosted_pat",
"submit_prompt_response",
"switch_back_to_workspace",
"target_commits",
"tear_off_branch_legacy",
"tree_change_diffs",
"unapply_stack",
"uncommit_changes",
"undo_commit",
"update_branch_name",
"update_branch_pr_number",
"update_claude",
"update_commit_message",
"update_feature_flags",
"update_fetch",
"update_irc",
"update_onboarding_complete",
"update_project",
"update_review_footers",
"update_reviews",
"update_stack_order",
"update_telemetry",
"update_telemetry_distinct_id",
"update_ui",
"update_workspace_rule",
"upstream_integration_statuses",
]
Loading