This PR adds a few trait impls and documentation.
Specifically:
* Add blanket `SendRequest` and `SendRequestMulti` impls for boxes.
* Add `Display` impl to `tsig::Key`.
* Add an `as_any` method and `Clone` and `Debug` impls to various zonetree
types.
* Add `AsRef<dyn ZoneStore>` to `Zone`.
Add XFR middleware and:
- Fixes a bug where the incorrect owner name was passed to the zone walker callback.
- New `ixfr-client.rs` example.
- Updated `serve-zone.rs` example demonstrating TSIG authenticated XFR and NOTIFY middlewares.
- Additional From impls for CallResult.
- Renames ZoneDiff to InMemoryZoneDiff.
- Renames ZoneDiffBuilder to InMemoryZoneDiffBuilder.
- Introduces new ZoneDiff and related traits.
- Adds AnswerContent::first().
Add RFC 1996 "slave" side minimalistic NOTIFY request support, delegating the actual work to a caller supplied helper that implements a new Notifiable trait.
Major changes:
- Add ZoneUpdater, ZoneDiffBuilder and ZoneDiff types.
Other changes:
- ZoneUpdate:
- Renamed the inner record type of ZoneUpdate from XfrRecord to ParsedRecord as it is not XFR specific.
- Added variant ZoneUpdate::DeleteAllRecords which is now emitted at the start of an AXFR update by XfrZoneUpdateIterator.
- Removed the superfluous serial number data members associated with some ZoneUpdate variants.
- zonetree::in_memory:
- Factor out ZoneApex::prepare_name() as zonetree::util::rel_name_rev_iter() as it is also now used by ZoneUpdater.
- Improve some naming, e.g. there was mix of terms remove and clean, all references to clean have now been renamed to remove based names instead.
- Altered the logic in Versioned::remove_all() (formerly Versioned::clean()) as it made destructive changes to the zone that would have impacted readers of the current zone version while the new zone version was being created.
- Adds an arc_into_inner() function for Rust <1.70.0 which doesn't have Arc::into_inner().
- Additional trait bounds where needed.
- Removed some unused code.
- Add TSIG response signing middleware.
- Update Stelline server integration tests to use the new TSIG middleware.
- Add TSIG Stelline test recipe.
- TSIG module changes:
- Derive Clone for Key.
- Added Key::compose_len() for determining how many response bytes to reserve.
- Added ClientTransaction::wrapped_key(), ClientSequence::wrapped_key() and SigningContext::wrapped_key() to access the real underlying "wrapped" key type.
- Added From<ServerTransaction<K>> for ServerSequence<K>.
- Various minor RustDoc improvements.
- Make Time48 obey mock (predictable and controllable) time so that TSIG signing uses mock time during Stelline tests.
Other:
- Remove unnecessary Unpin bounds on net::server::message::Request.
- Remove unnecessary Clone bound on impl SendRequest for net::client::dgram::Connection.
- Remove unnecessary mutex lock on middleware post-processing response state and rename PostprocessingConfig to PostprocessingState to better reflect its mutable nature.
- Don't set the AA flag on test service responses as (a) actual zone serving doesn't do this yet and this still needs fixing, and (b) it violates the expectations of the TSIG Stelline test that verifies at a byte level the TSIG response signature.
---------
Co-authored-by: Philip Homburg <philip@nlnetlabs.nl>
Co-authored-by: Philip-NLnetLabs <93709748+Philip-NLnetLabs@users.noreply.github.com>
Co-authored-by: Terts Diepraam <terts.diepraam@gmail.com>
- Added a simple UDP client that doesn't interfere with requests before sending (for TSIG testing).
- Added support for receiving multiple responses (for XFR testing).
- Added support for connection timeout errors
- Added support for connection termination errors (for EDNS testing).
- Added support for specifying the TSIG key to use (for TSIG testing).
- Added support for $ORIGIN in zone file fragments.
- Simplified rcode checking and use it instead of the yxrrset BADCOOKIE hack.
- In memory channel changes:
- Fixed a trace message that incorrectly referred to client instead of server.
- Fixed a too-tight connection read loop that was preventing Tokio task switching.
- Added connection shutdown detection.
- Fixed incorrect setting of TCP mode to true when UDP mode was requested.
responses. (#377)
This adds ComposeRequestMulti and other *Multi types. The main change is to
the stream transport, which is the only transport that implements
SendRequestMulti.
* Adds support for indicating to downstream Service impls that a certain number of bytes should be reserved (to make space for adding a TSIG RR or EDNS options during middleware post-processing).
* Adds support for strongly typed passing of arbitrary metadata between middleware that produces a type and middleware that consumes the type (e.g. passing the used TSIG key name from TSIG middleware to XFR middleware).
* Replaces the blanket impl Service for Arc with a more general impl Service for Deref.
* Removes the blanket impl Service for fn as I have multiple times been blocked from defining some other Service impl because the fn one matches, because its presence can cause very confusing compiler error messages if your impl Service for T is not quite in sync with the signature of your other impl T blocks.
* Adds an "enabled" flag to the CookiesMiddlewareSvc making it easier to create a service stack with optionally enabled layers based on runtime configuration.