Skip to content

iana: Embed & parse reserved IP registries from primary source #8249

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Jun 25, 2025

Conversation

jprenken
Copy link
Contributor

@jprenken jprenken commented Jun 14, 2025

Move policy.IsReservedIP to iana.IsReservedAddr.

Move policy.IsReservedPrefix to iana.IsReservedPrefix.

Embed & parse IANA's special-purpose address registries for IPv4 and IPv6 in their original CSV format.

Fixes #8080

jprenken added 2 commits June 13, 2025 20:58
Move `policy.IsReservedIP` to `iana.IsReservedAddr`.

Move `policy.IsReservedPrefix` to `iana.IsReservedPrefix`.

Embed & parse IANA's special-purpose address registries for IPv4 and IPv6 in their original CSV format.

Fixes #8080
@jprenken jprenken marked this pull request as ready for review June 15, 2025 04:25
@jprenken jprenken requested a review from a team as a code owner June 15, 2025 04:25
@jprenken jprenken requested a review from aarongable June 15, 2025 04:25
@aarongable aarongable requested review from a team and jsha and removed request for a team June 16, 2025 22:14
@jprenken jprenken requested a review from aarongable June 16, 2025 22:41
aarongable
aarongable previously approved these changes Jun 17, 2025
Copy link
Contributor

@aarongable aarongable left a comment

Choose a reason for hiding this comment

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

nit: this probably shouldn't close 8080, since it doesn't auto-update our copy of the registry yet. Let's either do that here, or leave 8080 open and leave a TODO in the action yml file.

@jprenken jprenken requested a review from aarongable June 18, 2025 07:36
Copy link
Contributor

@aarongable aarongable left a comment

Choose a reason for hiding this comment

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

The structure of the update job looks good, but workflows are hard to review. Can you push this branch to your personal fork of the boulder repo, make the checked-in files out-of-date, and then run the workflow and link to the resulting run and PR here?

@jprenken
Copy link
Contributor Author

The structure of the update job looks good, but workflows are hard to review. Can you push this branch to your personal fork of the boulder repo, make the checked-in files out-of-date, and then run the workflow and link to the resulting run and PR here?

Sure thing! I had to modify the one line that sets the PR reviewer. Here are the results:

I did one test run before remembering to make the checked-in files out of date and, delightfully, caught a real correction that IANA must have made within the past few days.

@jprenken jprenken requested a review from aarongable June 19, 2025 22:27
aarongable
aarongable previously approved these changes Jun 23, 2025
@aarongable aarongable requested a review from a team June 23, 2025 23:55
Copy link
Member

@beautifulentropy beautifulentropy left a comment

Choose a reason for hiding this comment

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

A really neat change that I had a lot of fun reading through. Just some small comments, but otherwise I think it looks great!

iana/ip.go Outdated
Comment on lines 117 to 119
whitespacesRE := regexp.MustCompile(`\s{2,}`)
// Footnotes at the end, like `[2]`.
footnotesRE := regexp.MustCompile(`\[\d+\]$`)
Copy link
Member

Choose a reason for hiding this comment

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

We typically declare these outside of a function so that they fail at compilation time.

Copy link
Contributor

Choose a reason for hiding this comment

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

Note that this doesn't make a difference in this case.

Putting them outside the function doesn't cause them to fail at compilation time, rather it causes them to fail at package loading time, i.e. startup time. But this function is called from init(), so a failure here would also be caught at startup time.

@jprenken jprenken merged commit 9308392 into main Jun 25, 2025
12 checks passed
@jprenken jprenken deleted the iana-registries branch June 25, 2025 19:05
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.

New component to retrieve external data sources
3 participants