-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
Implement FromStr for zonemd Scheme and Algorithm #444
Open
mozzieongit
wants to merge
5
commits into
main
Choose a base branch
from
zonemd-from-str
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
42cbd0d
Cargo format
mozzieongit 90aae20
Implement FromStr for zonemd Scheme and Algorithm
mozzieongit 967c628
Breaking change: Update ZONEMD IANA types to use the iana macros to b…
ximon18 7d82fb7
Merge branch 'main' into zonemd-from-str
ximon18 d062747
IANA ZONEMD algorithm mnemonics are not hyphenated.
ximon18 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
//! ZONEMD IANA parameters. | ||
|
||
//------------ ZonemdScheme -------------------------------------------------- | ||
|
||
int_enum! { | ||
/// ZONEMD schemes. | ||
/// | ||
/// This type selects the method by which data is collated and presented | ||
/// as input to the hashing function for use with [ZONEMD]. | ||
/// | ||
/// For the currently registered values see the [IANA registration]. This | ||
/// type is complete as of 2024-11-29. | ||
/// | ||
/// [ZONEMD]: ../../../rdata/zonemd/index.html | ||
/// [IANA registration]: https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#zonemd-schemes | ||
=> | ||
ZonemdScheme, u8; | ||
|
||
/// Specifies that the SIMPLE scheme is used. | ||
(SIMPLE => 1, "SIMPLE") | ||
} | ||
|
||
int_enum_str_decimal!(ZonemdScheme, u8); | ||
int_enum_zonefile_fmt_decimal!(ZonemdScheme, "scheme"); | ||
|
||
//------------ ZonemdAlg ----------------------------------------------------- | ||
|
||
int_enum! { | ||
/// ZONEMD algorithms. | ||
/// | ||
/// This type selects the algorithm used to hash domain names for use with | ||
/// the [ZONEMD]. | ||
/// | ||
/// For the currently registered values see the [IANA registration]. This | ||
/// type is complete as of 2024-11-29. | ||
/// | ||
/// [ZONEMD]: ../../../rdata/zonemd/index.html | ||
/// [IANA registration]: https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#zonemd-hash-algorithms | ||
=> | ||
ZonemdAlg, u8; | ||
|
||
/// Specifies that the SHA-384 algorithm is used. | ||
(SHA384 => 1, "SHA384") | ||
|
||
/// Specifies that the SHA-512 algorithm is used. | ||
(SHA512 => 2, "SHA512") | ||
} | ||
|
||
int_enum_str_decimal!(ZonemdAlg, u8); | ||
int_enum_zonefile_fmt_decimal!(ZonemdAlg, "hash algorithm"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Should this be ZonemdAlgorithm?
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 think this was for consistency with the other algorithm type names (SecAlg, DigestAlg, Nsec3HashAlg, ...)
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.
Usually we avoid abbreviation unless something is frequently used. In wonder what is different in this case.
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.
Do you mean why the other type names are abbreviated in the first place?
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 created a PR that renames them all. So we can leave it as is for the moment.