pub enum TrustPolicy {
Tofu,
Explicit,
}Expand description
How the verifier decides to trust a root key.
Variants§
Tofu
Accept on first use, pin for future. Interactive prompt on conflict.
This is the default for interactive local development. When an unknown identity is encountered, the user is prompted to trust it. Once trusted, the identity is pinned for future verification.
Explicit
Require an explicit pin, roots file, or –issuer-pk. No interactive prompts.
This is the default for non-interactive environments (CI pipelines). Fails closed if the identity is unknown, ensuring CI never hangs waiting for interactive input.
Implementations§
Source§impl TrustPolicy
impl TrustPolicy
Sourcepub fn from_str_flag(s: &str) -> Result<Self, String>
pub fn from_str_flag(s: &str) -> Result<Self, String>
Parse a trust policy from a command-line flag value.
§Examples
use auths_core::trust::TrustPolicy;
assert_eq!(TrustPolicy::from_str_flag("tofu"), Ok(TrustPolicy::Tofu));
assert_eq!(TrustPolicy::from_str_flag("explicit"), Ok(TrustPolicy::Explicit));
assert!(TrustPolicy::from_str_flag("invalid").is_err());Trait Implementations§
Source§impl Clone for TrustPolicy
impl Clone for TrustPolicy
Source§fn clone(&self) -> TrustPolicy
fn clone(&self) -> TrustPolicy
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 moreSource§impl Debug for TrustPolicy
impl Debug for TrustPolicy
Source§impl Default for TrustPolicy
impl Default for TrustPolicy
Source§fn default() -> TrustPolicy
fn default() -> TrustPolicy
Returns the “default value” for a type. Read more
Source§impl PartialEq for TrustPolicy
impl PartialEq for TrustPolicy
impl Eq for TrustPolicy
impl StructuralPartialEq for TrustPolicy
Auto Trait Implementations§
impl Freeze for TrustPolicy
impl RefUnwindSafe for TrustPolicy
impl Send for TrustPolicy
impl Sync for TrustPolicy
impl Unpin for TrustPolicy
impl UnsafeUnpin for TrustPolicy
impl UnwindSafe for TrustPolicy
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