WIP: Convert constants to enums#473
Merged
rthalley merged 6 commits intorthalley:masterfrom May 19, 2020
Merged
Conversation
The flags are defined in dnskeybase, and additionally visible in DNSKEY and CDNSKEY. Also, remove flags_to_text_set() and flags_from_text_set(). The DNSKEY record doesn't support text flags; this was leftover from the KEY record. Remove tests that are no longer needed, and update other tests for these changes.
Add more checking to dns.rdata.register_type, to ensure that an existing type mnemonic isn't overwritten. Use the enum functionality for mapping names to values and values to names, rather than duplicating it.
Collaborator
|
❤️ Thanks! |
nrhall
pushed a commit
to nrhall/dnspython
that referenced
this pull request
Jun 23, 2020
WIP: Convert constants to enums
this causes doh to fail when dnspython version == 2.0 |
Collaborator
Author
|
The doh-client software is relying on a private method, which is an inherently unsafe thing to do. The fact that it stopped working when a private method was changed is a problem with doh-client, not dnspython. |
JasonCoombs
pushed a commit
to JasonCoombs/doh-client
that referenced
this pull request
Aug 27, 2020
Not meant to be a comprehensive update. This edit has been unit tested only once, and not exhaustively. At first glance this appears to work. See also: rthalley/dnspython#473 (comment)
|
Agree. The proposed PR to fix this problem is here, for anyone else who wants doh-client to work with dnspython version 2.0 |
aramg
pushed a commit
to opendns/doh-client
that referenced
this pull request
Oct 26, 2020
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Create RdataType and RdataClass enums, and change the constants in the dns.rdatatype and rdataclass modules to use them.
In rdataclass, remove
_by_textand_by_value, and just use the enum methods directly. In rdatatype, this doesn't completely work, because of type registration and the inconveniently named NSAP-PTR type, so keep the existing arrays that mostly duplicate the enum mapping for now.Add
to_enummethods to both, which take either an int or a string, and convert to an enumerated value, if possible (that is, if the type or class is known).Change existing callers that support both
intorstrto useto_enum, and also add this to other places, likedns.rdata.from_wireanddns.rdata.from_text. This doesn't touch thedns.resolverordns.trio.resolvercalls, to avoid conflicts.Marking this as WIP, since while the tests pass, there could still be something missing. Also, it might be possible to remove the duplicate arrays from rdatatype, or do other things in better ways.