feat(mcp): centralize connection access policies

This commit is contained in:
二丫讲梵 authored and GitHub committed 2026-07-20 22:47:40 +08:00
1 parent 29f493f7da
commit d642d01eac
56 files changed
+6393 -617

No files matched your search

+11 -1
View File
@@ -3,7 +3,7 @@ use std::{
sync::Arc,
};
use dbx_core::storage::DesktopSettings;
use dbx_core::storage::{DesktopSettings, McpGlobalPolicy, McpGlobalPolicyState};
use tauri::{AppHandle, Manager, State, Window};
use super::connection::AppState;
@@ -75,6 +75,16 @@ pub async fn save_pinned_tree_node_ids(state: State<'_, Arc<AppState>>, ids: Vec
state.storage.save_pinned_tree_node_ids(&ids).await
}
#[tauri::command]
pub async fn load_mcp_global_policy(state: State<'_, Arc<AppState>>) -> Result<McpGlobalPolicyState, String> {
state.storage.load_mcp_global_policy().await
}
#[tauri::command]
pub async fn save_mcp_global_policy(state: State<'_, Arc<AppState>>, policy: McpGlobalPolicy) -> Result<(), String> {
state.storage.save_mcp_global_policy(&policy).await
}
#[tauri::command]
pub async fn load_editor_settings(state: State<'_, Arc<AppState>>) -> Result<Option<serde_json::Value>, String> {
state.storage.load_editor_settings().await