Skip to main content

DnsProxyConfig

Struct DnsProxyConfig 

Source
pub struct DnsProxyConfig {
Show 16 fields pub bind_addr: SocketAddr, pub upstream_addr: SocketAddr, pub hostname_allowlist: Vec<String>, pub allowed_query_types: Vec<DnsQueryType>, pub cell_id: String, pub run_id: String, pub policy_digest: Option<String>, pub keyset_id: Option<String>, pub issuer_kid: Option<String>, pub correlation_id: Option<String>, pub upstream_resolver_id: String, pub upstream_timeout: Duration, pub tcp_idle_timeout: Duration, pub dnssec_validator: Option<Arc<DataplaneDnssecValidator>>, pub transport: UpstreamTransport, pub upstream_extras: UpstreamExtras,
}
Expand description

Configuration for run_one_shot.

All fields are owned (no borrows / lifetimes) so the supervisor can build this once and pass it into a spawn_blocking thread without lifetime gymnastics.

Fields§

§bind_addr: SocketAddr

Address the listener socket is bound to. Used only for diagnostic logs; the caller passes the actual pre-bound socket in.

§upstream_addr: SocketAddr

Upstream resolver address (must be a do53-udp resolver from dnsAuthority.resolvers[]).

§hostname_allowlist: Vec<String>

Lowercased hostname allowlist. Entries may have a single leading *. for subdomain wildcards (e.g. *.cdn.example.com matches foo.cdn.example.com but not cdn.example.com itself).

§allowed_query_types: Vec<DnsQueryType>

Permitted query types. Empty = default [A, AAAA, CNAME, HTTPS].

§cell_id: String

Cell identifier (mirrors lifecycle.started.cellId).

§run_id: String

Run identifier (mirrors lifecycle.started.runId).

§policy_digest: Option<String>

Optional policyDigest to bind into emitted events.

§keyset_id: Option<String>

Optional keysetId to bind into emitted events.

§issuer_kid: Option<String>

Optional issuerKid to bind into emitted events.

§correlation_id: Option<String>

Optional correlationId to bind into emitted events.

§upstream_resolver_id: String

Resolver identifier — mirrors a dnsAuthority.resolvers[].resolverId. Stamped into events on the allow path so audit can attribute the upstream answer to a declared resolver.

§upstream_timeout: Duration

Round-trip timeout for the upstream forward. On timeout the proxy returns SERVFAIL to the workload and emits reasonCode: upstream_failure.

§tcp_idle_timeout: Duration

SEAM-1 / L2-04 Slot A5 — per-connection idle timeout for the workload-facing TCP/53 listener. Applied as set_read_timeout / set_write_timeout on every accepted TCP stream so a stuck workload cannot pin a worker thread forever. A zero Duration is treated as “unset” and falls back to [DEFAULT_TCP_IDLE_TIMEOUT] (30s, matching the UDP SERVFAIL ceiling). Only consulted by run_tcp_one_shot; ignored by the UDP-only run_one_shot entry point.

§dnssec_validator: Option<Arc<DataplaneDnssecValidator>>

SEC-21 Phase 3h.1 — optional dataplane DNSSEC validator. None means the cell’s DnsAuthority did not request DNSSEC validation on the dataplane (mode = off); the proxy hot path is unchanged. Some(_) means every allowlisted query is post-validated through the validator before the upstream answer is relayed to the workload — see dnssec::DataplaneDnssecValidator for the full behaviour matrix.

§transport: UpstreamTransport

SEC-21 Phase 3h.2 / T2.B Slot A6 — upstream transport selector. Default = Do53Udp so the existing UDP-only behaviour is the no-op upgrade path. See upstream::UpstreamTransport for the full dispatch matrix and upstream::forward for the hot-path entry.

§upstream_extras: UpstreamExtras

A6 — per-transport extras (DoT SNI, etc.). Unused when transport == Do53Udp; populated by callers selecting DoT/DoH/DoQ.

Trait Implementations§

Source§

impl Clone for DnsProxyConfig

Source§

fn clone(&self) -> DnsProxyConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DnsProxyConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more