Repository navigation
Fixes #7953: Connect controlled HTTPS MCP endpoints - #8313
BobSong-dev wants to merge 74 commits into
Conversation
…ateway-p105 # Conflicts: # shenyu-plugin/shenyu-plugin-agent-gateway/src/main/java/org/apache/shenyu/plugin/agent/gateway/AgentGatewayPlugin.java # shenyu-plugin/shenyu-plugin-agent-gateway/src/main/java/org/apache/shenyu/plugin/agent/gateway/protocol/AgentMcpHttpHandler.java # shenyu-plugin/shenyu-plugin-ai/shenyu-plugin-ai-proxy/src/main/java/org/apache/shenyu/plugin/ai/proxy/enhanced/service/AiProxyEngine.java # shenyu-spring-boot-starter/shenyu-spring-boot-starter-plugin/shenyu-spring-boot-starter-plugin-agent-gateway/src/main/java/org/apache/shenyu/springboot/starter/plugin/agent/gateway/AgentGatewayPluginConfiguration.java
…audit-7950-integration
…resource-admission-7951
…resource-admission-7951 # Conflicts: # shenyu-plugin/shenyu-plugin-metrics/src/main/java/org/apache/shenyu/plugin/metrics/reporter/MetricsReporter.java
…to integration/agent-gateway-p105 # Conflicts: # .github/scripts/test-agent-gateway-migrations.py # shenyu-plugin/shenyu-plugin-ai/shenyu-plugin-ai-proxy/src/main/java/org/apache/shenyu/plugin/ai/proxy/enhanced/service/AiProxyEngine.java # shenyu-plugin/shenyu-plugin-metrics/src/main/java/org/apache/shenyu/plugin/metrics/reporter/MetricsReporter.java # shenyu-spring-boot-starter/shenyu-spring-boot-starter-plugin/shenyu-spring-boot-starter-plugin-agent-gateway/src/main/java/org/apache/shenyu/springboot/starter/plugin/agent/gateway/AgentGatewayPluginConfiguration.java
…nt-gateway-audit-7950-integration # Conflicts: # shenyu-plugin/shenyu-plugin-agent-gateway/src/main/java/org/apache/shenyu/plugin/agent/gateway/protocol/AgentMcpDispatcher.java # shenyu-plugin/shenyu-plugin-agent-gateway/src/main/java/org/apache/shenyu/plugin/agent/gateway/protocol/AgentMcpExecutionContext.java # shenyu-plugin/shenyu-plugin-agent-gateway/src/main/java/org/apache/shenyu/plugin/agent/gateway/protocol/AgentMcpHttpHandler.java # shenyu-plugin/shenyu-plugin-ai/shenyu-plugin-ai-proxy/src/main/java/org/apache/shenyu/plugin/ai/proxy/enhanced/service/AiProxyEngine.java # shenyu-plugin/shenyu-plugin-ai/shenyu-plugin-ai-proxy/src/test/java/org/apache/shenyu/plugin/ai/proxy/enhanced/AiProxyPluginTest.java # shenyu-plugin/shenyu-plugin-metrics/src/main/java/org/apache/shenyu/plugin/metrics/reporter/MetricsReporter.java # shenyu-spring-boot-starter/shenyu-spring-boot-starter-plugin/shenyu-spring-boot-starter-plugin-agent-gateway/src/main/java/org/apache/shenyu/springboot/starter/plugin/agent/gateway/AgentGatewayPluginConfiguration.java # shenyu-spring-boot-starter/shenyu-spring-boot-starter-plugin/shenyu-spring-boot-starter-plugin-ai-proxy/src/main/java/org/apache/shenyu/springboot/starter/plugin/ai/proxy/AiProxyPluginConfiguration.java
…nt-gateway-audit-7950-integration # Conflicts: # shenyu-plugin/shenyu-plugin-metrics/src/main/java/org/apache/shenyu/plugin/metrics/reporter/MetricsReporter.java # shenyu-spring-boot-starter/shenyu-spring-boot-starter-plugin/shenyu-spring-boot-starter-plugin-agent-gateway/src/main/java/org/apache/shenyu/springboot/starter/plugin/agent/gateway/AgentGatewayPluginConfiguration.java
…resource-admission-7951 # Conflicts: # .github/scripts/test-agent-gateway-migrations.py # shenyu-plugin/shenyu-plugin-agent-gateway/src/main/java/org/apache/shenyu/plugin/agent/gateway/protocol/AgentMcpDispatcher.java # shenyu-plugin/shenyu-plugin-agent-gateway/src/main/java/org/apache/shenyu/plugin/agent/gateway/protocol/AgentMcpExecutionContext.java # shenyu-plugin/shenyu-plugin-agent-gateway/src/main/java/org/apache/shenyu/plugin/agent/gateway/protocol/AgentMcpHttpHandler.java # shenyu-plugin/shenyu-plugin-agent-gateway/src/main/java/org/apache/shenyu/plugin/agent/gateway/remote/ManagedRemoteMcpCatalog.java # shenyu-spring-boot-starter/shenyu-spring-boot-starter-plugin/shenyu-spring-boot-starter-plugin-agent-gateway/src/main/java/org/apache/shenyu/springboot/starter/plugin/agent/gateway/AgentGatewayPluginConfiguration.java
…n/admission-publication-20261105
…n/admission-publication-20261105
…cp-https-7953-publication
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #8313 +/- ##
=============================================
+ Coverage 61.49% 73.10% +11.61%
- Complexity 8818 19623 +10805
=============================================
Files 1261 1837 +576
Lines 39273 72237 +32964
Branches 3725 8631 +4906
=============================================
+ Hits 24151 52809 +28658
- Misses 12952 15016 +2064
- Partials 2170 4412 +2242
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Aias00
left a comment
There was a problem hiding this comment.
Stream Agent analysis
FINAL synthesis of PR #8313 (head 98da9ea) reviewing cross-file interactions from 42 partition reviews. One partition (part-12) reported a CRITICAL compilation-blocking missing import in AgentMcpResourceAdmission.java. all_parts_passed=false, thus final verdict NEEDS_CHANGES. CI passed (91 checks) and complete_diff=true, but the blocker must be resolved before merge.
Evidence
- Child review part-12 (task ff269b14-cc66-429b-86a5-be00147d895f) reports CRITICAL missing import at line 20 RIGHT
- Attachment field all_parts_passed=false despite complete_diff=true and CI passed=true
- Cross-file review summaries indicate other 41 partitions PASS with no HIGH/CRITICAL findings
Recommended next steps
- Add missing import for AgentResourceAdmission in shenyu-plugin/shenyu-plugin-agent-gateway/src/main/java/org/apache/shenyu/plugin/agent/gateway/protocol/AgentMcpResourceAdmission.java
- Re-run CI to confirm compilation and tests pass after fix
- Re-review partition part-12 and final synthesis
Scope: captured diff and GitHub check metadata only; no local tests were executed.
Task: f43e9f74-0f6c-4225-accd-e2f825fe56c6 · Commit: 98da9eaabac5f8d90361f78a7f9ee7e9b2a9adcb
Review verdict: NEEDS_CHANGES
SYNTHESIS/FINAL scope: assessed all 42 child partition reviews. Part-12 returned NEEDS_CHANGES with a CRITICAL blocking finding (missing import AgentResourceAdmission in AgentMcpResourceAdmission.java line 20). Per rules, child NEEDS_CHANGES cannot be overridden to PASS. all_parts_passed is false. Although complete_diff=true, global_complete_diff=true, and CI passed (91 checks), the concrete compilation blocker must be fixed. No other HIGH/CRITICAL issues were identified in other partitions. Limitations: review based on supplied partition diffs and summaries; no local test execution; cross-file integration assumed from summaries but blocked by compilation error.
Publication: COMMENT (DRAFT_PR)
- shenyu-plugin/shenyu-plugin-agent-gateway/src/main/java/org/apache/shenyu/plugin/agent/gateway/protocol/AgentMcpResourceAdmission.java:20 [RIGHT] Missing import for AgentResourceAdmission (likely org.apache.shenyu.plugin.agent.gateway.resource.AgentResourceAdmission). Class is used as delegate type, instantiated, and methods called, but not imported; package is protocol, causing compilation failure.
Review details
PR #8313 introduces controlled HTTPS MCP endpoints with admission and audit features. However, partition review identified a compilation failure: AgentMcpResourceAdmission.java lacks an import for AgentResourceAdmission (line 20). Please add the missing import (likely org.apache.shenyu.plugin.agent.gateway.resource.AgentResourceAdmission) and push a fix. Once that is resolved and CI remains green, the PR can be re-reviewed for final pass.
Aias00
left a comment
There was a problem hiding this comment.
Stream Agent analysis
FINAL synthesis of PR #8313 (head 98da9ea) reviewing cross-file interactions from 42 partition reviews. One partition (part-12) reported a CRITICAL compilation-blocking missing import in AgentMcpResourceAdmission.java. all_parts_passed=false, thus final verdict NEEDS_CHANGES. CI passed (91 checks) and complete_diff=true, but the blocker must be resolved before merge.
Evidence
- Child review part-12 (task ff269b14-cc66-429b-86a5-be00147d895f) reports CRITICAL missing import at line 20 RIGHT
- Attachment field all_parts_passed=false despite complete_diff=true and CI passed=true
- Cross-file review summaries indicate other 41 partitions PASS with no HIGH/CRITICAL findings
Recommended next steps
- Add missing import for AgentResourceAdmission in shenyu-plugin/shenyu-plugin-agent-gateway/src/main/java/org/apache/shenyu/plugin/agent/gateway/protocol/AgentMcpResourceAdmission.java
- Re-run CI to confirm compilation and tests pass after fix
- Re-review partition part-12 and final synthesis
Scope: captured diff and GitHub check metadata only; no local tests were executed.
Task: f43e9f74-0f6c-4225-accd-e2f825fe56c6 · Commit: 98da9eaabac5f8d90361f78a7f9ee7e9b2a9adcb
Review verdict: NEEDS_CHANGES
SYNTHESIS/FINAL scope: assessed all 42 child partition reviews. Part-12 returned NEEDS_CHANGES with a CRITICAL blocking finding (missing import AgentResourceAdmission in AgentMcpResourceAdmission.java line 20). Per rules, child NEEDS_CHANGES cannot be overridden to PASS. all_parts_passed is false. Although complete_diff=true, global_complete_diff=true, and CI passed (91 checks), the concrete compilation blocker must be fixed. No other HIGH/CRITICAL issues were identified in other partitions. Limitations: review based on supplied partition diffs and summaries; no local test execution; cross-file integration assumed from summaries but blocked by compilation error.
Publication: REQUEST_CHANGES (VERIFIED_BLOCKING_FINDINGS)
- shenyu-plugin/shenyu-plugin-agent-gateway/src/main/java/org/apache/shenyu/plugin/agent/gateway/protocol/AgentMcpResourceAdmission.java:20 [RIGHT] Missing import for AgentResourceAdmission (likely org.apache.shenyu.plugin.agent.gateway.resource.AgentResourceAdmission). Class is used as delegate type, instantiated, and methods called, but not imported; package is protocol, causing compilation failure.
Review details
PR #8313 introduces controlled HTTPS MCP endpoints with admission and audit features. However, partition review identified a compilation failure: AgentMcpResourceAdmission.java lacks an import for AgentResourceAdmission (line 20). Please add the missing import (likely org.apache.shenyu.plugin.agent.gateway.resource.AgentResourceAdmission) and push a fix. Once that is resolved and CI remains green, the PR can be re-reviewed for final pass.
Aias00
left a comment
There was a problem hiding this comment.
Stream Agent analysis
PR #8313 (apache/shenyu) implements controlled HTTPS MCP endpoints with resource admission and invocation audit. FINAL cross-file synthesis of 42 partition reviews (all PASS, no blocking findings), complete diff true, and CI passed (91 checks) indicates no concrete HIGH/CRITICAL defects across files. Changes include new modules, pom dependencies, audit/observability classes, admission controller, transport routing, and comprehensive tests.
Evidence
- Frozen attachment: 42 partition reviews (part-0..part-41) all review_verdict PASS with empty blocking_findings
- CI status: complete=true, passed=true, check_count=91, legacy_state=pending but passed true
- complete_diff=true, global_complete_diff=true, all_parts_passed=true, head_sha=98da9eaabac5f8d90361f78a7f9ee7e9b2a9adcb
Recommended next steps
- Standard maintainer review and merge approval
- Post-merge monitoring of admission and audit metrics in staging
Scope: captured diff and GitHub check metadata only; no local tests were executed.
Task: 9c450261-ccff-4b7c-80ee-357ddc0ab5bc · Commit: 98da9eaabac5f8d90361f78a7f9ee7e9b2a9adcb
Review verdict: PASS
FINAL synthesis scope: assessed cross-file correctness, compatibility, contracts, tests and interactions from all child review summaries. All 42 child partitions reported PASS with no HIGH/CRITICAL findings. all_parts_passed=true, complete_diff=true, global_complete_diff=true, and CI passed=true (91 checks complete). No child NEEDS_CHANGES or INCONCLUSIVE to preserve. No invented defects. Limitation: review relied on supplied partition evidence and CI signal; no local test execution or runtime validation performed.
Publication: APPROVE (EXPLICIT_PASS)
Review details
Synthesis of all 42 partition reviews for PR #8313 at head 98da9ea shows PASS for each supplied diff segment. The complete diff was reviewed, CI passed (91 checks), and no HIGH/CRITICAL blocking findings were reported. Cross-file contracts for audit bridging, admission control, and route parsing appear consistent. Recommendation: this PR is ready for standard maintainer merge approval; no code changes requested. Note: this review did not execute tests locally and relies on provided partition evidence and CI status.
Aias00
left a comment
There was a problem hiding this comment.
Stream Agent analysis
PR #8313 (head a45f700) implements controlled HTTPS MCP endpoints for the Agent Gateway, building on the pre-existing shared admission controller from dependency #8095/#8002. The full pinned diff was read end-to-end (380,882 chars, sha256 cdd85a6cd5c48da9f9da510fd02612c22266797b905437c45e0f7d0e05194762; 73 files; has_more=false at offset 378000). Changes: (1) new Apache HttpClient5 CloseableHttpClient transport that honors pinned TLS routes and disables JVM DNS for controlled endpoints; (2) a deployment-owned route/endpoint allowlist parser in AgentGatewayPluginConfiguration (allowed-routes/allowed-endpoints) that throws at startup if none are approved; (3) a hard guard rejecting domain allowlists without a pinned IP (shouldRejectDomainAllowlistWithoutRelaxingTlsPolicy); (4) an opt-in JWT bearer security resolver (agentGatewayJwtSecurityResolver) that fails startup unless an exact authority policy is supplied; (5) an independent AgentInvocationAuditBridge so audit delivery coexists with the existing application observer; (6) AI Proxy and Metric/Sync client wiring to the bridge plus tests. The shared AgentMcpResourceAdmission/AdmissionConfig are referenced but NOT introduced here (they belong to the dependency), so they are correctly outside this PR's scope. CI recorded 91 checks, complete, all relevant e2e/build/CodeQL passing.
Evidence
- Full VERSIONED_DIFF read end-to-end: resource_diff returned has_more=false at offset 378000, total_characters 380882, sha256 cdd85a6cd5c48da9f9da510fd02612c22266797b905437c45e0f7d0e05194762 (73 files).
- AgentGatewayPluginConfiguration.aggregationRemoteCatalog throws IllegalStateException('Agent Gateway aggregation requires an approved transport route') and parses allowed-routes/allowed-endpoints via declarations(); test shouldRejectDomainAllowlistWithoutRelaxingTlsPolicy asserts startup failure for https://example.com:443/mcp without pinned IP.
- resource_search confirms AgentMcpResourceAdmission and AgentGatewayAdmissionConfig are NOT defined in this diff (out of scope, sourced from dependency #8095/#8002); AgentInvocationAuditBridge and the opt-in JWT resolver are added here with coexistence/opt-in tests.
Recommended next steps
- Confirm dependency #8095/#8002 (shared AgentMcpResourceAdmission) is merged before this PR to avoid a missing-bean startup failure.
- Validate the documented allowed-routes pinned-IP examples against the real pinning resolver and add an e2e case for the controlled HTTPS path.
- Verify the new agent-gateway audit module config keys are documented in the admin/operator guide, not only the markdown design doc.
Scope: captured diff and GitHub check metadata only; no local tests were executed.
Task: e2df240b-dede-4e4f-9b72-8fc1863bbc8b · Commit: a45f7001690c60bd198443791f682dfcab481b9b
Review verdict: PASS
Full diff coverage achieved (all pages read, has_more=false, consistent sha256). The change is cohesive and matches its stated scope: controlled HTTPS MCP transport with a deployment-owned allowlist, a hard guard rejecting unpinned domain routes, opt-in JWT bearer auth that fails without an exact authority policy, and a non-competing audit bridge. The shared admission controller is intentionally sourced from the declared dependency (#8095/#8002) and is not part of this diff. CI (91 checks) is reported complete with e2e/build/CodeQL successes. No HIGH/CRITICAL defect anchored to the changed lines was identified.
Publication: APPROVE (EXPLICIT_PASS)
Review details
I reviewed the complete frozen diff for #8313 (head a45f700). Verdict: PASS. The PR adds controlled HTTPS MCP transport with a deployment-owned route allowlist, refuses domain routes lacking a pinned IP (security guard test present), keeps the shared admission controller as a dependency, and adds an opt-in, non-competing audit bridge and JWT bearer resolver. All 91 CI checks reported complete/success. No concrete blocking defect was found in the changed code; the admission controller classes are intentionally out of scope (sourced from #8095/#8002). Recommend confirming the dependency lands first and that docs ship with validated pinned-IP examples.
Aias00
left a comment
There was a problem hiding this comment.
Stream Agent analysis
Reviewed the complete 73-file frozen diff at the pinned head plus targeted cross-file checks. The controlled HTTPS MCP endpoint support (fail-closed endpoint-to-IPv4 route declarations, hostname-preserving TLS with pinned destinations, backwards-compatible starter properties, audit bridge and docs) is internally consistent and no concrete HIGH/CRITICAL defect was found. CI, however, is unfinished: 7 e2e-case checks are still in_progress and passed=false, so PASS cannot be concluded.
Evidence
- Full frozen diff read to has_more=false (383,234 chars, 73 files); targeted per-file diffs verified for RemoteTransportRouteSet, ApacheRemoteMcpTransport, AgentGatewayPluginConfiguration and AgentInvocationAuditBridge on the pinned head.
- CI metadata: check_count=92, passed=false, legacy_state=pending, failed_checks=[], with 7 e2e-case checks in_progress and null conclusion (e.g. e2e-case (e2e-logging-rocketmq-compose, zookeeper)).
- Head contract checks: ApacheRemoteMcpTransport pins the approved IPv4 while keeping hostname TLS identity and disabling redirects; RemoteTransportRouteSet fails closed on missing route declarations; starter keeps allowed-endpoints and adds allowed-routes; no local tests were executed.
Recommended next steps
- Wait for the 7 in_progress e2e-case checks to complete and confirm passed=true across all 92 CI checks.
- Re-evaluate the verdict for PASS once CI is green; escalate only if a check fails.
Scope: captured diff and GitHub check metadata only; no local tests were executed.
Task: b977fde4-280f-4802-8274-56590c22d983 · Commit: 57f6f3be53783b335fa79a0dbe7b99a78bcc8702
Review verdict: INCONCLUSIVE
Full diff coverage was achieved and no concrete HIGH/CRITICAL blocking defect was identified, but PASS requires passing CI. The frozen CI evidence is unfinished (passed=false, legacy_state=pending, 7 e2e-case checks in_progress with null conclusions), so the verdict must be INCONCLUSIVE rather than PASS.
Publication: COMMENT (INCONCLUSIVE_REVIEW)
Fixes #7953
Dependency
Still depends on #8095 resource admission. #8002 is merged and no longer an outstanding prerequisite. This branch contains master
037d6f10b2394ff8cdbf928dfc4e0bf6d5cb71bbwhile retaining its admission snapshot and controlled HTTPS transport. Reconcile with the accepted #8095 interface before merging.Background
Remote MCP servers commonly use hostname certificates. Allowing arbitrary JVM DNS resolution would let an approved endpoint reach an unapproved address, so TLS identity and connection destination need separate deployment-owned controls.
Changes
Verification
git diff --checkpassed.