-
Notifications
You must be signed in to change notification settings - Fork 21
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
Use Zonemaster::Engine::Normalization module for input name normalization #357
Conversation
…name normalization - Use Zonemaster::Engine::Normalization::normalize_name() in function add_fake_delegation() - Add conditional check to argument '--ns' in case of several slash characters
Seems like at first I forgot about the normalization of name server names. It is now done (commit 4ab0aaf). I also pushed another commit (0c8093e) that removes the now unused By the way, in both the specification and the implementation (message ids) of Also, in this PR , for normalization of name server names, I added the message |
This is no longer needed following the switch to Zonemaster::Engine::Normalization.
0c8093e
to
2974ebc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this change but I have a couple of nits.
The problem with "İabcİ" is that it cannot be downcased in an unambiguous way. The specification says "AMBIGUOUS_DOWNCASING" (https://github.com/zonemaster/zonemaster/blob/master/docs/public/specifications/tests/RequirementsAndNormalizationOfDomainNames.md). |
I tested the PR with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it work correctly? On FreeBSD I get
# zonemaster-cli råttgift.se
Domain name has a non-ASCII label ("råttgift") which is not a valid U-label.
Then I tested on Ubuntu 22.04 and get the same error.
As suggested by @blacksponge, with proper decoding this should now work as expected. See commit ce9b025. |
Update IP address validation methodology - It is now primarly based on regex checks, but also leverages Net::IP::XS::Error (when applicable) for more detailed error messages Add Readonly and Net::IP::XS as direct dependencies
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine to me! I tested some of the test commands and it works as expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice to have it in place! This gives consistent and documented behavior.
v2023.2 release testingI've tested this for v2023.2 and I could not find any deviations between the described behavior and the actual behavior. However, upon reflection I think the behavior could be improved in a couple of ways. I created #364 for this. |
Purpose
This PR introduces the usage of the Zonemaster::Engine::Normalization module for input DNS name normalization.
It also adds input validation to the
--ns
argument..Context
The current specification can found here, and will replace the Basic00 Test Case.
Changes
Zonemaster::Engine::Normalization::normalize_name()
--ns
argument validation:/
) charactersNet::IP::XS::Error()
for detailed error messagesZonemaster::CLI::to_idn()
Readonly
andNet::IP::XS
as direct dependenciesHow to test this PR
Testing should proceed as before, although more errors are now supported and several can be reported simultaneously:
Examples of (in)valid domain names can be found in the t/normalization.t unit test file in Engine, e.g: