Skip to main content

UpstreamExtras

Struct UpstreamExtras 

Source
pub struct UpstreamExtras {
    pub dot_sni: Option<String>,
    pub dot_server: Option<String>,
    pub dot_port: Option<u16>,
    pub doh_url: Option<String>,
    pub doq_server: Option<String>,
    pub doq_port: Option<u16>,
}
Expand description

Optional per-transport extras the caller may supply alongside UpstreamTransport. Populated by super::DnsProxyConfig::upstream_extras in production; tests construct via Default::default() and then set only the fields they care about.

All fields are optional so the do53-udp hot path doesn’t require any extras to function — unused fields incur zero cost.

Fields§

§dot_sni: Option<String>

SNI hostname presented during the DoT TLS handshake. When None, rustls is given the resolver’s IP literal — most public DoT resolvers (1.1.1.1 / 8.8.8.8) ship a cert that covers both the hostname and the IP, but operators with a private resolver will need to set this to the cert’s CN/SAN.

§dot_server: Option<String>

Operator-supplied DoT server host. When set (typically populated from the CELLOS_DNS_UPSTREAM_DOT_SERVER env var), the supervisor pre-resolves this to a SocketAddr and substitutes the proxy’s upstream_addr, so the DoT roundtrip targets the operator’s choice rather than the spec’s do53 resolver. None falls back to the spec resolver’s IP.

Plain string here (not pre-resolved) so the config struct stays transport-agnostic and the resolution step lives in the composition root where DNS bootstrap is allowed.

§dot_port: Option<u16>

Operator-supplied DoT port (RFC 7858 default = 853). Paired with Self::dot_server; when None the supervisor defaults to 853.

§doh_url: Option<String>

DNS-DOH-2 — operator-supplied DoH endpoint URL. When None the DoH forward path defaults to [DEFAULT_DOH_URL]. Sourced from CELLOS_DNS_UPSTREAM_DOH_URL in production. Must be a full https://… URL including the /dns-query path; reqwest validates the scheme on first call and surfaces a typed [UpstreamError::Io(InvalidInput)] if it’s malformed.

§doq_server: Option<String>

DNS-DOQ-2 — operator-supplied DoQ server (IP literal or hostname). None → default 1.1.1.1. Sourced from CELLOS_DNS_UPSTREAM_DOQ_SERVER. Hostnames are passed through to tokio::net::lookup_host (which uses the OS resolver, NOT the supervisor’s bootstrap path) — operators should prefer IP literals for the same reason DoT does (see [parse_dot_target]).

§doq_port: Option<u16>

DNS-DOQ-2 — operator-supplied DoQ port. None → default 853 (RFC 9250). Sourced from CELLOS_DNS_UPSTREAM_DOQ_PORT.

Implementations§

Source§

impl UpstreamExtras

Source

pub fn from_env() -> Self

Read the DoT-specific operator overrides from the process environment.

Recognised env vars:

  • CELLOS_DNS_UPSTREAM_DOT_SERVER — host (IP literal or hostname) for the DoT upstream. Default unset (caller falls back to the spec resolver’s IP, or to 1.1.1.1 if the caller has no spec to fall back on).
  • CELLOS_DNS_UPSTREAM_DOT_PORT — TCP port. Default unset (caller falls back to 853 per RFC 7858).
  • CELLOS_DNS_UPSTREAM_DOT_SNI — explicit SNI hostname. Default unset (rustls receives the resolver’s IP literal as ServerName).

Unparseable port values are silently ignored (the field stays None) rather than failing — operators get the default behaviour instead of a refused cell. Strict parsing is the supervisor’s job at the composition site if it wants to gate startup on a typo.

Trait Implementations§

Source§

impl Clone for UpstreamExtras

Source§

fn clone(&self) -> UpstreamExtras

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 UpstreamExtras

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for UpstreamExtras

Source§

fn default() -> UpstreamExtras

Returns the “default value” for a type. 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