ResolverContext

Struct ResolverContext 

Source
pub struct ResolverContext {
Show 14 fields pub config_path: String, pub config_root: Option<Arc<Value>>, pub base_path: Option<PathBuf>, pub resolution_stack: Vec<String>, pub allow_http: bool, pub http_allowlist: Vec<String>, pub http_proxy: Option<String>, pub http_proxy_from_env: bool, pub http_ca_bundle: Option<PathBuf>, pub http_extra_ca_bundle: Option<PathBuf>, pub http_client_cert: Option<PathBuf>, pub http_client_key: Option<PathBuf>, pub http_client_key_password: Option<String>, pub http_insecure: bool,
}
Expand description

Context provided to resolvers during resolution

Fields§

§config_path: String

The path in the config where this resolution is happening

§config_root: Option<Arc<Value>>

The config root (for self-references)

§base_path: Option<PathBuf>

The base path for relative file paths

§resolution_stack: Vec<String>

Resolution stack for circular reference detection

§allow_http: bool

Whether HTTP resolver is enabled

§http_allowlist: Vec<String>

HTTP URL allowlist (glob patterns)

§http_proxy: Option<String>

HTTP proxy URL (e.g., “http://proxy:8080” or “socks5://proxy:1080”)

§http_proxy_from_env: bool

Whether to auto-detect proxy from environment variables (HTTP_PROXY, HTTPS_PROXY, NO_PROXY)

§http_ca_bundle: Option<PathBuf>

Path to CA bundle PEM file (replaces default webpki-roots)

§http_extra_ca_bundle: Option<PathBuf>

Path to extra CA bundle PEM file (appends to webpki-roots)

§http_client_cert: Option<PathBuf>

Path to client certificate PEM or P12/PFX file (for mTLS)

§http_client_key: Option<PathBuf>

Path to client private key PEM file (for mTLS, not needed for P12/PFX)

§http_client_key_password: Option<String>

Password for encrypted private key or P12/PFX file

§http_insecure: bool

DANGEROUS: Skip TLS certificate verification (dev only)

Implementations§

Source§

impl ResolverContext

Source

pub fn new(config_path: impl Into<String>) -> Self

Create a new resolver context

Source

pub fn with_allow_http(self, allow: bool) -> Self

Set whether HTTP resolver is enabled

Source

pub fn with_http_allowlist(self, allowlist: Vec<String>) -> Self

Set HTTP URL allowlist

Source

pub fn with_http_proxy(self, proxy: impl Into<String>) -> Self

Set HTTP proxy URL

Source

pub fn with_http_proxy_from_env(self, enabled: bool) -> Self

Set whether to auto-detect proxy from environment variables

Source

pub fn with_http_ca_bundle(self, path: impl Into<PathBuf>) -> Self

Set CA bundle path (replaces webpki-roots)

Source

pub fn with_http_extra_ca_bundle(self, path: impl Into<PathBuf>) -> Self

Set extra CA bundle path (appends to webpki-roots)

Source

pub fn with_http_client_cert(self, path: impl Into<PathBuf>) -> Self

Set client certificate path for mTLS

Source

pub fn with_http_client_key(self, path: impl Into<PathBuf>) -> Self

Set client private key path for mTLS

Source

pub fn with_http_client_key_password(self, password: impl Into<String>) -> Self

Set password for encrypted private key or P12/PFX file

Source

pub fn with_http_insecure(self, insecure: bool) -> Self

DANGEROUS: Skip TLS certificate verification

Source

pub fn with_config_root(self, root: Arc<Value>) -> Self

Set the config root for self-references

Source

pub fn with_base_path(self, path: PathBuf) -> Self

Set the base path for file resolution

Source

pub fn would_cause_cycle(&self, path: &str) -> bool

Check if resolving a path would cause a circular reference

Source

pub fn push_resolution(&mut self, path: &str)

Push a path onto the resolution stack

Source

pub fn pop_resolution(&mut self)

Pop a path from the resolution stack

Source

pub fn get_resolution_chain(&self) -> Vec<String>

Get the resolution chain for error reporting

Trait Implementations§

Source§

impl Clone for ResolverContext

Source§

fn clone(&self) -> ResolverContext

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for ResolverContext

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> 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> 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<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