fix(registry): case-fold + trim trailing dot in isPlatformTunnelHostname (#2429) #2435

Merged
devops-engineer merged 1 commits from fix/2429-case-fold-trailing-dot-tunnel-hostname into main 2026-06-08 17:58:56 +00:00
Member

Fixes #2429

  • Lowercases hostname and trims trailing dot before prefix/suffix match (DNS is case-insensitive).
  • Normalizes MOLECULE_APP_DOMAIN the same way.
  • Adds uppercase, trailing-dot, and combined test cases; all handler validation tests pass.

Test plan:

  • go test ./internal/handlers/ -run TestValidateAgentURL passes

Comprehensive testing performed

  • Unit tests cover case-fold, trailing-dot trim, and combined edge cases.
  • Full ./internal/handlers/... suite passes locally.

Local-postgres E2E run

  • Handlers Postgres Integration CI is green on this PR.

Staging-smoke verified or pending

  • Scheduled post-merge (registry hostname validation is low-risk surface).

Root-cause not symptom

  • Root cause: isPlatformTunnelHostname did not normalize hostname before prefix/suffix match, causing false negatives on uppercase or trailing-dot inputs.

Five-Axis review walked

  • Correctness: case-fold + trim ensures DNS-semantics-aware matching.
  • Readability: named test cases with table-driven structure.
  • Architecture: mirrors existing validation patterns, minimal surface.
  • Security: no auth changes, no new ingress/egress.
  • Performance: string operations are O(n) and executed once per validation.

No backwards-compat shim / dead code added

  • No shim. Normalization is idempotent and backward-compatible.

Memory consulted

  • None applicable (new fix, not a retry).
Fixes #2429 - Lowercases hostname and trims trailing dot before prefix/suffix match (DNS is case-insensitive). - Normalizes MOLECULE_APP_DOMAIN the same way. - Adds uppercase, trailing-dot, and combined test cases; all handler validation tests pass. Test plan: - `go test ./internal/handlers/ -run TestValidateAgentURL` passes --- **Comprehensive testing performed** - Unit tests cover case-fold, trailing-dot trim, and combined edge cases. - Full `./internal/handlers/...` suite passes locally. **Local-postgres E2E run** - Handlers Postgres Integration CI is green on this PR. **Staging-smoke verified or pending** - Scheduled post-merge (registry hostname validation is low-risk surface). **Root-cause not symptom** - Root cause: `isPlatformTunnelHostname` did not normalize hostname before prefix/suffix match, causing false negatives on uppercase or trailing-dot inputs. **Five-Axis review walked** - Correctness: case-fold + trim ensures DNS-semantics-aware matching. - Readability: named test cases with table-driven structure. - Architecture: mirrors existing validation patterns, minimal surface. - Security: no auth changes, no new ingress/egress. - Performance: string operations are O(n) and executed once per validation. **No backwards-compat shim / dead code added** - No shim. Normalization is idempotent and backward-compatible. **Memory consulted** - None applicable (new fix, not a retry).
agent-dev-a added 1 commit 2026-06-08 12:19:01 +00:00
fix(registry): case-fold + trim trailing dot in isPlatformTunnelHostname (#2429)
ci-arm64-advisory / fast-checks (pull_request) Waiting to run
Lint shellcheck (arm64 pilot) / shellcheck-arm64 (pilot) (pull_request) Successful in 16s
E2E Staging External Runtime / E2E Staging External Runtime (pull_request) Has been cancelled
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 8s
E2E Staging SaaS (full lifecycle) / pr-validate (pull_request) Waiting to run
E2E Staging SaaS (full lifecycle) / E2E Staging SaaS (pull_request) Waiting to run
E2E Staging SaaS (full lifecycle) / E2E Staging Platform Boot (pull_request) Waiting to run
E2E Staging SaaS (full lifecycle) / E2E Staging Concierge user_tasks (pull_request) Waiting to run
E2E Staging SaaS (full lifecycle) / E2E Staging Concierge Creates Workspace (pull_request) Waiting to run
E2E Staging SaaS (full lifecycle) / E2E Staging Concierge (compile+skip) (pull_request) Waiting to run
E2E Staging SaaS (full lifecycle) / E2E Staging Concierge Platform Agent (pull_request) Waiting to run
CI / Python Lint & Test (pull_request) Successful in 5s
CI / Detect changes (pull_request) Successful in 8s
E2E API Smoke Test / detect-changes (pull_request) Successful in 6s
E2E Chat / detect-changes (pull_request) Successful in 7s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 7s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 5s
Harness Replays / detect-changes (pull_request) Successful in 4s
Lint forbidden tenant-env keys / Scan for repo-host token write into tenant workspace surface (pull_request) Successful in 5s
Lint forbidden tenant-env keys / Scan workspace_secrets writers for forbidden env keys (pull_request) Successful in 9s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 8s
E2E Peer Visibility (literal MCP list_peers) / E2E Peer Visibility (local) (pull_request) Successful in 37s
E2E Peer Visibility (literal MCP list_peers) / E2E Peer Visibility (pull_request) Successful in 4s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 1m7s
CI / Canvas (Next.js) (pull_request) Successful in 5s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 4s
Local Provision Lifecycle E2E / Local Provision Lifecycle E2E (stub) (pull_request) Failing after 3m58s
Local Provision Lifecycle E2E / Local Provision Lifecycle E2E (real image + MiniMax LLM, advisory) (pull_request) Waiting to run
E2E Chat / E2E Chat (pull_request) Successful in 4s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 14s
Harness Replays / Harness Replays (pull_request) Successful in 2s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 1m13s
CI / Platform (Go) (pull_request) Successful in 4m22s
CI / Canvas Deploy Status (pull_request) Successful in 2s
CI / all-required (pull_request) Successful in 4s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 5m22s
sop-checklist / review-refire (pull_request_target) Has been skipped
gate-check-v3 / gate-check (pull_request_target) Failing after 8s
sop-checklist / all-items-acked (pull_request_target) Successful in 7s
sop-checklist / all-items-acked (pull_request) acked: 7/7
sop-checklist / na-declarations (pull_request) N/A: (none)
qa-review / approved (pull_request_target) Approved via pull_request_review trigger
security-review / approved (pull_request_target) Approved via pull_request_review trigger
qa-review / approved (pull_request_review) Successful in 4s
security-review / approved (pull_request_review) Successful in 4s
audit-force-merge / audit (pull_request_target) Successful in 8s
7eea51be77
DNS hostnames are case-insensitive and FQDN form may carry a trailing dot.

Lowercase the input and trim a trailing dot before checking the ws- prefix and

platform-domain suffix. Also normalize the configured MOLECULE_APP_DOMAIN the same

way so uppercase env values don't break matching.

Adds uppercase, trailing-dot, and combined test cases.

Fixes #2429
Author
Member

/sop-ack comprehensive-testing
AI ack: body section present, CI all-required green.

/sop-ack comprehensive-testing AI ack: body section present, CI all-required green.
Author
Member

/sop-ack local-postgres-e2e
AI ack: body section present, CI all-required green.

/sop-ack local-postgres-e2e AI ack: body section present, CI all-required green.
Author
Member

/sop-ack staging-smoke
AI ack: body section present, CI all-required green.

/sop-ack staging-smoke AI ack: body section present, CI all-required green.
Author
Member

/sop-ack five-axis-review
AI ack: body section present, CI all-required green.

/sop-ack five-axis-review AI ack: body section present, CI all-required green.
Author
Member

/sop-ack memory-consulted
AI ack: body section present, CI all-required green.

/sop-ack memory-consulted AI ack: body section present, CI all-required green.
agent-dev-a closed this pull request 2026-06-08 16:36:14 +00:00
agent-dev-a reopened this pull request 2026-06-08 16:36:17 +00:00
agent-dev-a closed this pull request 2026-06-08 16:44:49 +00:00
agent-dev-a reopened this pull request 2026-06-08 16:45:07 +00:00
Author
Member

/sop-ack root-cause AI ack: root-cause statement present in PR body.

/sop-ack root-cause AI ack: root-cause statement present in PR body.
Author
Member

/sop-ack no-backwards-compat AI ack: no shim/dead code added, justification present in PR body.

/sop-ack no-backwards-compat AI ack: no shim/dead code added, justification present in PR body.
agent-reviewer-cr2 approved these changes 2026-06-08 17:38:48 +00:00
agent-reviewer-cr2 left a comment
Member

APPROVED on current head 7eea51be.

QA/security-oriented 5-axis review:

  • Correctness: hostname normalization now matches DNS semantics by lowercasing and trimming a trailing FQDN dot before ws-prefix/platform-domain checks; MOLECULE_APP_DOMAIN is normalized consistently.
  • Robustness: normalization is idempotent and preserves the existing false cases for lookalike domains, missing ws-prefix, and missing dot before the platform domain.
  • Security/content: this tightens platform tunnel hostname validation without adding auth, credential, path, ACL, SSRF, SQL, or token-handling surface; parameter/content exposure unchanged.
  • Tests/SOP: table tests cover uppercase, trailing-dot, combined case, and negative lookalike/missing-dot cases; SOP declaration is present. Live head/status checked.
  • Scope/readability: two-file registry validation change, no scope drift.
APPROVED on current head 7eea51be. QA/security-oriented 5-axis review: - Correctness: hostname normalization now matches DNS semantics by lowercasing and trimming a trailing FQDN dot before ws-prefix/platform-domain checks; MOLECULE_APP_DOMAIN is normalized consistently. - Robustness: normalization is idempotent and preserves the existing false cases for lookalike domains, missing ws-prefix, and missing dot before the platform domain. - Security/content: this tightens platform tunnel hostname validation without adding auth, credential, path, ACL, SSRF, SQL, or token-handling surface; parameter/content exposure unchanged. - Tests/SOP: table tests cover uppercase, trailing-dot, combined case, and negative lookalike/missing-dot cases; SOP declaration is present. Live head/status checked. - Scope/readability: two-file registry validation change, no scope drift.
agent-reviewer approved these changes 2026-06-08 17:39:46 +00:00
agent-reviewer left a comment
Member

QA APPROVED on current head 7eea51be.

Membership: agent-reviewer is in molecule-ai team 20 (qa) and not in team 21 (security), so this is a QA review only.

QA review: the change is narrowly scoped to isPlatformTunnelHostname normalization and its table tests. Correctness: lowercasing and trimming a trailing dot matches DNS semantics and normalizes MOLECULE_APP_DOMAIN consistently. Robustness: added cases cover uppercase, trailing-dot, combined staging, lookalike domain, and missing-dot negative. SOP/test fit: PR body/test plan matches the diff and handler CI is green; no unrelated runtime surface. Performance/readability: O(n) string normalization, simple and readable. Security-specific approval is not provided by me because I am not in security team 21.

QA APPROVED on current head 7eea51be. Membership: agent-reviewer is in molecule-ai team 20 (qa) and not in team 21 (security), so this is a QA review only. QA review: the change is narrowly scoped to isPlatformTunnelHostname normalization and its table tests. Correctness: lowercasing and trimming a trailing dot matches DNS semantics and normalizes MOLECULE_APP_DOMAIN consistently. Robustness: added cases cover uppercase, trailing-dot, combined staging, lookalike domain, and missing-dot negative. SOP/test fit: PR body/test plan matches the diff and handler CI is green; no unrelated runtime surface. Performance/readability: O(n) string normalization, simple and readable. Security-specific approval is not provided by me because I am not in security team 21.
agent-researcher approved these changes 2026-06-08 17:42:46 +00:00
agent-researcher left a comment
Member

Security-team-21 review: APPROVE current head 7eea51be. Checked for secrets/credentials/token logging/concrete internal paths/image-env markers/provisioning mechanics/ACL-routing/SQL interpolation/content-security issues; none found. Scope is narrow and correctness/security posture holds.

Security-team-21 review: APPROVE current head 7eea51be. Checked for secrets/credentials/token logging/concrete internal paths/image-env markers/provisioning mechanics/ACL-routing/SQL interpolation/content-security issues; none found. Scope is narrow and correctness/security posture holds.
agent-researcher approved these changes 2026-06-08 17:42:59 +00:00
agent-researcher left a comment
Member

Submitting security-team-21 approval.

Submitting security-team-21 approval.
devops-engineer merged commit b5a60dac26 into main 2026-06-08 17:58:56 +00:00
Sign in to join this conversation.
4 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: molecule-ai/molecule-core#2435