pub struct ResolverContext {Show 14 fields
pub config_path: String,
pub config_root: Option<Arc<Value>>,
pub base_path: Option<PathBuf>,
pub file_roots: HashSet<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<CertInput>,
pub http_extra_ca_bundle: Option<CertInput>,
pub http_client_cert: Option<CertInput>,
pub http_client_key: Option<CertInput>,
pub http_client_key_password: Option<String>,
}Expand description
Context provided to resolvers during resolution
Fields§
§config_path: StringThe 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
file_roots: HashSet<PathBuf>Allowed root directories for file resolver (path traversal protection)
resolution_stack: Vec<String>Resolution stack for circular reference detection
allow_http: boolWhether 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: boolWhether to auto-detect proxy from environment variables (HTTP_PROXY, HTTPS_PROXY, NO_PROXY)
http_ca_bundle: Option<CertInput>CA bundle (file path or PEM content) - replaces default webpki-roots
http_extra_ca_bundle: Option<CertInput>Extra CA bundle (file path or PEM content) - appends to webpki-roots
http_client_cert: Option<CertInput>Client certificate for mTLS (file path, PEM content, or P12/PFX binary)
http_client_key: Option<CertInput>Client private key for mTLS (file path or PEM content, not needed for P12/PFX)
http_client_key_password: Option<String>Password for encrypted private key or P12/PFX file
Implementations§
Source§impl ResolverContext
impl ResolverContext
Sourcepub fn with_allow_http(self, allow: bool) -> Self
pub fn with_allow_http(self, allow: bool) -> Self
Set whether HTTP resolver is enabled
Sourcepub fn with_http_allowlist(self, allowlist: Vec<String>) -> Self
pub fn with_http_allowlist(self, allowlist: Vec<String>) -> Self
Set HTTP URL allowlist
Sourcepub fn with_http_proxy(self, proxy: impl Into<String>) -> Self
pub fn with_http_proxy(self, proxy: impl Into<String>) -> Self
Set HTTP proxy URL
Sourcepub fn with_http_proxy_from_env(self, enabled: bool) -> Self
pub fn with_http_proxy_from_env(self, enabled: bool) -> Self
Set whether to auto-detect proxy from environment variables
Sourcepub fn with_http_ca_bundle(self, input: impl Into<CertInput>) -> Self
pub fn with_http_ca_bundle(self, input: impl Into<CertInput>) -> Self
Set CA bundle (file path or PEM content)
Sourcepub fn with_http_extra_ca_bundle(self, input: impl Into<CertInput>) -> Self
pub fn with_http_extra_ca_bundle(self, input: impl Into<CertInput>) -> Self
Set extra CA bundle (file path or PEM content)
Sourcepub fn with_http_client_cert(self, input: impl Into<CertInput>) -> Self
pub fn with_http_client_cert(self, input: impl Into<CertInput>) -> Self
Set client certificate for mTLS (file path, PEM content, or P12/PFX binary)
Sourcepub fn with_http_client_key(self, input: impl Into<CertInput>) -> Self
pub fn with_http_client_key(self, input: impl Into<CertInput>) -> Self
Set client private key for mTLS (file path or PEM content, not needed for P12/PFX)
Sourcepub fn with_http_client_key_password(self, password: impl Into<String>) -> Self
pub fn with_http_client_key_password(self, password: impl Into<String>) -> Self
Set password for encrypted private key or P12/PFX file
Sourcepub fn with_config_root(self, root: Arc<Value>) -> Self
pub fn with_config_root(self, root: Arc<Value>) -> Self
Set the config root for self-references
Sourcepub fn with_base_path(self, path: PathBuf) -> Self
pub fn with_base_path(self, path: PathBuf) -> Self
Set the base path for file resolution
Sourcepub fn would_cause_cycle(&self, path: &str) -> bool
pub fn would_cause_cycle(&self, path: &str) -> bool
Check if resolving a path would cause a circular reference
Sourcepub fn push_resolution(&mut self, path: &str)
pub fn push_resolution(&mut self, path: &str)
Push a path onto the resolution stack
Sourcepub fn pop_resolution(&mut self)
pub fn pop_resolution(&mut self)
Pop a path from the resolution stack
Sourcepub fn get_resolution_chain(&self) -> Vec<String>
pub fn get_resolution_chain(&self) -> Vec<String>
Get the resolution chain for error reporting
Trait Implementations§
Source§impl Clone for ResolverContext
impl Clone for ResolverContext
Source§fn clone(&self) -> ResolverContext
fn clone(&self) -> ResolverContext
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more