diff --git a/mongo-proxy/src/config.rs b/mongo-proxy/src/config.rs index d85ffa4..c37beaa 100644 --- a/mongo-proxy/src/config.rs +++ b/mongo-proxy/src/config.rs @@ -19,16 +19,20 @@ pub struct PoolConfig { pub idle_timeout_secs: u64, #[serde(default = "default_check_interval")] pub check_interval_secs: u64, + #[serde(default = "default_query_timeout")] + pub query_timeout_secs: u64, } fn default_idle_timeout() -> u64 { 300 } fn default_check_interval() -> u64 { 60 } +fn default_query_timeout() -> u64 { 60 } impl Default for PoolConfig { fn default() -> Self { Self { idle_timeout_secs: default_idle_timeout(), check_interval_secs: default_check_interval(), + query_timeout_secs: default_query_timeout(), } } } diff --git a/mongo-proxy/src/db.rs b/mongo-proxy/src/db.rs index 302feaf..500f7d3 100644 --- a/mongo-proxy/src/db.rs +++ b/mongo-proxy/src/db.rs @@ -94,6 +94,11 @@ impl ConnectionManager { }).collect() } + /// 单次操作执行超时(秒),用于 API handler 的 tokio::time::timeout + pub fn query_timeout_secs(&self) -> u64 { + self.pool_config.query_timeout_secs + } + pub fn cleanup_idle(&self) { let mut clients = self.clients.lock().unwrap(); let now = Instant::now(); diff --git a/mongo-proxy/src/handler.rs b/mongo-proxy/src/handler.rs index f8934b2..0a5a810 100644 --- a/mongo-proxy/src/handler.rs +++ b/mongo-proxy/src/handler.rs @@ -7,7 +7,7 @@ use futures_util::TryStreamExt; use mongodb::bson::Document; use serde::{Deserialize, Serialize}; use std::sync::Arc; -use std::time::Instant; +use std::time::{Duration, Instant}; use crate::db::ConnectionManager; use crate::logger::{LogEntry, RequestLogger}; @@ -197,19 +197,27 @@ pub async fn find( if let Some(l) = req.limit { find = find.limit(l); } if let Some(s) = req.skip { find = find.skip(s); } - let mut cursor = find.await - .map_err(|e| { + let timeout_secs = manager.query_timeout_secs(); + let operation = async { + let mut cursor = find.await?; + let mut documents = Vec::new(); + while let Some(result) = cursor.try_next().await? { + documents.push(bson_to_json(&result)); + } + Ok::<_, mongodb::error::Error>(documents) + }; + let documents = match tokio::time::timeout(Duration::from_secs(timeout_secs), operation).await { + Ok(Ok(documents)) => documents, + Ok(Err(e)) => { logger.log(&LogEntry::new("/find", "http").with_conn(&req.conn).with_command(&format!("{}.{}", req.conn, req.collection)).with_error(&e.to_string())); - error_response(&e.to_string()) - })?; - - let mut documents = Vec::new(); - while let Some(result) = cursor.try_next().await.map_err(|e: mongodb::error::Error| { - logger.log(&LogEntry::new("/find", "http").with_conn(&req.conn).with_error(&e.to_string())); - error_response(&e.to_string()) - })? { - documents.push(bson_to_json(&result)); - } + return Err(error_response(&e.to_string())); + } + Err(_) => { + let msg = format!("操作超时(>{}s)", timeout_secs); + logger.log(&LogEntry::new("/find", "http").with_conn(&req.conn).with_command(&format!("{}.{}", req.conn, req.collection)).with_error(&msg)); + return Err(timeout_response(timeout_secs)); + } + }; let count = documents.len(); let duration = start.elapsed(); @@ -240,11 +248,18 @@ pub async fn insert( let db = client.database(&get_database(manager, &req.conn)); let coll = db.collection::(&req.collection); - let result = coll.insert_many(req.documents).await - .map_err(|e| { + let timeout_secs = manager.query_timeout_secs(); + let result = match tokio::time::timeout(Duration::from_secs(timeout_secs), coll.insert_many(req.documents)).await { + Ok(r) => r.map_err(|e| { logger.log(&LogEntry::new("/insert", "http").with_conn(&req.conn).with_command(&format!("{}.{}", req.conn, req.collection)).with_error(&e.to_string())); error_response(&e.to_string()) - })?; + })?, + Err(_) => { + let msg = format!("操作超时(>{}s)", timeout_secs); + logger.log(&LogEntry::new("/insert", "http").with_conn(&req.conn).with_command(&format!("{}.{}", req.conn, req.collection)).with_error(&msg)); + return Err(timeout_response(timeout_secs)); + } + }; let inserted_ids: Vec = result.inserted_ids.iter() .map(|(k, v)| format!("{}:{}", k, v)) @@ -278,18 +293,29 @@ pub async fn update( let db = client.database(&get_database(manager, &req.conn)); let coll = db.collection::(&req.collection); - let result = if req.multi.unwrap_or(false) { - let mut cmd = coll.update_many(req.filter, req.update); - if req.upsert.unwrap_or(false) { cmd = cmd.upsert(true); } - cmd.await - } else { - let mut cmd = coll.update_one(req.filter, req.update); - if req.upsert.unwrap_or(false) { cmd = cmd.upsert(true); } - cmd.await - }.map_err(|e| { - logger.log(&LogEntry::new("/update", "http").with_conn(&req.conn).with_command(&format!("{}.{}", req.conn, req.collection)).with_error(&e.to_string())); - error_response(&e.to_string()) - })?; + let timeout_secs = manager.query_timeout_secs(); + let operation = async { + if req.multi.unwrap_or(false) { + let mut cmd = coll.update_many(req.filter, req.update); + if req.upsert.unwrap_or(false) { cmd = cmd.upsert(true); } + cmd.await + } else { + let mut cmd = coll.update_one(req.filter, req.update); + if req.upsert.unwrap_or(false) { cmd = cmd.upsert(true); } + cmd.await + } + }; + let result = match tokio::time::timeout(Duration::from_secs(timeout_secs), operation).await { + Ok(r) => r.map_err(|e| { + logger.log(&LogEntry::new("/update", "http").with_conn(&req.conn).with_command(&format!("{}.{}", req.conn, req.collection)).with_error(&e.to_string())); + error_response(&e.to_string()) + })?, + Err(_) => { + let msg = format!("操作超时(>{}s)", timeout_secs); + logger.log(&LogEntry::new("/update", "http").with_conn(&req.conn).with_command(&format!("{}.{}", req.conn, req.collection)).with_error(&msg)); + return Err(timeout_response(timeout_secs)); + } + }; let upserted_id = result.upserted_id.map(|id| format!("{:?}", id)); let duration = start.elapsed(); @@ -324,14 +350,25 @@ pub async fn delete( let db = client.database(&get_database(manager, &req.conn)); let coll = db.collection::(&req.collection); - let result = if req.multi.unwrap_or(false) { - coll.delete_many(req.filter).await - } else { - coll.delete_one(req.filter).await - }.map_err(|e| { - logger.log(&LogEntry::new("/delete", "http").with_conn(&req.conn).with_command(&format!("{}.{}", req.conn, req.collection)).with_error(&e.to_string())); - error_response(&e.to_string()) - })?; + let timeout_secs = manager.query_timeout_secs(); + let operation = async { + if req.multi.unwrap_or(false) { + coll.delete_many(req.filter).await + } else { + coll.delete_one(req.filter).await + } + }; + let result = match tokio::time::timeout(Duration::from_secs(timeout_secs), operation).await { + Ok(r) => r.map_err(|e| { + logger.log(&LogEntry::new("/delete", "http").with_conn(&req.conn).with_command(&format!("{}.{}", req.conn, req.collection)).with_error(&e.to_string())); + error_response(&e.to_string()) + })?, + Err(_) => { + let msg = format!("操作超时(>{}s)", timeout_secs); + logger.log(&LogEntry::new("/delete", "http").with_conn(&req.conn).with_command(&format!("{}.{}", req.conn, req.collection)).with_error(&msg)); + return Err(timeout_response(timeout_secs)); + } + }; let deleted_count = result.deleted_count; let duration = start.elapsed(); @@ -361,19 +398,27 @@ pub async fn aggregate( let db = client.database(&get_database(manager, &req.conn)); let coll = db.collection::(&req.collection); - let mut cursor = coll.aggregate(req.pipeline).await - .map_err(|e| { + let timeout_secs = manager.query_timeout_secs(); + let operation = async { + let mut cursor = coll.aggregate(req.pipeline).await?; + let mut documents = Vec::new(); + while let Some(result) = cursor.try_next().await? { + documents.push(bson_to_json(&result)); + } + Ok::<_, mongodb::error::Error>(documents) + }; + let documents = match tokio::time::timeout(Duration::from_secs(timeout_secs), operation).await { + Ok(Ok(documents)) => documents, + Ok(Err(e)) => { logger.log(&LogEntry::new("/aggregate", "http").with_conn(&req.conn).with_command(&format!("{}.{}", req.conn, req.collection)).with_error(&e.to_string())); - error_response(&e.to_string()) - })?; - - let mut documents = Vec::new(); - while let Some(result) = cursor.try_next().await.map_err(|e: mongodb::error::Error| { - logger.log(&LogEntry::new("/aggregate", "http").with_conn(&req.conn).with_error(&e.to_string())); - error_response(&e.to_string()) - })? { - documents.push(bson_to_json(&result)); - } + return Err(error_response(&e.to_string())); + } + Err(_) => { + let msg = format!("操作超时(>{}s)", timeout_secs); + logger.log(&LogEntry::new("/aggregate", "http").with_conn(&req.conn).with_command(&format!("{}.{}", req.conn, req.collection)).with_error(&msg)); + return Err(timeout_response(timeout_secs)); + } + }; let count = documents.len(); let duration = start.elapsed(); @@ -404,11 +449,18 @@ pub async fn count( let db = client.database(&get_database(manager, &req.conn)); let coll = db.collection::(&req.collection); - let count = coll.count_documents(req.filter.unwrap_or_default()).await - .map_err(|e| { + let timeout_secs = manager.query_timeout_secs(); + let count = match tokio::time::timeout(Duration::from_secs(timeout_secs), coll.count_documents(req.filter.unwrap_or_default())).await { + Ok(r) => r.map_err(|e| { logger.log(&LogEntry::new("/count", "http").with_conn(&req.conn).with_command(&format!("{}.{}", req.conn, req.collection)).with_error(&e.to_string())); error_response(&e.to_string()) - })?; + })?, + Err(_) => { + let msg = format!("操作超时(>{}s)", timeout_secs); + logger.log(&LogEntry::new("/count", "http").with_conn(&req.conn).with_command(&format!("{}.{}", req.conn, req.collection)).with_error(&msg)); + return Err(timeout_response(timeout_secs)); + } + }; let duration = start.elapsed(); @@ -482,6 +534,10 @@ fn error_response_with_usage(msg: &str, usage: &str) -> (StatusCode, Json (StatusCode, Json) { + (StatusCode::REQUEST_TIMEOUT, Json(ErrorResponse::new(&format!("操作超时(>{}s)", secs)))) +} + fn list_conn_names(manager: &ConnectionManager) -> String { manager.list_connections() .iter() diff --git a/mongo-proxy/src/logger.rs b/mongo-proxy/src/logger.rs index 852983c..e2be37f 100644 --- a/mongo-proxy/src/logger.rs +++ b/mongo-proxy/src/logger.rs @@ -97,7 +97,7 @@ impl LogEntry { } pub fn with_command(mut self, cmd: &str) -> Self { - self.command = Some(truncate_string(cmd, 500)); + self.command = Some(truncate_string(cmd, 2000)); self } diff --git a/mongo-proxy/src/main.rs b/mongo-proxy/src/main.rs index fa6e422..8c29a05 100644 --- a/mongo-proxy/src/main.rs +++ b/mongo-proxy/src/main.rs @@ -11,6 +11,17 @@ use axum::{ use clap::{Parser, Subcommand}; use std::sync::Arc; +// ⚠ 共享实现,修改需同步至 mysql/ssh/redis-proxy/src/main.rs +/// 默认请求日志路径(未设置 MONGO_PROXY_LOG 时): exe同目录 logs/mongo-proxy.log +fn default_log_path(name: &str) -> String { + match std::env::current_exe() { + Ok(exe) => exe.parent() + .map(|d| d.join("logs").join(format!("{}.log", name)).to_string_lossy().into_owned()) + .unwrap_or_else(|| format!("{}.log", name)), + Err(_) => format!("{}.log", name), + } +} + #[derive(Parser, Debug)] #[command(name = "mongo-proxy")] #[command(about = "MongoDB HTTP proxy with connection pooling")] @@ -154,13 +165,32 @@ enum Commands { Connections, } +// ⚠ 共享实现,修改需同步至 mysql/ssh/redis-proxy/src/main.rs +/// 将相对路径基于可执行文件所在目录解析为绝对路径 +fn resolve_config_path(path: &str) -> String { + if std::path::Path::new(path).is_absolute() || path.starts_with('~') { + return path.to_string(); + } + match std::env::current_exe() { + Ok(exe) => { + if let Some(dir) = exe.parent() { + dir.join(path).to_string_lossy().into_owned() + } else { + path.to_string() + } + } + Err(_) => path.to_string(), + } +} + #[tokio::main] async fn main() -> anyhow::Result<()> { let args = Args::parse(); + let config_path = resolve_config_path(&args.config); match args.command { Some(Commands::Server { port, host }) => { - run_server(&args.config, port, host).await + run_server(&config_path, port, host).await } Some(Commands::Find { conn, collection, filter, projection, limit, skip, format }) => { run_find(&args.server, &conn, &collection, &filter, &format, projection.as_deref(), limit, skip) @@ -184,7 +214,7 @@ async fn main() -> anyhow::Result<()> { list_connections(&args.server) } None => { - run_server(&args.config, None, None).await + run_server(&config_path, None, None).await } } } @@ -201,7 +231,8 @@ async fn run_server(config_path: &str, port: Option, host: Option) config.server.host = host; } - let log_path = std::env::var("MONGO_PROXY_LOG").ok(); + let log_path = std::env::var("MONGO_PROXY_LOG").ok() + .or_else(|| Some(default_log_path("mongo-proxy"))); let logger = Arc::new(logger::RequestLogger::new(log_path.as_deref())); if logger.is_enabled() { println!("Request logging: enabled"); diff --git a/mysql-proxy/src/logger.rs b/mysql-proxy/src/logger.rs index 4ad61aa..619ac20 100644 --- a/mysql-proxy/src/logger.rs +++ b/mysql-proxy/src/logger.rs @@ -123,13 +123,13 @@ impl LogEntry { pub fn with_sql(mut self, sql: &str) -> Self { // 截断过长的 SQL - self.sql = Some(truncate_string(sql, 1000)); + self.sql = Some(truncate_string(sql, 2000)); self } pub fn with_command(mut self, command: &str) -> Self { // 截断过长的命令 - self.command = Some(truncate_string(command, 500)); + self.command = Some(truncate_string(command, 2000)); self } diff --git a/mysql-proxy/src/main.rs b/mysql-proxy/src/main.rs index c308c5f..101a1db 100644 --- a/mysql-proxy/src/main.rs +++ b/mysql-proxy/src/main.rs @@ -64,6 +64,17 @@ enum Commands { } // ⚠ 共享实现,修改需同步至 ssh/mongo/redis-proxy/src/main.rs +/// 默认请求日志路径(未设置 MYSQL_PROXY_LOG 时): exe同目录 logs/mysql-proxy.log +/// 日志默认开启——此前需手动设 env 才记录,排查只能靠复现 +fn default_log_path(name: &str) -> String { + match std::env::current_exe() { + Ok(exe) => exe.parent() + .map(|d| d.join("logs").join(format!("{}.log", name)).to_string_lossy().into_owned()) + .unwrap_or_else(|| format!("{}.log", name)), + Err(_) => format!("{}.log", name), + } +} + /// 将相对路径基于可执行文件所在目录解析为绝对路径 fn resolve_config_path(path: &str) -> String { if std::path::Path::new(path).is_absolute() || path.starts_with('~') { @@ -118,7 +129,8 @@ async fn run_server(config_path: &str, port: Option, host: Option) } // 初始化日志 - let log_path = std::env::var("MYSQL_PROXY_LOG").ok(); + let log_path = std::env::var("MYSQL_PROXY_LOG").ok() + .or_else(|| Some(default_log_path("mysql-proxy"))); let logger = Arc::new(logger::RequestLogger::new(log_path.as_deref())); if logger.is_enabled() { println!("Request logging: enabled"); diff --git a/redis-proxy/src/config.rs b/redis-proxy/src/config.rs index 0ee220b..c291fc6 100644 --- a/redis-proxy/src/config.rs +++ b/redis-proxy/src/config.rs @@ -17,14 +17,18 @@ pub struct PoolConfig { pub idle_timeout_secs: u64, #[serde(default = "default_check_interval")] pub check_interval_secs: u64, + /// 单操作执行超时(秒):防无界阻塞,超时返回 408 + #[serde(default = "default_query_timeout")] + pub query_timeout_secs: u64, } fn default_idle_timeout() -> u64 { 300 } fn default_check_interval() -> u64 { 60 } +fn default_query_timeout() -> u64 { 60 } impl Default for PoolConfig { fn default() -> Self { - Self { idle_timeout_secs: default_idle_timeout(), check_interval_secs: default_check_interval() } + Self { idle_timeout_secs: default_idle_timeout(), check_interval_secs: default_check_interval(), query_timeout_secs: default_query_timeout() } } } diff --git a/redis-proxy/src/db.rs b/redis-proxy/src/db.rs index 68d2405..0c40ec9 100644 --- a/redis-proxy/src/db.rs +++ b/redis-proxy/src/db.rs @@ -29,6 +29,10 @@ impl ConnectionManager { Ok(Self { clients: Mutex::new(HashMap::new()), configs: Mutex::new(config_map), pool_config }) } + pub fn query_timeout_secs(&self) -> u64 { + self.pool_config.query_timeout_secs + } + pub fn get_conn(&self, name: &str) -> Result<(RedisClient, ConnectionConfig)> { let client = { let mut clients = self.clients.lock().unwrap(); diff --git a/redis-proxy/src/handler.rs b/redis-proxy/src/handler.rs index 4c8bd46..6e34f80 100644 --- a/redis-proxy/src/handler.rs +++ b/redis-proxy/src/handler.rs @@ -2,7 +2,7 @@ use axum::{extract::State, http::StatusCode, Json}; use redis::Commands; use serde::{Deserialize, Serialize}; use std::sync::Arc; -use std::time::Instant; +use std::time::{Duration, Instant}; use crate::db::ConnectionManager; use crate::logger::{LogEntry, RequestLogger}; @@ -71,6 +71,11 @@ type ApiError = (StatusCode, Json); fn err(msg: &str) -> ApiError { (StatusCode::BAD_REQUEST, Json(ErrorResponse::new(msg))) } fn err_usage(msg: &str, usage: &str) -> ApiError { (StatusCode::BAD_REQUEST, Json(ErrorResponse::new(msg).with_usage(usage))) } +/// 操作执行超时:HTTP 408,提示调用方 Redis 操作占用资源过久而非配置错误 +fn query_timeout_response(secs: u64) -> ApiError { + (StatusCode::REQUEST_TIMEOUT, Json(ErrorResponse::new(&format!("操作超时(>{}s)", secs)))) +} + pub async fn run_cmd(State(state): State, Json(req): Json) -> Result, ApiError> { let (manager, logger) = state.as_ref(); let start = Instant::now(); @@ -78,14 +83,23 @@ pub async fn run_cmd(State(state): State, Json(req): Json) let conn_name = req.conn.clone(); let cmd_str = format!("{} {}", req.command, req.args.join(" ")); - let result: Result = tokio::task::spawn_blocking(move || { + let deadline = Duration::from_secs(manager.query_timeout_secs()); + let handle = tokio::task::spawn_blocking(move || -> Result { let (client, _) = mgr.get_conn(&conn_name).map_err(|e| err_usage(&e.to_string(), "Usage: POST /run {\"conn\": \"name\", \"command\": \"GET\", \"args\": [\"key\"]}"))?; let mut conn = client.get_connection().map_err(|e| err(&e.to_string()))?; let mut cmd = redis::cmd(&req.command); for arg in &req.args { cmd.arg(arg); } let val: redis::Value = cmd.query(&mut conn).map_err(|e| err(&e.to_string()))?; Ok(redis_value_to_json(&val)) - }).await.map_err(|_| err("Task join error"))?; + }); + + let result: Result = match tokio::time::timeout(deadline, handle).await { + Ok(joined) => joined.map_err(|_| err("Task join error"))?, + Err(_) => { + logger.log(&LogEntry::new("/run", "http").with_conn(&req.conn).with_command(&cmd_str).with_error(&format!("操作超时(>{}s)", deadline.as_secs()))); + return Err(query_timeout_response(deadline.as_secs())); + } + }; let result = result.map_err(|e| { let msg = &e.1.error; @@ -105,12 +119,21 @@ pub async fn get(State(state): State, Json(req): Json) -> let conn_name = req.conn.clone(); let key_name = req.key.clone(); - let value: Result, ApiError> = tokio::task::spawn_blocking(move || { + let deadline = Duration::from_secs(manager.query_timeout_secs()); + let handle = tokio::task::spawn_blocking(move || -> Result, ApiError> { let (client, _) = mgr.get_conn(&conn_name).map_err(|e| err(&e.to_string()))?; let mut conn = client.get_connection().map_err(|e| err(&e.to_string()))?; let val: Option = conn.get(&key_name).map_err(|e| err(&e.to_string()))?; Ok(val) - }).await.map_err(|_| err("Task join error"))?; + }); + + let value: Result, ApiError> = match tokio::time::timeout(deadline, handle).await { + Ok(joined) => joined.map_err(|_| err("Task join error"))?, + Err(_) => { + logger.log(&LogEntry::new("/get", "http").with_conn(&req.conn).with_command(&format!("GET {}", req.key)).with_error(&format!("操作超时(>{}s)", deadline.as_secs()))); + return Err(query_timeout_response(deadline.as_secs())); + } + }; let value = value.map_err(|e| { logger.log(&LogEntry::new("/get", "http").with_conn(&req.conn).with_command(&format!("GET {}", req.key)).with_error(&e.1.error)); @@ -131,7 +154,8 @@ pub async fn set(State(state): State, Json(req): Json) -> let value_str = req.value.clone(); let ttl = req.ttl; - let result: Result<(), ApiError> = tokio::task::spawn_blocking(move || { + let deadline = Duration::from_secs(manager.query_timeout_secs()); + let handle = tokio::task::spawn_blocking(move || -> Result<(), ApiError> { let (client, _) = mgr.get_conn(&conn_name).map_err(|e| err(&e.to_string()))?; let mut conn = client.get_connection().map_err(|e| err(&e.to_string()))?; if let Some(secs) = ttl { @@ -140,7 +164,15 @@ pub async fn set(State(state): State, Json(req): Json) -> conn.set::<_, _, ()>(&key_name, &value_str).map_err(|e| err(&e.to_string()))?; } Ok(()) - }).await.map_err(|_| err("Task join error"))?; + }); + + let result: Result<(), ApiError> = match tokio::time::timeout(deadline, handle).await { + Ok(joined) => joined.map_err(|_| err("Task join error"))?, + Err(_) => { + logger.log(&LogEntry::new("/set", "http").with_conn(&req.conn).with_command(&format!("SET {} {}", req.key, req.value)).with_error(&format!("操作超时(>{}s)", deadline.as_secs()))); + return Err(query_timeout_response(deadline.as_secs())); + } + }; result.map_err(|e| { logger.log(&LogEntry::new("/set", "http").with_conn(&req.conn).with_command(&format!("SET {} {}", req.key, req.value)).with_error(&e.1.error)); @@ -159,12 +191,21 @@ pub async fn del(State(state): State, Json(req): Json) -> let conn_name = req.conn.clone(); let del_keys = req.keys.clone(); - let deleted: Result = tokio::task::spawn_blocking(move || { + let deadline = Duration::from_secs(manager.query_timeout_secs()); + let handle = tokio::task::spawn_blocking(move || -> Result { let (client, _) = mgr.get_conn(&conn_name).map_err(|e| err(&e.to_string()))?; let mut conn = client.get_connection().map_err(|e| err(&e.to_string()))?; let count: u64 = conn.del(&del_keys).map_err(|e| err(&e.to_string()))?; Ok(count) - }).await.map_err(|_| err("Task join error"))?; + }); + + let deleted: Result = match tokio::time::timeout(deadline, handle).await { + Ok(joined) => joined.map_err(|_| err("Task join error"))?, + Err(_) => { + logger.log(&LogEntry::new("/del", "http").with_conn(&req.conn).with_command(&format!("DEL {}", req.keys.join(" "))).with_error(&format!("操作超时(>{}s)", deadline.as_secs()))); + return Err(query_timeout_response(deadline.as_secs())); + } + }; let deleted = deleted.map_err(|e| { logger.log(&LogEntry::new("/del", "http").with_conn(&req.conn).with_command(&format!("DEL {}", req.keys.join(" "))).with_error(&e.1.error)); @@ -183,12 +224,21 @@ pub async fn keys(State(state): State, Json(req): Json) - let conn_name = req.conn.clone(); let pattern = req.pattern.clone(); - let result: Result, ApiError> = tokio::task::spawn_blocking(move || { + let deadline = Duration::from_secs(manager.query_timeout_secs()); + let handle = tokio::task::spawn_blocking(move || -> Result, ApiError> { let (client, _) = mgr.get_conn(&conn_name).map_err(|e| err(&e.to_string()))?; let mut conn = client.get_connection().map_err(|e| err(&e.to_string()))?; let keys: Vec = conn.keys(&pattern).map_err(|e| err(&e.to_string()))?; Ok(keys) - }).await.map_err(|_| err("Task join error"))?; + }); + + let result: Result, ApiError> = match tokio::time::timeout(deadline, handle).await { + Ok(joined) => joined.map_err(|_| err("Task join error"))?, + Err(_) => { + logger.log(&LogEntry::new("/keys", "http").with_conn(&req.conn).with_command(&format!("KEYS {}", req.pattern)).with_error(&format!("操作超时(>{}s)", deadline.as_secs()))); + return Err(query_timeout_response(deadline.as_secs())); + } + }; let result = result.map_err(|e| { logger.log(&LogEntry::new("/keys", "http").with_conn(&req.conn).with_command(&format!("KEYS {}", req.pattern)).with_error(&e.1.error)); @@ -206,12 +256,21 @@ pub async fn info(State(state): State, Json(req): Json) - let mgr = manager.clone(); let conn_name = req.conn.clone(); - let info: Result = tokio::task::spawn_blocking(move || { + let deadline = Duration::from_secs(manager.query_timeout_secs()); + let handle = tokio::task::spawn_blocking(move || -> Result { let (client, _) = mgr.get_conn(&conn_name).map_err(|e| err(&e.to_string()))?; let mut conn = client.get_connection().map_err(|e| err(&e.to_string()))?; let info: String = redis::cmd("INFO").query(&mut conn).map_err(|e| err(&e.to_string()))?; Ok(info) - }).await.map_err(|_| err("Task join error"))?; + }); + + let info: Result = match tokio::time::timeout(deadline, handle).await { + Ok(joined) => joined.map_err(|_| err("Task join error"))?, + Err(_) => { + logger.log(&LogEntry::new("/info", "http").with_conn(&req.conn).with_command("INFO").with_error(&format!("操作超时(>{}s)", deadline.as_secs()))); + return Err(query_timeout_response(deadline.as_secs())); + } + }; let info = info.map_err(|e| { logger.log(&LogEntry::new("/info", "http").with_conn(&req.conn).with_command("INFO").with_error(&e.1.error)); diff --git a/redis-proxy/src/logger.rs b/redis-proxy/src/logger.rs index 8d4cc5a..51ffefc 100644 --- a/redis-proxy/src/logger.rs +++ b/redis-proxy/src/logger.rs @@ -63,7 +63,7 @@ impl LogEntry { } } pub fn with_conn(mut self, conn: &str) -> Self { self.conn = Some(conn.to_string()); self } - pub fn with_command(mut self, cmd: &str) -> Self { self.command = Some(truncate_string(cmd, 500)); self } + pub fn with_command(mut self, cmd: &str) -> Self { self.command = Some(truncate_string(cmd, 2000)); self } pub fn with_duration(mut self, ms: u64) -> Self { self.duration_ms = ms; if ms > 5000 && self.level == "INFO" { self.level = "ERROR".to_string(); } diff --git a/redis-proxy/src/main.rs b/redis-proxy/src/main.rs index 927be4c..b1091f0 100644 --- a/redis-proxy/src/main.rs +++ b/redis-proxy/src/main.rs @@ -8,6 +8,17 @@ use axum::{routing::{get, post}, Router}; use clap::{Parser, Subcommand}; use std::sync::Arc; +// ⚠ 共享实现,修改需同步至 mysql/mongo/ssh-proxy/src/main.rs +/// 默认请求日志路径(未设置 REDIS_PROXY_LOG 时): exe同目录 logs/redis-proxy.log +fn default_log_path(name: &str) -> String { + match std::env::current_exe() { + Ok(exe) => exe.parent() + .map(|d| d.join("logs").join(format!("{}.log", name)).to_string_lossy().into_owned()) + .unwrap_or_else(|| format!("{}.log", name)), + Err(_) => format!("{}.log", name), + } +} + #[derive(Parser, Debug)] #[command(name = "redis-proxy")] #[command(about = "Redis HTTP proxy with connection pooling")] @@ -31,18 +42,55 @@ enum Commands { Connections, } +// ⚠ 共享实现,修改需同步至 mysql/ssh/mongo-proxy/src/main.rs +/// 将相对路径基于可执行文件所在目录解析为绝对路径 +fn resolve_config_path(path: &str) -> String { + if std::path::Path::new(path).is_absolute() || path.starts_with('~') { + return path.to_string(); + } + match std::env::current_exe() { + Ok(exe) => { + if let Some(dir) = exe.parent() { + dir.join(path).to_string_lossy().into_owned() + } else { + path.to_string() + } + } + Err(_) => path.to_string(), + } +} + #[tokio::main] async fn main() -> anyhow::Result<()> { let args = Args::parse(); + let config_path = resolve_config_path(&args.config); match args.command { - Some(Commands::Server { port, host }) => run_server(&args.config, port, host).await, - Some(Commands::Run { conn, command, args: ref keys }) => { let c = get_cli(&args.server)?; Ok(c.run(&conn, &command, keys)?) }, - Some(Commands::Get { conn, key }) => { let c = get_cli(&args.server)?; Ok(c.get(&conn, &key)?) }, - Some(Commands::Set { conn, key, value, ttl }) => { let c = get_cli(&args.server)?; Ok(c.set(&conn, &key, &value, ttl)?) }, - Some(Commands::Del { conn, key: ref keys }) => { let c = get_cli(&args.server)?; Ok(c.del(&conn, keys)?) }, - Some(Commands::Keys { conn, pattern }) => { let c = get_cli(&args.server)?; Ok(c.keys(&conn, &pattern)?) }, - Some(Commands::Connections) => { let c = get_cli(&args.server)?; Ok(c.list_connections()?) }, - None => run_server(&args.config, None, None).await, + Some(Commands::Server { port, host }) => run_server(&config_path, port, host).await, + Some(Commands::Run { conn, command, args: ref keys }) => { + let c = get_cli(&args.server)?; + Ok(c.run(&conn, &command, keys)?) + } + Some(Commands::Get { conn, key }) => { + let c = get_cli(&args.server)?; + Ok(c.get(&conn, &key)?) + } + Some(Commands::Set { conn, key, value, ttl }) => { + let c = get_cli(&args.server)?; + Ok(c.set(&conn, &key, &value, ttl)?) + } + Some(Commands::Del { conn, key: ref keys }) => { + let c = get_cli(&args.server)?; + Ok(c.del(&conn, keys)?) + } + Some(Commands::Keys { conn, pattern }) => { + let c = get_cli(&args.server)?; + Ok(c.keys(&conn, &pattern)?) + } + Some(Commands::Connections) => { + let c = get_cli(&args.server)?; + Ok(c.list_connections()?) + } + None => run_server(&config_path, None, None).await, } } @@ -61,7 +109,8 @@ async fn run_server(config_path: &str, port: Option, host: Option) if let Some(port) = port { config.server.port = port; } if let Some(host) = host { config.server.host = host; } - let log_path = std::env::var("REDIS_PROXY_LOG").ok(); + let log_path = std::env::var("REDIS_PROXY_LOG").ok() + .or_else(|| Some(default_log_path("redis-proxy"))); let logger = Arc::new(logger::RequestLogger::new(log_path.as_deref())); if logger.is_enabled() { println!("Request logging: enabled"); } diff --git a/ssh-proxy/Cargo.lock b/ssh-proxy/Cargo.lock new file mode 100644 index 0000000..219a18d --- /dev/null +++ b/ssh-proxy/Cargo.lock @@ -0,0 +1,3023 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "adler2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" + +[[package]] +name = "aead" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" +dependencies = [ + "crypto-common", + "generic-array", +] + +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + +[[package]] +name = "aes-gcm" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1" +dependencies = [ + "aead", + "aes", + "cipher", + "ctr", + "ghash", + "subtle", +] + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anstream" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" + +[[package]] +name = "anstyle-parse" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" +dependencies = [ + "anstyle", + "once_cell_polyfill", + "windows-sys 0.61.2", +] + +[[package]] +name = "anyhow" +version = "1.0.103" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a4385e2e34eb35d6b3efe798b9eb88096925d87726c0798709bf56d9ed84af3" + +[[package]] +name = "argon2" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c3610892ee6e0cbce8ae2700349fcf8f98adb0dbfbee85aec3c9179d29cc072" +dependencies = [ + "base64ct", + "blake2", + "cpufeatures", + "password-hash", +] + +[[package]] +name = "async-trait" +version = "0.1.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "autocfg" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" + +[[package]] +name = "axum" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edca88bc138befd0323b20752846e6587272d3b03b0343c8ea28a6f819e6e71f" +dependencies = [ + "async-trait", + "axum-core", + "bytes", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-util", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "serde_json", + "serde_path_to_error", + "serde_urlencoded", + "sync_wrapper", + "tokio", + "tower", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "axum-core" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199" +dependencies = [ + "async-trait", + "bytes", + "futures-util", + "http", + "http-body", + "http-body-util", + "mime", + "pin-project-lite", + "rustversion", + "sync_wrapper", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "base64ct" +version = "1.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06" + +[[package]] +name = "bcrypt-pbkdf" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6aeac2e1fe888769f34f05ac343bbef98b14d1ffb292ab69d4608b3abc86f2a2" +dependencies = [ + "blowfish", + "pbkdf2", + "sha2", +] + +[[package]] +name = "bit-vec" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" + +[[package]] +name = "bitflags" +version = "2.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4388bee8683e3d04af747c73422af53102d2bd24d9eadb6cbc100baef4b43f8" +dependencies = [ + "serde_core", +] + +[[package]] +name = "blake2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" +dependencies = [ + "digest", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block-padding" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8894febbff9f758034a5b8e12d87918f56dfc64a8e1fe757d65e29041538d93" +dependencies = [ + "generic-array", +] + +[[package]] +name = "blowfish" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e412e2cd0f2b2d93e02543ceae7917b3c70331573df19ee046bcbc35e45e87d7" +dependencies = [ + "byteorder", + "cipher", +] + +[[package]] +name = "bumpalo" +version = "3.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ae3f5d315924270530207e2a68396c3cc547f6dca3fbdca317cfb1a51edb593" + +[[package]] +name = "cbc" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b52a9543ae338f279b96b0b9fed9c8093744685043739079ce85cd58f289a6" +dependencies = [ + "cipher", +] + +[[package]] +name = "cc" +version = "1.2.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5d6cac793997bd970000024b2934968efe83b382de4fdcf4fcb46b6ee4ad996" +dependencies = [ + "find-msvc-tools", + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "chacha20" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + +[[package]] +name = "chrono" +version = "0.4.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aa79e62e7697b8e29b513a68abacf485adcd1fe8284a4316c5ae868e6633327" +dependencies = [ + "iana-time-zone", + "js-sys", + "num-traits", + "wasm-bindgen", + "windows-link", +] + +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "clap" +version = "4.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ddb117e43bbf7dacf0a4190fef4d345b9bad68dfc649cb349e7d17d28428e51" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "714a53001bf66416adb0e2ef5ac857140e7dc3a0c48fb28b2f10762fc4b5069f" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2ce8604710f6733aa641a2b3731eaa1e8b3d9973d5e3565da11800813f997a9" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" + +[[package]] +name = "colorchoice" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61803da095bee82a81bb1a452ecc25d3b2f1416d1897eb86430c6159ef717c17" + +[[package]] +name = "crypto-bigint" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "generic-array", + "rand_core", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-common" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" +dependencies = [ + "generic-array", + "rand_core", + "typenum", +] + +[[package]] +name = "ctr" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" +dependencies = [ + "cipher", +] + +[[package]] +name = "curve25519-dalek" +version = "4.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" +dependencies = [ + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest", + "fiat-crypto", + "rustc_version", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "dashmap" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6361d5c062261c78a176addb82d4c821ae42bed6089de0e12603cd25de2059c" +dependencies = [ + "cfg-if", + "crossbeam-utils", + "hashbrown 0.14.5", + "lock_api", + "once_cell", + "parking_lot_core", +] + +[[package]] +name = "data-encoding" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4ae5f15dda3c708c0ade84bfee31ccab44a3da4f88015ed22f63732abe300c8" + +[[package]] +name = "delegate" +version = "0.13.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "780eb241654bf097afb00fc5f054a09b687dad862e485fdcf8399bb056565370" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "der" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb" +dependencies = [ + "const-oid", + "pem-rfc7468", + "zeroize", +] + +[[package]] +name = "deranged" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c" + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "displaydoc" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ac70aa55017e108007fbaf5aa0f54b021c98f92ff8af59d42eda9da96e3dd4f" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "ecdsa" +version = "0.16.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +dependencies = [ + "der", + "digest", + "elliptic-curve", + "rfc6979", + "signature", + "spki", +] + +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "pkcs8", + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70e796c081cee67dc755e1a36a0a172b897fab85fc3f6bc48307991f64e4eca9" +dependencies = [ + "curve25519-dalek", + "ed25519", + "rand_core", + "serde", + "sha2", + "subtle", + "zeroize", +] + +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "hkdf", + "pem-rfc7468", + "pkcs8", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + +[[package]] +name = "enum_dispatch" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa18ce2bc66555b3218614519ac839ddb759a7d6720732f979ef8d13be147ecd" +dependencies = [ + "once_cell", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "ff" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" +dependencies = [ + "rand_core", + "subtle", +] + +[[package]] +name = "fiat-crypto" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + +[[package]] +name = "find-msvc-tools" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" + +[[package]] +name = "flate2" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "843fba2746e448b37e26a819579957415c8cef339bf08564fe8b7ddbd959573c" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "form_urlencoded" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b147ee9d1f6d097cef9ce628cd2ee62288d963e16fb287bd9286455b241382d" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" + +[[package]] +name = "futures-executor" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf29c38818342a3b26b5b923639e7b1f4a61fc5e76102d4b1981c6dc7a7579d" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718" + +[[package]] +name = "futures-macro" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-sink" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893" + +[[package]] +name = "futures-task" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" + +[[package]] +name = "futures-util" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "getrandom" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi", + "wasm-bindgen", +] + +[[package]] +name = "ghash" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0d8a4362ccb29cb0b265253fb0a2728f592895ee6854fd9bc13f2ffda266ff1" +dependencies = [ + "opaque-debug", + "polyval", +] + +[[package]] +name = "gloo-timers" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "482ce8a491a501da4cd806bd190275363d674f2845005c6ddbd5d3e1dd54495d" +dependencies = [ + "futures-channel", + "futures-core", + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", +] + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" + +[[package]] +name = "hashbrown" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "home" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" +dependencies = [ + "windows-sys 0.48.0", +] + +[[package]] +name = "http" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6970f50e31d6fc17d3fa27329444bfa74e196cf62e95052a3f6fee181dba6425" +dependencies = [ + "bytes", + "itoa", +] + +[[package]] +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "hyper" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55281c53a1894c864990125767da440a4e630446785086f52523b20033b74498" +dependencies = [ + "atomic-waker", + "bytes", + "futures-channel", + "futures-core", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", +] + +[[package]] +name = "hyper-util" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" +dependencies = [ + "bytes", + "http", + "http-body", + "hyper", + "pin-project-lite", + "tokio", + "tower-service", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "log", + "wasm-bindgen", + "windows-core 0.62.2", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "icu_collections" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2984d1cd16c883d7935b9e07e44071dca8d917fd52ecc02c04d5fa0b5a3f191c" +dependencies = [ + "displaydoc", + "potential_utf", + "utf8_iter", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92219b62b3e2b4d88ac5119f8904c10f8f61bf7e95b640d25ba3075e6cac2c29" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c56e5ee99d6e3d33bd91c5d85458b6005a22140021cc324cea84dd0e72cff3b4" +dependencies = [ + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da3be0ae77ea334f4da67c12f149704f19f81d1adf7c51cf482943e84a2bad38" + +[[package]] +name = "icu_properties" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bee3b67d0ea5c2cca5003417989af8996f8604e34fb9ddf96208a033901e70de" +dependencies = [ + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e2bbb201e0c04f7b4b3e14382af113e17ba4f63e2c9d2ee626b720cbce54a14" + +[[package]] +name = "icu_provider" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "139c4cf31c8b5f33d7e199446eff9c1e02decfc2f0eec2c8d71f65befa45b421" +dependencies = [ + "displaydoc", + "icu_locale_core", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "idna" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "indexmap" +version = "2.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" +dependencies = [ + "equivalent", + "hashbrown 0.17.1", +] + +[[package]] +name = "inout" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" +dependencies = [ + "block-padding", + "generic-array", +] + +[[package]] +name = "internal-russh-forked-ssh-key" +version = "0.6.9+upstream-0.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5af01d366561582e9ea5f841837cc1d8e37e7142a32f33a43801e81863cba5" +dependencies = [ + "argon2", + "bcrypt-pbkdf", + "ecdsa", + "ed25519-dalek", + "hex", + "hmac", + "num-bigint-dig", + "p256", + "p384", + "p521", + "rand_core", + "rsa", + "sec1", + "sha1", + "sha2", + "signature", + "ssh-cipher", + "ssh-encoding", + "subtle", + "zeroize", +] + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" + +[[package]] +name = "itoa" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" + +[[package]] +name = "js-sys" +version = "0.3.103" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53b44bfcdb3f8d5837a46dae1ca9660a837176eee74a28b229bc626816589102" +dependencies = [ + "cfg-if", + "futures-util", + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +dependencies = [ + "spin", +] + +[[package]] +name = "libc" +version = "0.2.186" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" + +[[package]] +name = "libm" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" + +[[package]] +name = "litemap" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0" + +[[package]] +name = "lock_api" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ceec5bc11778974d1bcb055b18002eba7f4b3518b6a0081b3af5f21666da9ad" + +[[package]] +name = "matchit" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" + +[[package]] +name = "md5" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771" + +[[package]] +name = "memchr" +version = "2.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "miniz_oxide" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" +dependencies = [ + "adler2", + "simd-adler32", +] + +[[package]] +name = "mio" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02bd0af71c67b473010cbbc60715ee815645a4dc942899111f494b4b737d6fda" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.61.2", +] + +[[package]] +name = "num-bigint" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c89e69e7e0f03bea5ef08013795c25018e101932225a656383bd384495ecc367" +dependencies = [ + "num-integer", + "num-traits", + "rand", +] + +[[package]] +name = "num-bigint-dig" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e661dda6640fad38e827a6d4a310ff4763082116fe217f279885c97f511bb0b7" +dependencies = [ + "lazy_static", + "libm", + "num-integer", + "num-iter", + "num-traits", + "rand", + "smallvec", + "zeroize", +] + +[[package]] +name = "num-conv" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "521739c6d2bac4aa25192232afe6841231376b2b26d4d9fae5ecf8ca5772e441" + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c92800bd69a1eac91786bcfe9da64a897eb72911b8dc3095decbd07429e8048b" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", + "libm", +] + +[[package]] +name = "once_cell" +version = "1.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" + +[[package]] +name = "once_cell_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" + +[[package]] +name = "opaque-debug" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" + +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2", +] + +[[package]] +name = "p384" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe42f1670a52a47d448f14b6a5c61dd78fce51856e68edaa38f7ae3a46b8d6b6" +dependencies = [ + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2", +] + +[[package]] +name = "p521" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fc9e2161f1f215afdfce23677034ae137bbd45016a880c2eb3ba8eb95f085b2" +dependencies = [ + "base16ct", + "ecdsa", + "elliptic-curve", + "primeorder", + "rand_core", + "sha2", +] + +[[package]] +name = "pageant" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c6f0e349ea8dea1b50aa17c082777d30df133d89898c7568a615354772d3731" +dependencies = [ + "bytes", + "delegate", + "futures", + "log", + "rand", + "thiserror 1.0.69", + "tokio", + "windows", +] + +[[package]] +name = "parking_lot" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-link", +] + +[[package]] +name = "password-hash" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "346f04948ba92c43e8469c1ee6736c7563d71012b17d40745260fe106aac2166" +dependencies = [ + "base64ct", + "rand_core", + "subtle", +] + +[[package]] +name = "pbkdf2" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" +dependencies = [ + "digest", + "hmac", +] + +[[package]] +name = "pem-rfc7468" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" +dependencies = [ + "base64ct", +] + +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + +[[package]] +name = "pin-project-lite" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" + +[[package]] +name = "pkcs1" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f" +dependencies = [ + "der", + "pkcs8", + "spki", +] + +[[package]] +name = "pkcs5" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e847e2c91a18bfa887dd028ec33f2fe6f25db77db3619024764914affe8b69a6" +dependencies = [ + "aes", + "cbc", + "der", + "pbkdf2", + "scrypt", + "sha2", + "spki", +] + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "pkcs5", + "rand_core", + "spki", +] + +[[package]] +name = "poly1305" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf" +dependencies = [ + "cpufeatures", + "opaque-debug", + "universal-hash", +] + +[[package]] +name = "polyval" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1fe60d06143b2430aa532c94cfe9e29783047f06c0d7fd359a9a51b729fa25" +dependencies = [ + "cfg-if", + "cpufeatures", + "opaque-debug", + "universal-hash", +] + +[[package]] +name = "potential_utf" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0103b1cef7ec0cf76490e969665504990193874ea05c85ff9bab8b911d0a0564" +dependencies = [ + "zerovec", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] + +[[package]] +name = "proc-macro2" +version = "1.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfbc457d0c7a0759a614551b11a6409e5951f6c7537be1f1b7682b9ae9230368" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca0ecfa931c29007047d1bc58e623ab12e5590e8c7cc53200d5202b69266d8a" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "redox_syscall" +version = "0.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" +dependencies = [ + "bitflags", +] + +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac", + "subtle", +] + +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if", + "getrandom", + "libc", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "rsa" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8573f03f5883dcaebdfcf4725caa1ecb9c15b2ef50c43a07b816e06799bb12d" +dependencies = [ + "const-oid", + "digest", + "num-bigint-dig", + "num-integer", + "num-traits", + "pkcs1", + "pkcs8", + "rand_core", + "sha2", + "signature", + "spki", + "subtle", + "zeroize", +] + +[[package]] +name = "russh" +version = "0.50.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02d8075561703e70dab7b095b2c13597cde37f5be94af0849fa4e51c315020d0" +dependencies = [ + "aes", + "aes-gcm", + "bitflags", + "block-padding", + "byteorder", + "bytes", + "cbc", + "chacha20", + "ctr", + "curve25519-dalek", + "data-encoding", + "delegate", + "der", + "digest", + "ecdsa", + "ed25519-dalek", + "elliptic-curve", + "enum_dispatch", + "flate2", + "futures", + "generic-array", + "getrandom", + "hex-literal", + "hmac", + "home", + "inout", + "internal-russh-forked-ssh-key", + "log", + "md5", + "num-bigint", + "once_cell", + "p256", + "p384", + "p521", + "pageant", + "pbkdf2", + "pkcs1", + "pkcs5", + "pkcs8", + "poly1305", + "rand", + "rand_core", + "rsa", + "russh-cryptovec 0.50.2", + "russh-util 0.50.0", + "sec1", + "sha1", + "sha2", + "signature", + "spki", + "ssh-encoding", + "subtle", + "thiserror 1.0.69", + "tokio", + "tokio-stream", + "typenum", + "yasna", + "zeroize", +] + +[[package]] +name = "russh-cryptovec" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d8e7e854e1a87e4be00fa287c98cad23faa064d0464434beaa9f014ec3baa98" +dependencies = [ + "libc", + "ssh-encoding", + "winapi", +] + +[[package]] +name = "russh-cryptovec" +version = "0.50.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fcb7c127135848b47715b5bcb13d8a27ccd86ce1de1c15eab5982df91fe279a" +dependencies = [ + "libc", + "log", + "ssh-encoding", + "winapi", +] + +[[package]] +name = "russh-keys" +version = "0.50.0-beta.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cab59c210761d61033340a3c72dd6983db1eb27769659351d566bdde9fa8d620" +dependencies = [ + "aes", + "async-trait", + "block-padding", + "byteorder", + "bytes", + "cbc", + "ctr", + "data-encoding", + "der", + "digest", + "ecdsa", + "ed25519-dalek", + "elliptic-curve", + "futures", + "getrandom", + "hmac", + "home", + "inout", + "internal-russh-forked-ssh-key", + "log", + "md5", + "num-integer", + "p256", + "p384", + "p521", + "pageant", + "pbkdf2", + "pkcs1", + "pkcs5", + "pkcs8", + "rand", + "rand_core", + "rsa", + "russh-cryptovec 0.48.0", + "russh-util 0.48.0", + "sec1", + "serde", + "sha1", + "sha2", + "signature", + "spki", + "ssh-encoding", + "thiserror 1.0.69", + "tokio", + "tokio-stream", + "typenum", + "zeroize", +] + +[[package]] +name = "russh-sftp" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed8949eca4163c18a8f59ff96d32cf61e9c13b9735e21ef32b3907f4aafa1a9" +dependencies = [ + "bitflags", + "bytes", + "chrono", + "dashmap", + "gloo-timers", + "log", + "serde", + "serde_bytes", + "thiserror 2.0.18", + "tokio", + "tokio-util", + "wasm-bindgen-futures", +] + +[[package]] +name = "russh-util" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92c7dd577958c0cefbc8f8a2c05c48c88c42e2fdb760dbe9b96ae31d4de97a1f" +dependencies = [ + "chrono", + "tokio", + "wasm-bindgen", + "wasm-bindgen-futures", +] + +[[package]] +name = "russh-util" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c698d702527b51a82e64de98d506e9c1e83a063035d41df4f2354499ec090b79" +dependencies = [ + "chrono", + "tokio", + "wasm-bindgen", + "wasm-bindgen-futures", +] + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "rustls" +version = "0.23.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b92b125634d9b795e7beca796cc790df15a7fb38323bf3196fda83292d06b1f" +dependencies = [ + "log", + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-pki-types" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "764899a24af3980067ee14bc143654f297b22eaebfe3c7b6b211920a5a59b046" +dependencies = [ + "zeroize", +] + +[[package]] +name = "rustls-webpki" +version = "0.103.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61c429a8649f110dddef65e2a5ad240f747e85f7758a6bccc7e5777bd33f756e" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "rustversion" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f" + +[[package]] +name = "ryu" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" + +[[package]] +name = "salsa20" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97a22f5af31f73a954c10289c93e8a50cc23d971e80ee446f1f6f7137a088213" +dependencies = [ + "cipher", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "scrypt" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0516a385866c09368f0b5bcd1caff3366aace790fcd46e2bb032697bb172fd1f" +dependencies = [ + "pbkdf2", + "salsa20", + "sha2", +] + +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "pkcs8", + "subtle", + "zeroize", +] + +[[package]] +name = "semver" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_bytes" +version = "0.11.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5d440709e79d88e51ac01c4b72fc6cb7314017bb7da9eeff678aa94c10e3ea8" +dependencies = [ + "serde", + "serde_core", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.150" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8014e44b4736ed0538adeecded0fce2a272f22dc9578a7eb6b2d9993c74cfb9" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "serde_path_to_error" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10a9ff822e371bb5403e391ecd83e182e0e77ba7f6fe0160b795797109d1b457" +dependencies = [ + "itoa", + "serde", + "serde_core", +] + +[[package]] +name = "serde_spanned" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha1" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "shlex" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" + +[[package]] +name = "signal-hook-registry" +version = "1.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" +dependencies = [ + "errno", + "libc", +] + +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest", + "rand_core", +] + +[[package]] +name = "simd-adler32" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "703d5c7ef118737c72f1af64ad2f6f8c5e1921f818cdcb97b8fe6fc69bf66214" + +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + +[[package]] +name = "smallvec" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ed6a63f02c8539c91a8685a86f4099661ba3da017932f6ebbea6de3f0fa7c90" + +[[package]] +name = "socket2" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52d1cfed4120b4d927bf7c0f86d2087a4a7d6027c906d9f9d525a80573b9be51" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "ssh-cipher" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "caac132742f0d33c3af65bfcde7f6aa8f62f0e991d80db99149eb9d44708784f" +dependencies = [ + "aes", + "aes-gcm", + "cbc", + "chacha20", + "cipher", + "ctr", + "poly1305", + "ssh-encoding", + "subtle", +] + +[[package]] +name = "ssh-encoding" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb9242b9ef4108a78e8cd1a2c98e193ef372437f8c22be363075233321dd4a15" +dependencies = [ + "base64ct", + "bytes", + "pem-rfc7468", + "sha2", +] + +[[package]] +name = "ssh-proxy" +version = "0.2.0" +dependencies = [ + "anyhow", + "axum", + "clap", + "russh", + "russh-keys", + "russh-sftp", + "serde", + "serde_json", + "time", + "tokio", + "toml", + "ureq", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "2.0.118" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9ae57f904213ebb649ce6895b8a66c66f0203b9319718f69a5612a065b1422" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" + +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" +dependencies = [ + "thiserror-impl 2.0.18", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "time" +version = "0.3.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18dfaaeddcb932337b5e7866ee7d0ce9b76d2fd092997146f187ec09b4558a50" +dependencies = [ + "deranged", + "num-conv", + "powerfmt", + "serde_core", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1c906769ad99c88eaa54e728060edef082f8e358ff32030cb7c7d315e81109" + +[[package]] +name = "time-macros" +version = "0.2.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c431b87111666e491a90baa837f914fb45cd5dc3c268591b0220ff5057f2085f" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tinystr" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8323304221c2a851516f22236c5722a72eaa19749016521d6dff0824447d96d" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tokio" +version = "1.52.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc7f01b389ac15039e4dc9531aa973a135d7a4135281b12d7c1bc79fd57fffe" +dependencies = [ + "bytes", + "libc", + "mio", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.61.2", +] + +[[package]] +name = "tokio-macros" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "385a6cb71ab9ab790c5fe8d67f1645e6c450a7ce006a33de03daa956cf70a496" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-stream" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32da49809aab5c3bc678af03902d4ccddea2a87d028d86392a4b1560c6906c70" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", + "tokio-util", +] + +[[package]] +name = "tokio-util" +version = "0.7.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "futures-util", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "toml" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.22.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "toml_write", + "winnow", +] + +[[package]] +name = "toml_write" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" + +[[package]] +name = "tower" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper", + "tokio", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + +[[package]] +name = "tracing" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" +dependencies = [ + "log", + "pin-project-lite", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "typenum" +version = "1.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20" + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + +[[package]] +name = "universal-hash" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" +dependencies = [ + "crypto-common", + "subtle", +] + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "ureq" +version = "2.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02d1a66277ed75f640d608235660df48c8e3c19f3b4edb6a263315626cc3c01d" +dependencies = [ + "base64", + "flate2", + "log", + "once_cell", + "rustls", + "rustls-pki-types", + "url", + "webpki-roots 0.26.11", +] + +[[package]] +name = "url" +version = "2.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasm-bindgen" +version = "0.2.126" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b067c0c11094aef6b7a801c1e34a26affafdf3d051dba08456b868789aaf9a4" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.76" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c62df1340f32221cb9c54d6a27b030e3dba64361d4a95bed55f9aacb44da291d" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.126" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "167ce5e579f6bcf889c4f7175a8a5a585de84e8ff93976ce393efa5f2837aab1" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.126" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3997c7839262f4ef12cf90b818d6340c18e80f263f1a94bf157d0ec4420380e" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.126" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc1b4cb0cc549fcf58d7dfc081778139b3d283a081644e833e84682ad71cea24" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "webpki-roots" +version = "0.26.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "521bc38abb08001b01866da9f51eb7c5d647a19260e00054a8c7fd5f9e57f7a9" +dependencies = [ + "webpki-roots 1.0.8", +] + +[[package]] +name = "webpki-roots" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf85cb06032201fa7c6f829d7db5a7e5aa45bcc0655327713065f6f0576731bf" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6" +dependencies = [ + "windows-core 0.58.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99" +dependencies = [ + "windows-implement 0.58.0", + "windows-interface 0.58.0", + "windows-result 0.2.0", + "windows-strings 0.1.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" +dependencies = [ + "windows-implement 0.60.2", + "windows-interface 0.59.3", + "windows-link", + "windows-result 0.4.1", + "windows-strings 0.5.1", +] + +[[package]] +name = "windows-implement" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-implement" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.59.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-result" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result 0.2.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-strings" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "winnow" +version = "0.7.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df79d97927682d2fd8adb29682d1140b343be4ac0f08fd68b7765d9c059d3945" +dependencies = [ + "memchr", +] + +[[package]] +name = "writeable" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4" + +[[package]] +name = "yasna" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e17bb3549cc1321ae1296b9cdc2698e2b6cb1992adfa19a8c72e5b7a738f44cd" +dependencies = [ + "bit-vec", + "num-bigint", +] + +[[package]] +name = "yoke" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "709fe23a0424b6a435d82152b1bd3fdfb0833487d5fa90d05d42762a9891fef5" +dependencies = [ + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.8.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75726053136156d419e285b9b7eddaaea9e3fea6ce32eed44a89901f0bd98de1" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4714fd92cf900833d49538023a9b3915155210801d1c1169eba513b2addefd71" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zerofrom" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ec05a11813ea801ff6d75110ad09cd0824ddba17dfe17128ea0d5f68e6c5272" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13c156562582aa81c60cb29407084cdb54c4164760106ab78e6c5b0858cf64e" + +[[package]] +name = "zerotrie" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f9152d31db0792fa83f70fb2f83148effb5c1f5b8c7686c3459e361d9bc20bf" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90f911cbc359ab6af17377d242225f4d75119aec87ea711a880987b18cd7b239" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zmij" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" diff --git a/ssh-proxy/Cargo.toml b/ssh-proxy/Cargo.toml index d2bc97f..4f88700 100644 --- a/ssh-proxy/Cargo.toml +++ b/ssh-proxy/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ssh-proxy" -version = "0.1.0" +version = "0.2.0" edition = "2021" description = "SSH HTTP proxy with session pooling" diff --git a/ssh-proxy/src/cli.rs b/ssh-proxy/src/cli.rs index 3530265..17799ac 100644 --- a/ssh-proxy/src/cli.rs +++ b/ssh-proxy/src/cli.rs @@ -76,12 +76,28 @@ impl Cli { } /// 执行远程命令 - pub fn exec(&self, server: &str, command: &str, format: &str) -> Result<()> { + pub fn exec(&self, server: &str, command: &str, format: &str, bg: bool) -> Result<()> { let start = Instant::now(); + // --bg: nohup 断流拉起远端长命令, 立即返回日志路径(防 exec 会话超时连带杀进程) + let command = if bg { + let ts = std::time::SystemTime::now() + .duration_since(std::time::UNIX_EPOCH) + .map(|d| d.as_secs()) + .unwrap_or(0); + format!( + "nohup sh -c {} > /tmp/sshproxy-bg-{}.log 2>&1 < /dev/null & echo BG-STARTED pid=$! log=/tmp/sshproxy-bg-{}.log", + Self::sh_quote(command), + ts, + ts + ) + } else { + command.to_string() + }; + let body = serde_json::to_string(&ExecRequest { server: server.to_string(), - command: command.to_string(), + command, })?; let response = ureq::post(&format!("{}/exec", self.server)) @@ -232,6 +248,11 @@ impl Cli { } } + /// sh 单引号转义标准实现: ' -> '\'' (关闭引号+转义引号+重开引号) + fn sh_quote(s: &str) -> String { + format!("'{}'", s.replace('\'', r"'\''")) + } + /// 上传文件到远程服务器 pub fn upload(&self, server: &str, local_path: &str, remote_path: &str, concurrency: usize) -> Result<()> { let body = serde_json::to_string(&UploadRequest { diff --git a/ssh-proxy/src/config.rs b/ssh-proxy/src/config.rs index d89b4dc..270496d 100644 --- a/ssh-proxy/src/config.rs +++ b/ssh-proxy/src/config.rs @@ -21,16 +21,21 @@ pub struct PoolConfig { pub idle_timeout_secs: u64, #[serde(default = "default_check_interval")] pub check_interval_secs: u64, + /// 单次 exec/upload/download 执行上限(秒):超时返回 408,防远端命令挂死通道 + #[serde(default = "default_exec_timeout")] + pub exec_timeout_secs: u64, } -fn default_idle_timeout() -> u64 { 300 } +fn default_idle_timeout() -> u64 { 1800 } fn default_check_interval() -> u64 { 60 } +fn default_exec_timeout() -> u64 { 600 } impl Default for PoolConfig { fn default() -> Self { Self { idle_timeout_secs: default_idle_timeout(), check_interval_secs: default_check_interval(), + exec_timeout_secs: default_exec_timeout(), } } } diff --git a/ssh-proxy/src/handler.rs b/ssh-proxy/src/handler.rs index 44485e2..b4009d9 100644 --- a/ssh-proxy/src/handler.rs +++ b/ssh-proxy/src/handler.rs @@ -82,11 +82,15 @@ pub async fn exec( let result = manager.exec(&req.server, &req.command).await .map_err(|e| { logger.log(&LogEntry::new("/exec", "http").with_server(&req.server).with_command(&req.command).with_error(&e.to_string())); + // 执行超时(远端命令挂死/超 deadline)返回 408,与参数错(400)区分 + if e.to_string().starts_with("EXEC_TIMED_OUT") { + return (StatusCode::REQUEST_TIMEOUT, Json(ErrorResponse::new(&e.to_string()))); + } let usage = format!( "Usage: POST /exec {{\"server\": \"server_name\", \"command\": \"your command\"}}\n\nAvailable servers: {}", server_names ); - error_response_with_usage(&e.to_string(), &usage) + manager_error(manager, &req.server, &e.to_string(), usage) })?; let duration_ms = start.elapsed().as_millis() as u64; @@ -113,6 +117,45 @@ pub async fn servers( Json(ServersResponse { servers: manager.list_servers() }) } +#[derive(Debug, Serialize)] +pub struct EndpointDoc { + pub method: &'static str, + pub path: &'static str, + pub desc: &'static str, + #[serde(skip_serializing_if = "Option::is_none")] + pub request: Option<&'static str>, +} + +#[derive(Debug, Serialize)] +pub struct HelpResponse { + pub service: &'static str, + pub version: &'static str, + pub endpoints: Vec, + pub notes: Vec<&'static str>, +} + +/// GET /_help - self-describing API guide for AI agents and humans. +pub async fn help() -> Json { + Json(HelpResponse { + service: "ssh-proxy", + version: env!("CARGO_PKG_VERSION"), + endpoints: vec![ + EndpointDoc { method: "GET", path: "/_help", desc: "API guide (this)", request: None }, + EndpointDoc { method: "GET", path: "/health", desc: "Health check", request: None }, + EndpointDoc { method: "GET", path: "/servers", desc: "List configured servers (name/host/port/user/status)", request: None }, + EndpointDoc { method: "POST", path: "/exec", desc: "Execute remote command", request: Some(r#"{"server":"","command":""}"#) }, + EndpointDoc { method: "POST", path: "/upload", desc: "Upload file via SFTP (parallel channels)", request: Some(r#"{"server":"","localPath":"","remotePath":""}"#) }, + EndpointDoc { method: "POST", path: "/download", desc: "Download file via SFTP (parallel channels)", request: Some(r#"{"server":"","remotePath":"","localPath":""}"#) }, + EndpointDoc { method: "POST", path: "/servers/add", desc: "Add server dynamically (temporary, lost on restart)", request: Some(r#"{"name":"x","host":"1.2.3.4","port":22,"user":"root","password":"..."}"#) }, + ], + notes: vec![ + "Workflow: GET /servers to pick a `name`, then pass it as `server` to /exec, /upload or /download.", + "CLI equivalents: ssh-proxy exec -n -c \"\" | ssh-proxy servers | ssh-proxy upload/download", + "Sessions are lazy + pooled; status pending = configured but not connected yet.", + ], + }) +} + pub async fn add_server( State(state): State, Json(req): Json, @@ -238,7 +281,7 @@ pub async fn upload( "Usage: POST /upload {{\"server\": \"name\", \"localPath\": \"./file.txt\", \"remotePath\": \"/remote/file.txt\"}}\n\nAvailable servers: {}", server_names ); - error_response_with_usage(&e.to_string(), &usage) + manager_error(manager, &req.server, &e.to_string(), usage) })?; let duration_ms = result.duration_ms; @@ -273,7 +316,7 @@ pub async fn download( "Usage: POST /download {{\"server\": \"name\", \"remotePath\": \"/remote/file.txt\", \"localPath\": \"./file.txt\"}}\n\nAvailable servers: {}", server_names ); - error_response_with_usage(&e.to_string(), &usage) + manager_error(manager, &req.server, &e.to_string(), usage) })?; let duration_ms = result.duration_ms; @@ -327,6 +370,17 @@ fn error_response_with_usage(msg: &str, usage: &str) -> (StatusCode, Json (StatusCode, Json) { + let known = manager.list_servers().iter().any(|s| s.name == server); + if known { + error_response(e) + } else { + error_response_with_usage(e, &usage) + } +} + fn list_server_names(manager: &SessionManager) -> String { manager.list_servers() .iter() diff --git a/ssh-proxy/src/logger.rs b/ssh-proxy/src/logger.rs index 32022c9..d61545a 100644 --- a/ssh-proxy/src/logger.rs +++ b/ssh-proxy/src/logger.rs @@ -123,23 +123,22 @@ impl LogEntry { pub fn with_sql(mut self, sql: &str) -> Self { // 截断过长的 SQL - self.sql = Some(truncate_string(sql, 1000)); + self.sql = Some(truncate_string(sql, 2000)); self } pub fn with_command(mut self, command: &str) -> Self { // 截断过长的命令 - self.command = Some(truncate_string(command, 500)); + self.command = Some(truncate_string(command, 2000)); self } pub fn with_duration(mut self, ms: u64) -> Self { self.duration_ms = ms; - // 慢请求告警: >3s 为 WARN, >10s 为 ERROR - // 注意: 后台命令(nohup)可能耗时很长但 exitCode=0,不标记错误 - if ms > 10000 && self.level == "INFO" { - self.level = "ERROR".to_string(); - } else if ms > 3000 && self.level == "INFO" { + // 慢请求告警: >3s 为 WARN, >30s 为 WARN(长任务)—— + // 此前 >10s 一律标 ERROR,但 exit_code=0 的正常长命令(如 nohup 启动) + // 被误标成失败,日志噪音大。真正的错误由 with_exit_code/with_error 判 + if ms > 3000 && self.level == "INFO" { self.level = "WARN".to_string(); } self diff --git a/ssh-proxy/src/main.rs b/ssh-proxy/src/main.rs index ca4be6c..94e1a8d 100644 --- a/ssh-proxy/src/main.rs +++ b/ssh-proxy/src/main.rs @@ -8,6 +8,17 @@ use axum::{routing::{get, post}, Router}; use clap::{Parser, Subcommand}; use std::sync::Arc; +// ⚠ 共享实现,修改需同步至 mysql/mongo/redis-proxy/src/main.rs +/// 默认请求日志路径(未设置 SSH_PROXY_LOG 时): exe同目录 logs/ssh-proxy.log +fn default_log_path(name: &str) -> String { + match std::env::current_exe() { + Ok(exe) => exe.parent() + .map(|d| d.join("logs").join(format!("{}.log", name)).to_string_lossy().into_owned()) + .unwrap_or_else(|| format!("{}.log", name)), + Err(_) => format!("{}.log", name), + } +} + #[derive(Parser, Debug)] #[command(name = "ssh-proxy")] #[command(about = "SSH HTTP proxy with session pooling")] @@ -36,6 +47,9 @@ enum Commands { /// Output format: text, json #[arg(short = 'F', long, default_value = "text")] format: String, + /// 后台执行: 远端 nohup 断流拉起, 立即返回 BG-STARTED + 日志路径(长命令防会话超时连杀) + #[arg(long)] + bg: bool, }, Servers, /// Upload file to remote server (SFTP) @@ -83,19 +97,38 @@ enum Commands { }, } +// ⚠ 共享实现,修改需同步至 mysql/mongo/redis-proxy/src/main.rs +/// 将相对路径基于可执行文件所在目录解析为绝对路径 +fn resolve_config_path(path: &str) -> String { + if std::path::Path::new(path).is_absolute() || path.starts_with('~') { + return path.to_string(); + } + match std::env::current_exe() { + Ok(exe) => { + if let Some(dir) = exe.parent() { + dir.join(path).to_string_lossy().into_owned() + } else { + path.to_string() + } + } + Err(_) => path.to_string(), + } +} + #[tokio::main] async fn main() -> anyhow::Result<()> { let args = Args::parse(); + let config_path = resolve_config_path(&args.config); match args.command { - Some(Commands::Server { port, host }) => run_server(&args.config, port, host).await, - Some(Commands::Exec { name, command, format }) => run_cli_exec(&args.server, &name, &command, &format), + Some(Commands::Server { port, host }) => run_server(&config_path, port, host).await, + Some(Commands::Exec { name, command, format, bg }) => run_cli_exec(&args.server, &name, &command, &format, bg), Some(Commands::Servers) => run_cli_servers(&args.server), Some(Commands::Upload { name, src, dst, concurrency }) => run_cli_transfer(&args.server, "upload", &name, &src, &dst, concurrency), Some(Commands::Download { name, src, dst, concurrency }) => run_cli_transfer(&args.server, "download", &name, &src, &dst, concurrency), Some(Commands::AddServer { name, host, port, user, password, private_key }) => { run_cli_add_server(&args.server, name, host, port, user, password, private_key) } - None => run_server(&args.config, None, None).await, + None => run_server(&config_path, None, None).await, } } @@ -106,14 +139,15 @@ async fn run_server(config_path: &str, port: Option, host: Option) if let Some(h) = host { config.server.host = h; } // 初始化日志 - let log_path = std::env::var("SSH_PROXY_LOG").ok(); + let log_path = std::env::var("SSH_PROXY_LOG").ok() + .or_else(|| Some(default_log_path("ssh-proxy"))); let logger = Arc::new(logger::RequestLogger::new(log_path.as_deref())); if logger.is_enabled() { println!("Request logging: enabled"); } println!("Initializing SSH sessions...\n"); - let manager = Arc::new(session::SessionManager::new(&config.servers)?); + let manager = Arc::new(session::SessionManager::new(&config.servers, config.pool.exec_timeout_secs)?); let manager_clone = manager.clone(); let idle_timeout = config.pool.idle_timeout_secs; @@ -133,6 +167,7 @@ async fn run_server(config_path: &str, port: Option, host: Option) .route("/upload", post(handler::upload)) .route("/download", post(handler::download)) .route("/health", get(handler::health)) + .route("/_help", get(handler::help)) .with_state(Arc::new((manager, logger))); let addr = format!("{}:{}", config.server.host, config.server.port); @@ -145,6 +180,7 @@ async fn run_server(config_path: &str, port: Option, host: Option) println!(" POST /download - Download file (SFTP)"); println!(" POST /servers/add - Add server (temporary)"); println!(" GET /servers - List all servers"); + println!(" GET /_help - API guide (endpoints + usage)"); println!(" GET /health - Health check"); println!("\nCLI Usage:"); println!(" ssh-proxy exec -n flux_dev -c \"docker ps\""); @@ -156,7 +192,7 @@ async fn run_server(config_path: &str, port: Option, host: Option) Ok(()) } -fn run_cli_exec(server_url: &str, server: &str, command: &str, format: &str) -> anyhow::Result<()> { +fn run_cli_exec(server_url: &str, server: &str, command: &str, format: &str, bg: bool) -> anyhow::Result<()> { let cli = cli::Cli::new(Some(server_url.to_string())); if !cli.check_server()? { eprintln!(); @@ -170,7 +206,7 @@ fn run_cli_exec(server_url: &str, server: &str, command: &str, format: &str) -> eprintln!("配置文件中的服务器信息见: ssh-proxy.toml"); anyhow::bail!("Proxy server not running at {}", server_url); } - cli.exec(server, command, format) + cli.exec(server, command, format, bg) } fn run_cli_servers(server_url: &str) -> anyhow::Result<()> { @@ -217,4 +253,4 @@ fn run_cli_add_server( anyhow::bail!("Proxy server not running at {}", server_url); } cli.add_server(name, host, port, user, password, private_key) -} \ No newline at end of file +} diff --git a/ssh-proxy/src/session.rs b/ssh-proxy/src/session.rs index 49d0591..bd4cd9d 100644 --- a/ssh-proxy/src/session.rs +++ b/ssh-proxy/src/session.rs @@ -20,6 +20,7 @@ struct SessionState { pub struct SessionManager { sessions: Mutex>, configs: Mutex>, + exec_timeout_secs: u64, } // 简单的 SSH 客户端处理器 @@ -37,7 +38,7 @@ impl client::Handler for Client { } impl SessionManager { - pub fn new(configs: &[SshServerConfig]) -> Result { + pub fn new(configs: &[SshServerConfig], exec_timeout_secs: u64) -> Result { let mut config_map = HashMap::new(); for cfg in configs { config_map.insert(cfg.name.clone(), cfg.clone()); @@ -47,6 +48,7 @@ impl SessionManager { Ok(Self { sessions: Mutex::new(HashMap::new()), configs: Mutex::new(config_map), + exec_timeout_secs, }) } @@ -151,25 +153,34 @@ impl SessionManager { let mut stderr = String::new(); let mut exit_code: i32 = -1; - // 读取输出 - while let Some(msg) = channel.wait().await { - match msg { - russh::ChannelMsg::Data { data } => { - stdout.push_str(&String::from_utf8_lossy(&data)); - } - russh::ChannelMsg::ExtendedData { data, ext } => { - if ext == 1 { // stderr - stderr.push_str(&String::from_utf8_lossy(&data)); + // 读取输出,带执行上限:远端命令挂死(如 nohup 子进程未正确脱离通道)时 + // wait() 永不返回——实测日志曾挂 6.7h(durationMs 24010328)。超时放弃通道 + // 并断开会话(通道状态不可信),返回 EXEC_TIMED_OUT 供 handler 定级 408 + let deadline = Duration::from_secs(self.exec_timeout_secs); + let wait_loop = async { + while let Some(msg) = channel.wait().await { + match msg { + russh::ChannelMsg::Data { data } => { + stdout.push_str(&String::from_utf8_lossy(&data)); } + russh::ChannelMsg::ExtendedData { data, ext } => { + if ext == 1 { // stderr + stderr.push_str(&String::from_utf8_lossy(&data)); + } + } + russh::ChannelMsg::ExitStatus { exit_status } => { + exit_code = exit_status as i32; + } + russh::ChannelMsg::Eof => { + // 继续等待 ExitStatus(流结束但进程可能未退出) + } + _ => {} } - russh::ChannelMsg::ExitStatus { exit_status } => { - exit_code = exit_status as i32; - } - russh::ChannelMsg::Eof => { - // 继续等待 ExitStatus - } - _ => {} } + }; + if tokio::time::timeout(deadline, wait_loop).await.is_err() { + self.remove_session(name).await; + anyhow::bail!("EXEC_TIMED_OUT: 命令超过 {}s 未完成(可能挂死或确需更久,可在 toml [pool] exec_timeout_secs 调整)", deadline.as_secs()); } Ok(ExecResult {