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.
This PR fixes the impls of comparision-related traits for TXT record
data to directly compare the underlying octets (which contain the wire
format if the record data).
This PR changes the design for services by removing all of the existing
middleware types and re-implementing the middleware processors as middleware
services that take an "upstream" service to pass requests on to.
* Report zone file problems as explanatory messages with supporting data instead of just logging enum variant names.
* Return the set of errors on parsing failure with `TryFrom<inplace::Zonefile> for Zonefile`, ala how it works for `TryFrom<Zonefile> for ZoneBuilder`.
This PR fixes an issue with signature generation in the TSIG server
sequence, i.e., when the answer to a request signed with a TSIG key has
multiple messages.
This issue wasn’t caught by the interop test since drill happily consumed to
wrong signatures. Consequently, this PR switches the test to use dig which
won’t error out but at least complain about them in the output.
This is useful when wanting to "reserve" space such that pushes at one point in the code to the message will leave behind enough room for subsequent pushes later, e.g. of OPT or TSIG RRs.
- Re-enable the cookies Stelline test and fix `CookiesMiddlewareProcessor` to allow requests with invalid cookies to proceed if they are authenticated or not required to authenticate.
- Add support for net blocks in the deny list of the cookie middleware processor, ala Unbound, otherwise the deny list is difficult to use beyond a few simple specific IP addresses.
- Improvements to the Stelline server test support needed by the Stelline cookies test:
- Advance mock system time in the Stelline server tests.
- Move Stelline server tests under src/ to permit #cfg(test) based swap out of real system time for mock system time.
- Use the thread_local version of mock_instant to ensure parallel mock time dependent tests don't interfere with each other (such tests also use tokio::time which only works if they run in a single thread).
- Set mock system time to start at zero for each Stelline server test (as expected by the cookies .rpl test script).
- Pass the IP address of the test client to the server so that the cookies middleware can match it against its deny list.
This PR proposes a revised policy for dealing with minimum supported Rust
versions.
It suggests to keep the rust-version field in Cargo.toml at the oldest Rust
version that is able to build with minimal dependency versions and all
features enabled. In addition, the Rust version necessary to build with
latest dependencies is provided in the README and as a comment in
Cargo.toml. Both these versions are checked in the CI workflow.
The reasoning behind the proposal is that rust-version sets a hard limit on
the version, so it should be chosen as low as possible. While technically it
could be lower with a subset of the features selected, this feels like a
slippery slope and setting the version with all features selected feels like
an acceptable compromise.
Only documenting the version that is necessary to build with latest
dependencies isn’t ideal but at least provides some guidance as to what to
choose for people who go look for some.
This PR fixes a mistake in the tsig module while calculating the start of
the TSIG record when there were other records in the additional section,
causing the TSIG code to fail if OPT records were in use.
New
* Allow AllRecordData’s parsing impls to accept an unsized [u8] as the
source octets. ([#310] by [@xofyarg])
* Made `sign::records::FamilyName` public. ([#312] by [@achow101])
* Added an impl of `FromStr` for `Question`. ([#317])
Bug fixes
* Accept an empty record type bitmap when scanning NSEC/NSEC3 data.
([#310] by [@xofyarg])
* Fix serialization of ProtoRrsig to conform with RFC 4034. ([#313 by
[@achow101])
* Add `?Sized` bounds to `Message::is_answer` and `ParsedRecord::to_record`.
([#318] by [@xofyarg], [#325] by [@hunts])
* Bring back `MessageBuilder::as_target`. ([#318] by [@xofyarg])
* Bring back `impl FreezeBuilder for StaticCompressor`. ([#318] by [@xofyarg])
* `sign::records::RecordsIter::skip_before` now stops at the first name in
zone even if the apex itself doesn’t appear. ([#314] by [@achow101])
* Fix a counting error in `SliceLabelsIter::next` that broke compression
via `StaticCompressor`. ([#321] by [@hunts])
Unstable features
* New unstable feature `unstable-stelline` for the Stelline testing
framework as a “normal” module of _domain._ ([#315])
* Renamed the domain name types in `zonetree` from `Dname` to `Name`.
([#308])
Other changes
* The minimum Rust version is now 1.78. ([#320])