From 40df512c3fb11a769ae57692550c23899c28fe75 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Mon, 3 Nov 2025 18:49:06 +0800 Subject: update: Registry and connection improvements - Update client and server registry logic - Improve TCP connection instance handling --- crates/utils/tcp_connection/src/instance_challenge.rs | 16 +++++++++++++++- crates/vcs_actions/src/registry/client_registry.rs | 12 ++++++++++-- crates/vcs_actions/src/registry/server_registry.rs | 11 +++++++++-- 3 files changed, 34 insertions(+), 5 deletions(-) diff --git a/crates/utils/tcp_connection/src/instance_challenge.rs b/crates/utils/tcp_connection/src/instance_challenge.rs index c4ea6a8..3a7f6a3 100644 --- a/crates/utils/tcp_connection/src/instance_challenge.rs +++ b/crates/utils/tcp_connection/src/instance_challenge.rs @@ -132,7 +132,21 @@ impl ConnectionInstance { self.stream.read_exact(&mut challenge).await?; // Load private key - let private_key_pem = tokio::fs::read_to_string(&private_key_file).await?; + let private_key_pem = tokio::fs::read_to_string(&private_key_file) + .await + .map_err(|e| { + TcpTargetError::NotFound(format!( + "Read private key \"{}\" failed: \"{}\"", + private_key_file + .as_ref() + .display() + .to_string() + .split("/") + .last() + .unwrap_or("UNKNOWN"), + e + )) + })?; // Sign the challenge with supported key types let signature = if let Ok(rsa_key) = RsaPrivateKey::from_pkcs1_pem(&private_key_pem) { diff --git a/crates/vcs_actions/src/registry/client_registry.rs b/crates/vcs_actions/src/registry/client_registry.rs index c7d6eb9..a0b87a6 100644 --- a/crates/vcs_actions/src/registry/client_registry.rs +++ b/crates/vcs_actions/src/registry/client_registry.rs @@ -9,16 +9,24 @@ use vcs_data::data::{ }; use crate::{ - actions::local_actions::{ - register_set_upstream_vault_action, register_update_to_latest_info_action, + actions::{ + local_actions::{ + register_set_upstream_vault_action, register_update_to_latest_info_action, + }, + sheet_actions::register_make_sheet_action, }, connection::protocol::RemoteActionInvoke, }; fn register_actions(pool: &mut ActionPool) { // Pool register here + + // Local Actions register_set_upstream_vault_action(pool); register_update_to_latest_info_action(pool); + + // Sheet Actions + register_make_sheet_action(pool); } pub fn client_action_pool() -> ActionPool { diff --git a/crates/vcs_actions/src/registry/server_registry.rs b/crates/vcs_actions/src/registry/server_registry.rs index 3b6ab17..eade391 100644 --- a/crates/vcs_actions/src/registry/server_registry.rs +++ b/crates/vcs_actions/src/registry/server_registry.rs @@ -1,12 +1,19 @@ use action_system::action_pool::ActionPool; -use crate::actions::local_actions::{ - register_set_upstream_vault_action, register_update_to_latest_info_action, +use crate::actions::{ + local_actions::{register_set_upstream_vault_action, register_update_to_latest_info_action}, + sheet_actions::register_make_sheet_action, }; pub fn server_action_pool() -> ActionPool { let mut pool = ActionPool::new(); + + // Local Actions register_set_upstream_vault_action(&mut pool); register_update_to_latest_info_action(&mut pool); + + // Sheet Actions + register_make_sheet_action(&mut pool); + pool } -- cgit