[PR #2498] [MERGED] Make serde use RFC names for enum variants #3087

Closed
opened 2026-03-16 11:24:29 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hickory-dns/hickory-dns/pull/2498
Author: @jcgruenhage
Created: 10/8/2024
Status: Merged
Merged: 2/18/2025
Merged by: @djc

Base: mainHead: serde_tsig_algorithm_names


📝 Commits (2)

  • de8ac44 Make serde use RFC names for enum variants
  • be2834e Rename TLSA certificate usages based on RFC 7218

📊 Changes

9 files changed (+100 additions, -32 deletions)

View changed files

📝 bin/tests/integration/txt_tests.rs (+1 -1)
📝 crates/proto/src/dnssec/algorithm.rs (+1 -0)
📝 crates/proto/src/dnssec/mod.rs (+13 -8)
📝 crates/proto/src/dnssec/nsec3.rs (+1 -0)
📝 crates/proto/src/dnssec/rdata/tsig.rs (+10 -0)
📝 crates/proto/src/rr/rdata/caa.rs (+3 -0)
📝 crates/proto/src/rr/rdata/sshfp.rs (+2 -0)
📝 crates/proto/src/rr/rdata/svcb.rs (+14 -0)
📝 crates/proto/src/rr/rdata/tlsa.rs (+55 -23)

📄 Description

Right now, when using hmac-sha256 and loading it from a config file using the serde interface automatically derived for these, I need to write HmacSha256 instead of the name used in the RFC. This is unexpected and potentially confusing to users.

This PR makes it so that the old names based on the enum variants don't work anymore, and the names specified in the RFC start working. Alternatively, we could use serde(alias = "<name here>") instead of serde(rename = "<name here>"), which would allow the RFC names to work but wouldn't break existing users.

In my opinion, we should push for correct names, and as long as hickory isn't at a 1.0, breaking changes like this should potentially be expected.

I'll be looking through the code base some more to see if I find more occurrences of this and will put it into this PR as well, but I thought I should probably open this PR early so that discussion on alias vs rename can start already.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hickory-dns/hickory-dns/pull/2498 **Author:** [@jcgruenhage](https://github.com/jcgruenhage) **Created:** 10/8/2024 **Status:** ✅ Merged **Merged:** 2/18/2025 **Merged by:** [@djc](https://github.com/djc) **Base:** `main` ← **Head:** `serde_tsig_algorithm_names` --- ### 📝 Commits (2) - [`de8ac44`](https://github.com/hickory-dns/hickory-dns/commit/de8ac44b6137920d9df9e55bc433cb580cd67dcb) Make serde use RFC names for enum variants - [`be2834e`](https://github.com/hickory-dns/hickory-dns/commit/be2834eaaef3023e9b66fe19aaafdcaa4ba13ddc) Rename TLSA certificate usages based on RFC 7218 ### 📊 Changes **9 files changed** (+100 additions, -32 deletions) <details> <summary>View changed files</summary> 📝 `bin/tests/integration/txt_tests.rs` (+1 -1) 📝 `crates/proto/src/dnssec/algorithm.rs` (+1 -0) 📝 `crates/proto/src/dnssec/mod.rs` (+13 -8) 📝 `crates/proto/src/dnssec/nsec3.rs` (+1 -0) 📝 `crates/proto/src/dnssec/rdata/tsig.rs` (+10 -0) 📝 `crates/proto/src/rr/rdata/caa.rs` (+3 -0) 📝 `crates/proto/src/rr/rdata/sshfp.rs` (+2 -0) 📝 `crates/proto/src/rr/rdata/svcb.rs` (+14 -0) 📝 `crates/proto/src/rr/rdata/tlsa.rs` (+55 -23) </details> ### 📄 Description Right now, when using `hmac-sha256` and loading it from a config file using the serde interface automatically derived for these, I need to write `HmacSha256` instead of the name used in the RFC. This is unexpected and potentially confusing to users. This PR makes it so that the old names based on the enum variants *don't* work anymore, and the names specified in the RFC start working. Alternatively, we could use `serde(alias = "<name here>")` instead of `serde(rename = "<name here>")`, which would allow the RFC names to work but wouldn't break existing users. In my opinion, we should push for correct names, and as long as hickory isn't at a 1.0, breaking changes like this should potentially be expected. I'll be looking through the code base some more to see if I find more occurrences of this and will put it into this PR as well, but I thought I should probably open this PR early so that discussion on `alias` vs `rename` can start already. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-16 11:24:29 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hickory-dns#3087
No description provided.