1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//! RFC 5936 AXFR and RFC 1995 IXFR request handling middleware.
//!
//! This module provides the [`XfrMiddlewareSvc`] service which responds to
//! [RFC 5936] AXFR and [RFC 1995] IXFR requests to perform entire or
//! incremental difference based zone transfers.
//!
//! Determining which requests to honour and with what data is delegated to a
//! caller supplied implementation of the [`XfrDataProvider`] trait.
//! [`XfrDataProvider`] implementations for [`Zone`] and [`ZoneTree`] are
//! provided allowing those types to be used as-is as XFR data providers with
//! this middleware service.
//!
//! # Requiring TSIG authenticated XFR requests
//!
//! To require XFR requests to be TSIG authenticated, implement
//! `XfrDataProvider<Option<Key>>`, extract the key data using
//! [`Request::metadata()`] and verify that a TSIG key was used to sign the
//! request, and that the name and algorithm of the used key are acceptable to
//! you.
//!
//! You can then use your [`XfrDataProvider`] impl with [`XfrMiddlewareSvc`],
//! and add [`TsigMiddlewareSvc`] directly before [`XfrMiddlewareSvc`] in the
//! middleware layer stack so that the used `Key` is made available from the
//! TSIG middleware to the XFR middleware.
//!
//! # Limitations
//!
//! * RFC 1995 2 Brief Description of the Protocol states: _"To ensure
//! integrity, servers should use UDP checksums for all UDP responses."_.
//! This is not implemented.
//! * RFC 1995 5 Purging Strategy states: _"Information about older versions
//! should be purged if the total length of an IXFR response would be longer
//! than that of an AXFR response."_. This is not implemented.
//! * RFC 1995 6 Optional Condensation of Multiple Versions states: _"An IXFR
//! server may optionally condense multiple difference sequences into a
//! single difference sequence, thus, dropping information on intermediate
//! versions."_. This is not implemented.
//!
//! [RFC 5936]: https://www.rfc-editor.org/info/rfc5936
//! [RFC 1995]: https://www.rfc-editor.org/info/rfc1995
//! [`Request::metadata()`]: crate::net::server::message::Request::metadata
//! [`TsigMiddlewareSvc`]:
//! crate::net::server::middleware::tsig::TsigMiddlewareSvc
//! [`XfrDataProvider`]: super::data_provider::XfrDataProvider
//! [`Zone`]: crate::net::zonetree::Zone
//! [`ZoneTree`]: crate::net::zonetree::ZoneTree
pub use ;
pub use XfrMiddlewareSvc;