Commit Graph
973 Commits
Author SHA1 Message Date
Philip Homburg 90cc96d632 Add support to client transports for requests that may result in multiple
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.
2024-09-04 14:03:12 +02:00
Ximon EighteenandGitHub 851d261d31 Update changelog. 2024-09-03 16:27:20 +02:00
Ximon EighteenandGitHub ce74445279 Service enhancement prerequisites for XFR support (#369)
* 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.
2024-09-03 15:39:52 +02:00
Martin Hoffmann ed6110517e Update changelog. 2024-08-20 14:17:39 +02:00
D.K.L. BreitlingandGitHub 95096cbb21 Change TXT record Eq, Ord, Hash to use octets (#374)
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).
2024-08-20 14:15:14 +02:00
Ximon EighteenandGitHub 733beb4a15 Fix start_answer() doc string. (#347)
Saying that `start_answer()` "adds what it can" implies that on error what
was added is preserved. That is however not true.
2024-08-14 12:31:08 +02:00
Martin Hoffmann 14f857fbc0 Documentation formatting fixes. 2024-07-29 12:03:14 +02:00
Martin Hoffmann a9572a83ff Documentation formatting fixes. 2024-07-29 11:47:03 +02:00
Martin Hoffmann 0df08b90d7 Update changelog. 2024-07-29 11:37:34 +02:00
Ximon EighteenandGitHub 67f53ea109 Service layering (#307)
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.
2024-07-29 11:34:32 +02:00
Ximon EighteenandGitHub e7816fc0a9 Update changelog. 2024-07-24 18:44:15 +02:00
Ximon EighteenandGitHub ca09f9d3bd Update changelog. 2024-07-24 18:43:35 +02:00
Ximon EighteenandGitHub bc21da9107 Update changelog. 2024-07-24 18:41:00 +02:00
Ximon EighteenandGitHub ecb4507a5e Allow glue (e.g. A/AAAA) at zone cut. (#363)
Also add a Rtype::is_glue() helper fn and check for the inverse case of our previous fix as well, namely adding a zone cut where glue pre-exists.
2024-07-24 18:29:13 +02:00
Ximon EighteenandGitHub b74e963e0e Update changelog. 2024-07-24 15:54:41 +02:00
Ximon EighteenandGitHub 0659c8f765 Improved zonefile parsing error messages. (#362)
* 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`.
2024-07-24 15:31:44 +02:00
Ximon EighteenandGitHub d6261204c8 Update changelog. 2024-07-23 20:40:49 +02:00
Ximon EighteenandGitHub 6b761f9a1f Fix off-by-one error in Dgram client retry count checking. (#354)
This commit also fixes a typo in the word "capped" in the doc strings.
2024-07-23 20:37:53 +02:00
Martin HoffmannandGitHub 808af2a671 Fix TSIG server sequence signing and switch test to dig. (#356)
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.
2024-07-23 15:00:14 +02:00
Philip Homburg 06a6a11484 Update ChangeLog 2024-07-23 14:31:39 +02:00
Philip Homburg b29dbee6e7 Option to keep stream connections open without Keepalive option. (#341) 2024-07-23 14:27:15 +02:00
Martin Hoffmann 242b48cd36 Update changelog. 2024-07-23 11:05:22 +02:00
Ximon EighteenandGitHub d6c6d0b2f8 Add OptRcode::is_ext() to test if an Rcode is extended per RFC 6891. (#358) 2024-07-23 10:55:41 +02:00
Ximon EighteenandGitHub f2dfbff0d0 Simple case-sensitive FromStr impl for Rcode and OptRcode. (#357)
* Simple case-sensitive FromStr impl for Rcode and OptRcode.
2024-07-22 18:08:20 +02:00
Ximon EighteenandGitHub ab405adc9b "NOAUTH" -> "NOTAUTH" to match the enum variant name. (#360) 2024-07-22 17:58:44 +02:00
Martin Hoffmann 6fe2e7c31b Update changelog. 2024-07-09 15:35:23 +02:00
Ximon EighteenandGitHub 0513eaa703 Add an optional push limit to MessageBuilder. (#348)
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.
2024-07-09 15:33:20 +02:00
Martin Hoffmann 12c99b76e6 Update changelog. 2024-06-27 11:47:44 +02:00
Ximon EighteenandGitHub ec5cb5bbb8 Re-enable and fix the Stelline cookies test (#336)
- 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.
2024-06-27 11:22:02 +02:00
Terts DiepraamandGitHub a3ccb52b38 Merge pull request #342 from NLnetLabs/mock-instant-dev
Move `mock_instant` to `dev-dependencies`
2024-06-26 12:14:57 +02:00
Terts Diepraam b16949e478 move mock_instant to dev-dependencies 2024-06-21 16:07:06 +02:00
Martin HoffmannandGitHub c421dc89f2 Proposal for a MSRV policy. (#330)
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.
2024-06-20 14:34:15 +02:00
Terts DiepraamandGitHub 11aaef2d66 Refactor rtypebitmapbuilder to not use unsafe operations (#327) 2024-06-17 12:10:16 +02:00
Philip-NLnetLabsandGitHub 1777b10c96 Net client more docs (#339)
Adds #![warn(clippy::missing_docs_in_private_items)] to src/net/client/mod.rs
and missing internal documentation.
2024-06-17 12:01:02 +02:00
Martin Hoffmann 4d8cf0eefd Merge branch 'main' of github.com:NLnetLabs/domain 2024-06-17 12:00:27 +02:00
Martin Hoffmann c2a76720ee Update changelog. 2024-06-17 12:00:13 +02:00
Philip-NLnetLabsandGitHub c64e2189d9 Solve problem with slow TCP or TLS connections (#338)
This PR solves an issue with slow stream connection by not waiting the
first time an underlying stream transport reports that it is closed.
2024-06-17 11:58:10 +02:00
Martin HoffmannandGitHub fd78578e84 Fix a new nightly warning involving never and unit types. (#337)
This PR fixes a new warning “this function depends on never type fallback
being ()” by removing some code without effect.
2024-06-17 11:36:21 +02:00
Martin Hoffmann 6d4f731c1e Update changelog. 2024-06-13 14:07:04 +02:00
Philip-NLnetLabsandGitHub 97bfa2c9f8 DNSSEC validator (#328)
This PR adds a DNSSEC validator.
2024-06-13 14:05:56 +02:00
Martin Hoffmann 95bbd4baa9 Update changelog. 2024-06-12 11:20:00 +02:00
Martin HoffmannandGitHub 750d1a709f Fix TSIG position calculation if there are other additional records. (#333)
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.
2024-06-12 11:18:32 +02:00
Martin HoffmannandGitHub baea42e5e7 Add a first version of the contribution guidelines. (#332) 2024-06-10 16:52:34 +02:00
Terts DiepraamandGitHub d5b688b0d5 Removed unnecessary clippy allows and rustfmt suggestions (#331) 2024-06-10 14:11:22 +02:00
Martin Hoffmann f1e6062019 Update changelog. 2024-06-03 17:03:01 +02:00
Martin HoffmannandGitHub b65cc98d7f Release 0.10.1. (#326)
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])
v0.10.1
2024-06-03 16:59:41 +02:00
Martin Hoffmann 161339b76f Update README (a bit). 2024-06-03 16:29:51 +02:00
Martin Hoffmann 5f96282389 Update changelog. 2024-06-03 16:27:42 +02:00
Terts DiepraamandGitHub dab2a90563 Refactor pointer casts to transmutes and annotate with repr(transparent) (#324)
This PR adds #[repr(transparent)] to various wrapper types and replaces
pointer cases with mem::transmute.
2024-06-03 16:23:41 +02:00
Minghang ChenandGitHub d4f120a205 allow create real resource record from unsized data (#325)
This is another fix for missing `?Sized` bound in the 0.10.
2024-06-03 15:39:52 +02:00