[PR #3158] [MERGED] Intermediate access to the current time via traits #3602

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

📋 Pull Request Information

Original PR: https://github.com/hickory-dns/hickory-dns/pull/3158
Author: @divergentdave
Created: 7/25/2025
Status: Merged
Merged: 8/20/2025
Merged by: @divergentdave

Base: mainHead: david/verification-time-trait


📝 Commits (9)

  • 47a90c8 Hoist getting current time to verify_rrsets()
  • e38bda2 Hoist getting current time to verify_response()
  • 768becd Add Time trait method for current Unix timestamp
  • 36165b3 Use Time trait during DNSSEC verification
  • 0ef1e2f Use Time trait when signing requests
  • 9e95492 Add runtime generic parameter to SqliteAuthority
  • 4ba7a42 Use Time trait during TSIG verification
  • 64bdf30 Add runtime generic parameter to InMemoryAuthority
  • 7b5ede6 Use Time trait during zone signing

📊 Changes

16 files changed (+153 additions, -108 deletions)

View changed files

📝 bin/src/lib.rs (+13 -12)
📝 bin/tests/integration/in_memory.rs (+5 -2)
📝 bin/tests/integration/txt_tests.rs (+5 -4)
📝 crates/proto/src/dnssec/handle.rs (+18 -20)
📝 crates/proto/src/runtime.rs (+11 -0)
📝 crates/proto/src/udp/udp_client_stream.rs (+1 -6)
📝 crates/proto/src/xfer/dns_multiplexer.rs (+2 -10)
📝 crates/server/src/store/in_memory/inner.rs (+10 -5)
📝 crates/server/src/store/in_memory/mod.rs (+52 -20)
📝 crates/server/src/store/sqlite/mod.rs (+24 -22)
📝 tests/integration-tests/tests/integration/client_future_tests.rs (+2 -1)
📝 tests/integration-tests/tests/integration/client_tests.rs (+2 -1)
📝 tests/integration-tests/tests/integration/rfc4592_tests.rs (+1 -1)
📝 tests/integration-tests/tests/integration/sqlite_authority_tests.rs (+5 -2)
📝 tests/integration-tests/tests/integration/truncation_tests.rs (+1 -1)
📝 tests/integration-tests/tests/integration/validating_forwarder_tests.rs (+1 -1)

📄 Description

This replaces all calls to SystemTime::now() and OffsetDateTime::now_utc() with a new method on the Time trait, which is accessible from runtime providers and connection providers. This affects DNSSEC signing, DNSSEC verification, message signing, and message verification. This will give us more flexibility when writing tests for these features. For example, we could store entire responses and verify them with a fixed value for the current time.


🔄 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/3158 **Author:** [@divergentdave](https://github.com/divergentdave) **Created:** 7/25/2025 **Status:** ✅ Merged **Merged:** 8/20/2025 **Merged by:** [@divergentdave](https://github.com/divergentdave) **Base:** `main` ← **Head:** `david/verification-time-trait` --- ### 📝 Commits (9) - [`47a90c8`](https://github.com/hickory-dns/hickory-dns/commit/47a90c84b073f561f8dcd9f9f0892bc962581224) Hoist getting current time to verify_rrsets() - [`e38bda2`](https://github.com/hickory-dns/hickory-dns/commit/e38bda228dbd1c70a00953d94f5e7aefe92423f2) Hoist getting current time to verify_response() - [`768becd`](https://github.com/hickory-dns/hickory-dns/commit/768becdb2511f2850c699aa0bb2f2e42e517307d) Add Time trait method for current Unix timestamp - [`36165b3`](https://github.com/hickory-dns/hickory-dns/commit/36165b3794927d87f474a4431402089eadc0a32a) Use Time trait during DNSSEC verification - [`0ef1e2f`](https://github.com/hickory-dns/hickory-dns/commit/0ef1e2f81fba152232a5405fc05b2f509d26cc86) Use Time trait when signing requests - [`9e95492`](https://github.com/hickory-dns/hickory-dns/commit/9e95492923a1668fdcee492116f3b851d595eea2) Add runtime generic parameter to SqliteAuthority - [`4ba7a42`](https://github.com/hickory-dns/hickory-dns/commit/4ba7a42f7e4edd23ddb2a1aec67fa3905eea5f74) Use Time trait during TSIG verification - [`64bdf30`](https://github.com/hickory-dns/hickory-dns/commit/64bdf30c1aa82082791e914cefda39c0320d5291) Add runtime generic parameter to InMemoryAuthority - [`7b5ede6`](https://github.com/hickory-dns/hickory-dns/commit/7b5ede6df541fdbde6ceb13a5d4af323eb17c301) Use Time trait during zone signing ### 📊 Changes **16 files changed** (+153 additions, -108 deletions) <details> <summary>View changed files</summary> 📝 `bin/src/lib.rs` (+13 -12) 📝 `bin/tests/integration/in_memory.rs` (+5 -2) 📝 `bin/tests/integration/txt_tests.rs` (+5 -4) 📝 `crates/proto/src/dnssec/handle.rs` (+18 -20) 📝 `crates/proto/src/runtime.rs` (+11 -0) 📝 `crates/proto/src/udp/udp_client_stream.rs` (+1 -6) 📝 `crates/proto/src/xfer/dns_multiplexer.rs` (+2 -10) 📝 `crates/server/src/store/in_memory/inner.rs` (+10 -5) 📝 `crates/server/src/store/in_memory/mod.rs` (+52 -20) 📝 `crates/server/src/store/sqlite/mod.rs` (+24 -22) 📝 `tests/integration-tests/tests/integration/client_future_tests.rs` (+2 -1) 📝 `tests/integration-tests/tests/integration/client_tests.rs` (+2 -1) 📝 `tests/integration-tests/tests/integration/rfc4592_tests.rs` (+1 -1) 📝 `tests/integration-tests/tests/integration/sqlite_authority_tests.rs` (+5 -2) 📝 `tests/integration-tests/tests/integration/truncation_tests.rs` (+1 -1) 📝 `tests/integration-tests/tests/integration/validating_forwarder_tests.rs` (+1 -1) </details> ### 📄 Description This replaces all calls to `SystemTime::now()` and `OffsetDateTime::now_utc()` with a new method on the `Time` trait, which is accessible from runtime providers and connection providers. This affects DNSSEC signing, DNSSEC verification, message signing, and message verification. This will give us more flexibility when writing tests for these features. For example, we could store entire responses and verify them with a fixed value for the current time. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-16 11:52:36 +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#3602
No description provided.