pub struct SpiffeValidator {
pub allowed_trust_domains: Vec<String>,
pub clock_skew: Duration,
pub workload_endpoint: String,
}Expand description
Trust domain allowlist and optional workload endpoint.
Fields§
§allowed_trust_domains: Vec<String>§clock_skew: Duration§workload_endpoint: StringPath or URL of the SPIFFE Workload API.
Default: unix:///run/spire/sockets/agent.sock.
Implementations§
Source§impl SpiffeValidator
impl SpiffeValidator
pub fn new(trust_domain: impl Into<String>) -> Self
Sourcepub fn allow_trust_domain(&mut self, domain: impl Into<String>) -> &mut Self
pub fn allow_trust_domain(&mut self, domain: impl Into<String>) -> &mut Self
Add another trust domain to the allowlist.
Sourcepub fn validate_spiffe_id(&self, id: &str) -> Result<()>
pub fn validate_spiffe_id(&self, id: &str) -> Result<()>
Parse and validate a SPIFFE ID string. A SPIFFE ID looks like
spiffe://<trust-domain>/<workload-path>.
Sourcepub async fn fetch_svid(&self) -> Result<SpiffeId>
pub async fn fetch_svid(&self) -> Result<SpiffeId>
Fetch an SVID stub: returns the trust domain if configured. Useful for testing and when SPIRE isn’t available.
Trait Implementations§
Source§impl Clone for SpiffeValidator
impl Clone for SpiffeValidator
Source§fn clone(&self) -> SpiffeValidator
fn clone(&self) -> SpiffeValidator
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SpiffeValidator
impl RefUnwindSafe for SpiffeValidator
impl Send for SpiffeValidator
impl Sync for SpiffeValidator
impl Unpin for SpiffeValidator
impl UnwindSafe for SpiffeValidator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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