feat(security): harden gateway boundaries and usage policies

Consolidate subscription usage policy enforcement, privacy-safe persistence, and gateway security hardening into one reviewable change.

Includes bounded HTTP and execution envelopes, header and protocol guards, DNS and relay validation, authentication and secret projection hardening, secure backup/install paths, and regression coverage.
This commit is contained in:
elky
2026-09-04 03:45:52 +08:00
parent ddcbeb3ae9
commit 579f2c7cc1
1019 changed files with 190437 additions and 26080 deletions
@@ -508,6 +508,11 @@ async fn gateway_executes_kiro_claude_cli_stream_via_local_provider_catalog_cand
provider_catalog_repository,
Arc::clone(&request_candidate_repository),
DEVELOPMENT_ENCRYPTION_KEY,
)
.attach_proxy_node_repository_for_tests(
crate::tests::ai_execute::ai_execute_proxy_node_repository([
"proxy-node-kiro-cli-local-stream",
]),
),
);
let gateway = build_router_with_state(gateway_state);
@@ -976,6 +981,11 @@ async fn gateway_executes_claude_cli_stream_via_local_decision_gate_without_wait
provider_catalog_repository,
Arc::clone(&request_candidate_repository),
DEVELOPMENT_ENCRYPTION_KEY,
)
.attach_proxy_node_repository_for_tests(
crate::tests::ai_execute::ai_execute_proxy_node_repository([
"proxy-node-claude-cli-local",
]),
),
);
let gateway = build_router_with_state(gateway_state);
@@ -1488,6 +1498,11 @@ async fn gateway_executes_claude_code_cli_stream_via_local_decision_gate_with_lo
provider_catalog_repository,
Arc::clone(&request_candidate_repository),
DEVELOPMENT_ENCRYPTION_KEY,
)
.attach_proxy_node_repository_for_tests(
crate::tests::ai_execute::ai_execute_proxy_node_repository([
"proxy-node-claude-code-cli-local",
]),
),
);
let gateway = build_router_with_state(gateway_state);
@@ -1979,6 +1994,11 @@ async fn gateway_executes_claude_chat_stream_via_local_decision_gate_with_local_
provider_catalog_repository,
Arc::clone(&request_candidate_repository),
DEVELOPMENT_ENCRYPTION_KEY,
)
.attach_proxy_node_repository_for_tests(
crate::tests::ai_execute::ai_execute_proxy_node_repository([
"proxy-node-claude-chat-stream",
]),
),
);
let gateway = build_router_with_state(gateway_state);