fix(core): resolve main build — remove duplicate SSRF function declarations - #1469
Conversation
…ations Build on origin/main (38e9eba) will fail go build with duplicate function declarations: ssrf.go:15 isSafeURL redeclared (a2a_proxy.go:741) ssrf.go:58 isPrivateOrMetadataIP redeclared (a2a_proxy.go:795) ssrf.go:84 validateRelPath redeclared (templates.go:65) a2a_proxy.go:14 "fmt" imported and not used Root cause: main was fast-forwarded to a CWE-22 fix commit that incorporated ssrf.go from the staging handler-split (PR #1457), but ssrf.go declares isSafeURL/isPrivateOrMetadataIP that already exist in a2a_proxy.go, and validateRelPath that already exists in templates.go. Fix: - Delete ssrf.go entirely — its isSafeURL/isPrivateOrMetadataIP are already in a2a_proxy.go; its validateRelPath is in templates.go. - Remove unused "fmt" import from a2a_proxy.go. - Add t.Setenv cleanup in TestIsPrivateOrMetadataIP and TestIsSafeURL so MOLECULE_DEPLOY_MODE=saas from TestIsPrivateOrMetadataIP_SaaSMode cannot leak into sibling tests. - Update stale file-location comments in ssrf_test.go. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Post-Merge Security Review — APPROVED ✅PR: #1469 — fix(core): resolve main build — remove duplicate SSRF function declarations Post-facto review: no issuesReviewed the diff and confirmed the merge is correct:
SSRF duplicate removed from mainWhat was deleted: What was kept: Both functions remain in Why it's correct: On IPv6 bypass — NOT present in deleted file's callersThe deleted No regressions
Relationship to open workPR #1472 (open) is doing a larger refactor on No security concerns. Build error resolved. IPv6 SSRF protection preserved via canonical 🤖 Reviewed by App-FE (security reviewer, post-merge) |
Summary
Build on origin/main (38e9eba) will fail
go buildwith 4 errors:isSafeURL redeclaredssrf.govsa2a_proxy.go:741isPrivateOrMetadataIP redeclaredssrf.govsa2a_proxy.go:795validateRelPath redeclaredssrf.govstemplates.go:65"fmt" imported and not useda2a_proxy.goRoot cause: main was fast-forwarded to a CWE-22 fix commit that incorporated
ssrf.gofrom the staging handler-split (PR #1457), butssrf.godeclares functions that already exist ina2a_proxy.goandtemplates.go.Fix
ssrf.go— itsisSafeURL/isPrivateOrMetadataIPare already ina2a_proxy.go; itsvalidateRelPathis intemplates.go"fmt"import froma2a_proxy.got.Setenvcleanup inTestIsPrivateOrMetadataIPandTestIsSafeURLsoMOLECULE_DEPLOY_MODE=saasfromTestIsPrivateOrMetadataIP_SaaSModecannot leak into sibling testsssrf_test.go(functions are ina2a_proxy.go, notmcp.go)Test plan
go build ./cmd/serverpasses🤖 Generated with Claude Code