Skip to content

Creates the NormalizeAddr Func to Format IPv6 Addresses#157

Merged
jefferai merged 11 commits intomainfrom
dani_create-NormalizeAddr-util-func
Mar 6, 2025
Merged

Creates the NormalizeAddr Func to Format IPv6 Addresses#157
jefferai merged 11 commits intomainfrom
dani_create-NormalizeAddr-util-func

Conversation

@kheina
Copy link
Copy Markdown
Contributor

@kheina kheina commented Feb 25, 2025

NormalizeAddr takes an address as a string and returns a normalized copy. If the address is a URL, IP Address, or host:port address that includes an IPv6 address, the normalized copy will be conformant with RFC-5952 §4. If the address cannot be parsed, an error will be returned.

There are two valid formats:

  • hosts: host
    • may be any of: IPv6 literal, IPv4 literal, dns name, or [sub]domain name
    • IPv6 literals are not required to be encapsulated within square brackets
      in this format
  • URIs: [scheme://] [user@] host [:port] [/path] [?query] [#frag]
    • format should conform with RFC-3986 §3 or else the returned address may be parsed and formatted incorrectly
    • hosts containing IPv6 literals MUST be encapsulated within square brackets, as defined in RFC-3986 §3.2.2 and RFC-5952 §6
    • all non-host components are optional

See:

…copy of that address conformant with RFC5952
Copy link
Copy Markdown

@hugoghx hugoghx left a comment

Choose a reason for hiding this comment

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

Just a first pass 👀

Comment thread configutil/normalize.go Outdated
Comment thread configutil/normalize.go Outdated
Comment thread configutil/normalize.go Outdated
@hugoghx hugoghx requested a review from louisruch February 26, 2025 16:54
Comment thread configutil/normalize.go Outdated
Comment thread configutil/normalize_test.go Outdated
Comment thread configutil/normalize_test.go Outdated
Comment thread configutil/normalize.go Outdated
Comment thread configutil/normalize.go
Comment thread configutil/normalize.go Outdated
jefferai
jefferai previously approved these changes Mar 6, 2025
louisruch
louisruch previously approved these changes Mar 6, 2025
Copy link
Copy Markdown
Contributor

@louisruch louisruch left a comment

Choose a reason for hiding this comment

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

Great work on this thanks!

hugoghx
hugoghx previously approved these changes Mar 6, 2025
Copy link
Copy Markdown

@hugoghx hugoghx left a comment

Choose a reason for hiding this comment

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

🚢

@kheina kheina dismissed stale reviews from hugoghx, louisruch, and jefferai via 25cf3e7 March 6, 2025 22:30
@jefferai jefferai merged commit 8565209 into main Mar 6, 2025
@jefferai jefferai deleted the dani_create-NormalizeAddr-util-func branch March 6, 2025 22:34
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.

4 participants