Skip to content

fix: format IPv6 endpoints for integrations - #786

Merged
frahlg merged 2 commits into
masterfrom
agent/fix-ipv6-endpoint-formatting
Aug 4, 2026
Merged

fix: format IPv6 endpoints for integrations#786
frahlg merged 2 commits into
masterfrom
agent/fix-ipv6-endpoint-formatting

Conversation

@frahlg

@frahlg frahlg commented Aug 4, 2026

Copy link
Copy Markdown
Member

Summary

  • Format CTEK and Nova endpoint addresses with net.JoinHostPort after removing brackets only from valid IPv6 literal host parts.
  • Encode raw IPv6 zone IDs as %25 in Nova broker URLs, while preserving already encoded %25 without double-escaping.
  • Keep IPv4, hostnames, and Nova diagnostic address semantics unchanged.
  • Keep the existing driver-fingerprint path unchanged; its input normalization already handles bracketed IPv6.
  • Add table-driven regressions for IPv4, hostnames, bare/bracketed IPv6, and raw/already-encoded zone IDs.
  • Keep the patch changeset.

Why

Issue #725 identifies malformed host:port strings for bare IPv6 literals. The independent review of #786 also found that already bracketed input became [[fd00::5]], and that Nova broker URLs rejected raw IPv6 zone IDs such as fe80::5%en0. Nova URL zone IDs now follow RFC 6874.

Scope and non-overlap

Checks

Passed locally on eebe93e3, rebased on live master 6d4b958a7e29b52fac69b4c919f99e4409c41348:

  • make verify
  • pre-commit make verify
  • pre-push make verify-all (including Linux arm64/amd64 and Windows amd64 cross-builds)
  • targeted go test ./internal/api ./internal/evcloud ./internal/nova -count=1

@frahlg
frahlg force-pushed the agent/fix-ipv6-endpoint-formatting branch from ddfa57d to 32469dc Compare August 4, 2026 07:51
@frahlg
frahlg force-pushed the agent/fix-ipv6-endpoint-formatting branch from 32469dc to eebe93e Compare August 4, 2026 08:25
@frahlg
frahlg marked this pull request as ready for review August 4, 2026 08:38
@frahlg
frahlg merged commit 1e5eb03 into master Aug 4, 2026
13 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: eebe93e3de

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +154 to +155
if percent < 0 || !strings.Contains(host[:percent], ":") || strings.HasPrefix(host[percent:], "%25") {
return host

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Encode raw zone IDs that begin with 25

When the raw IPv6 zone itself starts with 25 (for example, the common numeric interface index in fe80::5%25), this prefix check mistakes it for an already URL-encoded delimiter and returns ssl://[fe80::5%25]:8883. url.Parse, as used by Paho's AddBroker, decodes that host to [fe80::5%]:8883, which cannot be resolved, so Nova never connects on that interface. The input representation must be canonicalized or otherwise disambiguated rather than treating every %25... suffix as pre-encoded.

Useful? React with 👍 / 👎.

@frahlg
frahlg deleted the agent/fix-ipv6-endpoint-formatting branch August 7, 2026 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant