pub struct StepUpPolicy {
pub rules: Vec<Rule>,
pub default: AttestRequirement,
}Expand description
The per-action step-up policy: a set of selector rules plus a fall-through
default. Most-specific (longest matching selector) wins. This is the
authoring surface behind the operator menu (yes once / yes always / yes on
passkey / no); it composes on top of the Caveats grant — Caveats
decides whether the authority exists, this decides what gesture admits its
use.
Fields§
§rules: Vec<Rule>Selector rules, evaluated most-specific-wins.
default: AttestRequirementThe requirement for any action no rule matches.
Implementations§
Source§impl StepUpPolicy
impl StepUpPolicy
Sourcepub const EMPTY: StepUpPolicy
pub const EMPTY: StepUpPolicy
The empty policy: nothing ever needs a gesture. Used by the back-compat no-step-up path so existing behavior is unchanged.
Sourcepub fn new(rules: Vec<Rule>, default: AttestRequirement) -> StepUpPolicy
pub fn new(rules: Vec<Rule>, default: AttestRequirement) -> StepUpPolicy
A policy with the given rules and default.
Sourcepub fn required_for(&self, request: &CallRequest) -> AttestRequirement
pub fn required_for(&self, request: &CallRequest) -> AttestRequirement
The strongest requirement matching request (longest selector wins), or
the policy default when none match.
Trait Implementations§
Source§impl Clone for StepUpPolicy
impl Clone for StepUpPolicy
Source§fn clone(&self) -> StepUpPolicy
fn clone(&self) -> StepUpPolicy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 StepUpPolicy
impl Debug for StepUpPolicy
Source§impl Default for StepUpPolicy
impl Default for StepUpPolicy
Source§fn default() -> StepUpPolicy
fn default() -> StepUpPolicy
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for StepUpPolicy
impl<'de> Deserialize<'de> for StepUpPolicy
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<StepUpPolicy, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<StepUpPolicy, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for StepUpPolicy
Source§impl PartialEq for StepUpPolicy
impl PartialEq for StepUpPolicy
Source§impl Serialize for StepUpPolicy
impl Serialize for StepUpPolicy
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for StepUpPolicy
Auto Trait Implementations§
impl Freeze for StepUpPolicy
impl RefUnwindSafe for StepUpPolicy
impl Send for StepUpPolicy
impl Sync for StepUpPolicy
impl Unpin for StepUpPolicy
impl UnsafeUnpin for StepUpPolicy
impl UnwindSafe for StepUpPolicy
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<F, T> ConvertInto<T> for Fwhere
T: ConvertFrom<F>,
impl<F, T> ConvertInto<T> for Fwhere
T: ConvertFrom<F>,
Source§fn convert_into(self) -> T
fn convert_into(self) -> T
Infallibly converts a value of type
Self to a value of type T.Source§impl<F, T> ConvertTryFrom<F> for Twhere
F: ConvertInto<T>,
impl<F, T> ConvertTryFrom<F> for Twhere
F: ConvertInto<T>,
Source§impl<F, T> ConvertTryInto<T> for Fwhere
T: ConvertTryFrom<F>,
impl<F, T> ConvertTryInto<T> for Fwhere
T: ConvertTryFrom<F>,
Source§type Error = <T as ConvertTryFrom<F>>::Error
type Error = <T as ConvertTryFrom<F>>::Error
The type of an error that can occur during a conversion. Read more
Source§fn convert_try_into(self) -> Result<T, <T as ConvertTryFrom<F>>::Error>
fn convert_try_into(self) -> Result<T, <T as ConvertTryFrom<F>>::Error>
Fallibly converts a value of type
Self to a value of type T.impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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