Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
292 changes: 287 additions & 5 deletions src/proxy/server.rs

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,9 @@ pub fn build_test_app(registry: ManifestRegistry) -> axum::Router {
upstream_url_allowlists: std::sync::Arc::new(std::sync::Mutex::new(
std::collections::HashMap::new(),
)),
lazy_schema_cache: std::sync::Arc::new(std::sync::Mutex::new(
std::collections::HashMap::new(),
)),
});
build_router(state)
}
Expand Down Expand Up @@ -314,6 +317,9 @@ pub fn build_test_app_with_jwt(registry: ManifestRegistry) -> axum::Router {
upstream_url_allowlists: std::sync::Arc::new(std::sync::Mutex::new(
std::collections::HashMap::new(),
)),
lazy_schema_cache: std::sync::Arc::new(std::sync::Mutex::new(
std::collections::HashMap::new(),
)),
});
build_router(state)
}
Expand Down Expand Up @@ -348,6 +354,9 @@ pub fn build_test_app_full(
upstream_url_allowlists: std::sync::Arc::new(std::sync::Mutex::new(
std::collections::HashMap::new(),
)),
lazy_schema_cache: std::sync::Arc::new(std::sync::Mutex::new(
std::collections::HashMap::new(),
)),
});
build_router(state)
}
Expand Down
3 changes: 3 additions & 0 deletions tests/file_manager_proxy_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ fn build_app_with_registry(registry: ManifestRegistry, keyring: Keyring) -> axum
upstream_url_allowlists: std::sync::Arc::new(std::sync::Mutex::new(
std::collections::HashMap::new(),
)),
lazy_schema_cache: std::sync::Arc::new(std::sync::Mutex::new(
std::collections::HashMap::new(),
)),
});
build_router(state)
}
Expand Down
15 changes: 15 additions & 0 deletions tests/help_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ async fn test_proxy_help_returns_llm_recommendations() {
upstream_url_allowlists: std::sync::Arc::new(std::sync::Mutex::new(
std::collections::HashMap::new(),
)),
lazy_schema_cache: std::sync::Arc::new(std::sync::Mutex::new(
std::collections::HashMap::new(),
)),
});
let app = build_router(state);

Expand Down Expand Up @@ -252,6 +255,9 @@ async fn test_proxy_help_sends_tool_context_in_prompt() {
upstream_url_allowlists: std::sync::Arc::new(std::sync::Mutex::new(
std::collections::HashMap::new(),
)),
lazy_schema_cache: std::sync::Arc::new(std::sync::Mutex::new(
std::collections::HashMap::new(),
)),
});
let app = build_router(state);

Expand Down Expand Up @@ -305,6 +311,9 @@ async fn test_proxy_help_missing_llm_key_returns_503() {
upstream_url_allowlists: std::sync::Arc::new(std::sync::Mutex::new(
std::collections::HashMap::new(),
)),
lazy_schema_cache: std::sync::Arc::new(std::sync::Mutex::new(
std::collections::HashMap::new(),
)),
});
let app = build_router(state);

Expand Down Expand Up @@ -369,6 +378,9 @@ async fn test_proxy_help_llm_error_returns_502() {
upstream_url_allowlists: std::sync::Arc::new(std::sync::Mutex::new(
std::collections::HashMap::new(),
)),
lazy_schema_cache: std::sync::Arc::new(std::sync::Mutex::new(
std::collections::HashMap::new(),
)),
});
let app = build_router(state);

Expand Down Expand Up @@ -689,6 +701,9 @@ async fn test_proxy_help_excludes_internal_tools() {
upstream_url_allowlists: std::sync::Arc::new(std::sync::Mutex::new(
std::collections::HashMap::new(),
)),
lazy_schema_cache: std::sync::Arc::new(std::sync::Mutex::new(
std::collections::HashMap::new(),
)),
});
let app = build_router(state);

Expand Down
3 changes: 3 additions & 0 deletions tests/keys_live_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ method = "GET"
upstream_url_allowlists: std::sync::Arc::new(std::sync::Mutex::new(
std::collections::HashMap::new(),
)),
lazy_schema_cache: std::sync::Arc::new(std::sync::Mutex::new(
std::collections::HashMap::new(),
)),
});
(dir, state)
}
Expand Down
Loading