- Automatically determine the MSRV.
- Rebuild 'main' every week to catch environmental changes.
- Run Clippy in a dedicated job to be more parallel.
- Only run it on Ubuntu.
- Introduce caching of '~/.cargo' and '/target'.
- Only save it on 'main', but restore it in all other jobs.
- Preserve OpenSSL-excluding behavior for Windows.
The client cache depends on the moka crate. Make the client cache optional to allow the use of the client transports without depending on moka.
---------
Co-authored-by: Terts Diepraam <terts.diepraam@gmail.com>
* Add missing required features to serve-zone example.
* Fix required-features listed in Cargo.toml for the query-zone example.
* Fix required-features listed in Cargo.toml for the client-transports example.
* Echo all run commands to check examples, and exit immediately on error (also ensures a final success doesn't cause previous failures to be ignored).
* Fix required-features listed in Cargo.toml for the server-transports example.
* Remove unused import except when feature is enabled that needs it.
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 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>
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 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`.
- 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 updates all dependencies to their latest major version. This
requires some changes to the examples using tokio-rustls.
This PR also updates the minimum supported Rust version to 1.70.
This is a breaking change.
This PR renames all types and functions that refer to domain name from using
the term “dname” to just “name.” For instance, Dname becomes Name, ToDname
becomes ToName, and ToDname::to_dname becomes ToName::to_name.
This annoyingly wide-reaching change is motivated by a clash with the DNAME
record type that would always be confusing. So we rather do it now.
This is a really breaking change. Apologies.
This PR adds zonefile/parsed.rs, zonetree/ and related examples/, which
together enable, and show a library user how, to go from a zone file in
presentation format to an in-memory tree of zones which can be queried to
provide an answer, or walked (iterated over).
The tree also supports versioned write operations and a trait based zone
implementation allowing for the in-memory tree for a zone to instead be some
other (a)synchornous backing store (as demonstrated by the mysql-zone.rs
example).
The zonetree module is feature-gated behind the unstable-zonetree feature.
This PR adds an unstable net::server module that enables the creation of UDP
and TCP DNS servers using base transport server, middleware and service building blocks.
This PR changes the types for the IANA registered values into structs
wrapping underlying integer types and provides the values as constants. This
mostly just changes the spelling of those values. However, it also required
some re-wiring of the type generation macros for record data and opt data
since the type names and value names differ now.
This is a breaking change.
This PR adds experimental support for client transport of DNS messages.
It also adds a new concept of unstable features which gate code that can introduce breaking changes also in non-breaking releases.
This PR refactors the existing support for OPT options. It does the
following things:
o Changes all option data types to ensure their wire format is at most
65,535 octets long. This requires changing the signatures of some
creator functions. Their naming scheme and signatures are also changed
to follow the pattern established with record data.
o Renamed `UnknownOptData::from_octets` to `new` and return a result.
o Completely redesigns DNS cookie options, adding support for standard
server cookies introduced in RFC 9018.
o Change the type of `ExtendedError`’s text to `Str<Octs>` and change the
return type of `set_text` to `()`.
o Changed the type `TcpKeepalive`’s content to a newtype `IdleTimeout` to
make it easier to convert to and from durations.
o Changes Padding to just contain the padding octets and drop
`PaddingMode`. Instead, the methods on OptBuilder` should be used to
add padding.
This is a breaking change.
This commit swaps the traits and types defined in `base::octets` for their
equivalent in the `octseq` trait. These are mostly the same except that they
facilitate Generic Associated Types as stabilized in Rust 1.65. This results
in subtly changed trait bounds, though mostly these should be invisible to
the user.
One notable change is that `octseq` makes the error type of the
`OctetsBuilder` generic and uses `Infallible` for those types where
appending data will never fail (which, for most users, is all of them). It
provides methods for either case and we are mirroring these in `domain`.
While this means that converting you code to using the PR will require some
work, that work should mostly be removing unwraps – which is nice.
We’re using the opportunity to clean up a few more things that have crept
into the code over time. A list of which will be added here:
* The range, slice, and split methods on the domain name types have
changed. They have been merge into a single method taking ranges – except
for those on `Dname` that require type changes. The split methods now
take references and don’t change `self` anymore. This is somewhat
required by the limitations imposed by the new `Octets` trait but feels
better, anyway.
* The `Parse`, `Compose`, and `Scan` traits have been demoted to mere
extension traits for foreign types (primarily the built-in integers, so
that you can do things like `u16::parse`). All other types now simply have
methods matching the patterns. Where generics are necessary, dedicated
traits have been added. E.g., there now are `ParseRecordData` and
`ComposeRecordData` traits that are implemented by all record data types.
* Composing of record data and options has been switched to a scheme where
the size is predetermined whenever possible instead of composing the data
and then updating the length after. Since this is not possible for record
data that uses compressed names when compression is actually in use, the
old scheme is still used in this particular case.
This commit completely redesigns zone file parsing. The primary change is to
convert the scanner into a trait in order to allow multiple zone parser
implementations for different sources and purposes. A number of changes had
to be made in order to make this possible.
The commit also contains an initial implementation of a scanner that modifies
data in-place and can thus returned parsed data with only a minimal amount
of additional allocations. While working, this scanner is more a
proof-of-concept at this point to ensure that the API design is sound.
This commit is based on ideas and code proposed by @not-my-profile in #106.
This commit increases the minimal supported Rust version to 1.59.0.