feat(secrets-mcp): MCP 请求日志、探测 404 与资源元数据
- 新增 logging 中间件:记录 client_ip、ua、JSON-RPC、tool 等 - tools 各入口/出口结构化日志 - 探测型 404(/.well-known、GET /mcp)降为 debug - /.well-known/oauth-protected-resource 最小元数据 - secrets-mcp 0.1.11 Made-with: Cursor
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
mod auth;
|
||||
mod logging;
|
||||
mod oauth;
|
||||
mod tools;
|
||||
mod web;
|
||||
@@ -53,7 +54,8 @@ async fn main() -> Result<()> {
|
||||
|
||||
tracing_subscriber::fmt()
|
||||
.with_env_filter(
|
||||
EnvFilter::try_from_default_env().unwrap_or_else(|_| "secrets_mcp=info".into()),
|
||||
EnvFilter::try_from_default_env()
|
||||
.unwrap_or_else(|_| "secrets_mcp=info,tower_http=info".into()),
|
||||
)
|
||||
.init();
|
||||
|
||||
@@ -120,6 +122,9 @@ async fn main() -> Result<()> {
|
||||
let router = Router::new()
|
||||
.merge(web::web_router())
|
||||
.nest_service("/mcp", mcp_service)
|
||||
.layer(axum::middleware::from_fn(
|
||||
logging::request_logging_middleware,
|
||||
))
|
||||
.layer(axum::middleware::from_fn_with_state(
|
||||
pool,
|
||||
auth::bearer_auth_middleware,
|
||||
|
||||
Reference in New Issue
Block a user