dnspython icon indicating copy to clipboard operation
dnspython copied to clipboard

New RRTYPE in IANA registry

Open paulehoffman opened this issue 1 year ago • 3 comments

Motivation There is a new RRTYPE in the IANA RRTYPES registry (https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml). It is WALLET (262), and its display format and wire format are the same (a bunch of ASCII characters).

Describe the solution you'd like. This should be added to any RRTYPE tables.

paulehoffman avatar Jun 22 '24 17:06 paulehoffman

working on this one... note that even though the description says there is no escaping in the value, escaping may still apply due to DNS zonefile rules. e.g. if the value on the wire were EXAMPLE abcd;efgh then the value in zonefile form would be "EXAMPLE abcd;efgh" or EXAMPLE abcd\;efgh as the ; needs to be in a quoted string or escaped to avoid starting a comment.

dnspython will check that there is at least one space and to break things out into the "currency" and "address" fields. When it generates text, dnspython will emit a single quoted string. dnspython ensures that there is no space in the currency abbreviation (as otherwise the wire format is ambiguous), but does allow spaces in the address.

>>> import dns.rdata
>>> r = dns.rdata.from_text("IN", "WALLET", "EXAMPLE abcdefgh")
b'EXAMPLE abcdefgh'
>>> r.currency
b'EXAMPLE'
>>> r.address
b'abcdefgh'
>>> r.to_text()
'"EXAMPLE abcdefgh"'
>>> r.to_wire()
b'EXAMPLE abcdefgh'

rthalley avatar Jun 30 '24 22:06 rthalley

Many apologies; I thought I updated this. Many people yarped on the DNSOP mailing list (and two developers in private), and I put in an update to make it just use TXT record processing. I updated all the other places I put this, but I forgot here. The RRTYPE reviewer has been slow to respond to the update (which is his right), but the update should be out soon.

I'll pull your code and fix it once he has published the update. Again, apologies for not stopping you from this work. I owe you some coding at some point...

paulehoffman avatar Jun 30 '24 23:06 paulehoffman

No worries, I didn't spend much time. No need to do anything, I can make it TXT easily.

rthalley avatar Jun 30 '24 23:06 rthalley

The registration for WALLET has been updated; see https://www.iana.org/assignments/dns-parameters/WALLET/wallet-completed-template dated 2024-06-24

paulehoffman avatar Jul 01 '24 19:07 paulehoffman

I much prefer this format, will add support soon.

rthalley avatar Jul 01 '24 19:07 rthalley

merged

rthalley avatar Jul 03 '24 17:07 rthalley

🙏🏾

paulehoffman avatar Jul 03 '24 17:07 paulehoffman