mcp: add postgres transport session store
This commit is contained in:
@@ -47,7 +47,7 @@ use crate::{
|
||||
is_response, jsonrpc_error, jsonrpc_result, method_name, negotiated_protocol_version,
|
||||
params, request_id,
|
||||
},
|
||||
session::{InMemorySessionStore, SessionState, SharedSessionStore},
|
||||
session::{SessionState, SharedSessionStore},
|
||||
};
|
||||
|
||||
const HEADER_MCP_SESSION_ID: &str = "MCP-Session-Id";
|
||||
@@ -131,25 +131,6 @@ pub fn build_app(
|
||||
secret_crypto: SecretCrypto,
|
||||
runtime: RuntimeExecutor,
|
||||
api_rate_limiter: RequestRateLimiter,
|
||||
) -> Router {
|
||||
build_app_with_session_store(
|
||||
registry,
|
||||
refresh_interval,
|
||||
public_base_url,
|
||||
secret_crypto,
|
||||
runtime,
|
||||
api_rate_limiter,
|
||||
Arc::new(InMemorySessionStore::new()),
|
||||
)
|
||||
}
|
||||
|
||||
pub fn build_app_with_session_store(
|
||||
registry: PostgresRegistry,
|
||||
refresh_interval: Duration,
|
||||
public_base_url: Option<String>,
|
||||
secret_crypto: SecretCrypto,
|
||||
runtime: RuntimeExecutor,
|
||||
api_rate_limiter: RequestRateLimiter,
|
||||
sessions: SharedSessionStore,
|
||||
) -> Router {
|
||||
let state = Arc::new(AppState {
|
||||
|
||||
Reference in New Issue
Block a user