pub struct AnsVerifierBuilder { /* private fields */ }Expand description
Builder for AnsVerifier.
Implementations§
Source§impl AnsVerifierBuilder
impl AnsVerifierBuilder
Sourcepub fn dns_resolver(self, resolver: Arc<dyn DnsResolver>) -> Self
pub fn dns_resolver(self, resolver: Arc<dyn DnsResolver>) -> Self
Set a custom DNS resolver.
Sourcepub fn dns_preset(self, preset: DnsResolverConfig) -> Self
pub fn dns_preset(self, preset: DnsResolverConfig) -> Self
Use a preset DNS resolver configuration (Cloudflare, Google, etc.).
§Example
use ans_verify::{AnsVerifier, DnsResolverConfig};
let verifier = AnsVerifier::builder()
.dns_preset(DnsResolverConfig::CloudflareTls)
.build()
.await?;Sourcepub fn dns_cloudflare(self) -> Self
pub fn dns_cloudflare(self) -> Self
Use Cloudflare DNS (1.1.1.1).
Sourcepub fn dns_cloudflare_tls(self) -> Self
pub fn dns_cloudflare_tls(self) -> Self
Use Cloudflare DNS over TLS.
Sourcepub fn dns_google(self) -> Self
pub fn dns_google(self) -> Self
Use Google Public DNS (8.8.8.8).
Sourcepub fn dns_google_tls(self) -> Self
pub fn dns_google_tls(self) -> Self
Use Google DNS over TLS.
Sourcepub fn dns_nameservers(self, nameservers: &[Ipv4Addr]) -> Self
pub fn dns_nameservers(self, nameservers: &[Ipv4Addr]) -> Self
Use custom DNS nameservers.
§Example
use ans_verify::AnsVerifier;
use std::net::Ipv4Addr;
let verifier = AnsVerifier::builder()
.dns_nameservers(&[
Ipv4Addr::new(1, 1, 1, 1),
Ipv4Addr::new(8, 8, 8, 8),
])
.build()
.await?;Sourcepub fn tlog_client(self, client: Arc<dyn TransparencyLogClient>) -> Self
pub fn tlog_client(self, client: Arc<dyn TransparencyLogClient>) -> Self
Set a custom transparency log client.
Sourcepub fn with_caching(self) -> Self
pub fn with_caching(self) -> Self
Enable caching with default configuration.
Sourcepub fn with_cache_config(self, config: CacheConfig) -> Self
pub fn with_cache_config(self, config: CacheConfig) -> Self
Enable caching with custom configuration.
Sourcepub fn failure_policy(self, policy: FailurePolicy) -> Self
pub fn failure_policy(self, policy: FailurePolicy) -> Self
Set the failure policy.
Sourcepub fn dane_policy(self, policy: DanePolicy) -> Self
pub fn dane_policy(self, policy: DanePolicy) -> Self
Set the DANE/TLSA verification policy.
DanePolicy::Disabled: Skip DANE verification entirely (default)DanePolicy::ValidateIfPresent: Verify TLSA if records exist, skip if notDanePolicy::Required: Require TLSA records to exist and match
Sourcepub fn with_dane_if_present(self) -> Self
pub fn with_dane_if_present(self) -> Self
Enable DANE verification if TLSA records are present.
Sourcepub fn require_dane(self) -> Self
pub fn require_dane(self) -> Self
Require DANE verification (fail if no TLSA records).
Sourcepub fn trusted_ra_domains(
self,
domains: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn trusted_ra_domains( self, domains: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Restrict badge URL fetches to a set of trusted RA domains.
When configured, badge URLs discovered via DNS TXT records will be validated against this set before any HTTP request is made.
Sourcepub async fn build(self) -> AnsResult<AnsVerifier>
pub async fn build(self) -> AnsResult<AnsVerifier>
Build the verifier.
§Errors
Returns VerificationError::Configuration if scitt_config is set
without a key store. Use scitt_key_store or
scitt_refreshable_key_store to
provide one.