#[non_exhaustive]pub struct ProfileValidationOptions {
pub security_floor: Option<SecurityPolicy>,
pub forbid_security_relaxation: bool,
}Expand description
Knobs for ProfileStack::validate_with.
Construct with Default::default and the with_* methods; the struct is
#[non_exhaustive] so future knobs do not break callers.
use asx_rs::interop::{ProfileValidationOptions, SecurityPolicy};
let options = ProfileValidationOptions::default()
.with_security_floor(SecurityPolicy::SIGN_AND_ENCRYPT)
.forbidding_security_relaxation();Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.security_floor: Option<SecurityPolicy>Floor imposed by the deployment, on top of BaseProfile::security_floor.
The two are combined with SecurityPolicy::strengthen, so the
stricter value wins per requirement and this can only tighten
validation, never loosen it.
forbid_security_relaxation: boolEscalate every monotonic security relaxation from a
ProfileLintCode::SecurityRelaxation lint to a
ProfileValidationCode::SecurityRelaxation error, even when the
relaxed policy still clears the floor.
Use this when overlays are expected to specialise non-security policy only, and any security change at all should fail the build.
Implementations§
Source§impl ProfileValidationOptions
impl ProfileValidationOptions
Sourcepub fn with_security_floor(self, floor: SecurityPolicy) -> Self
pub fn with_security_floor(self, floor: SecurityPolicy) -> Self
Impose a deployment-wide security floor.
Sourcepub fn forbidding_security_relaxation(self) -> Self
pub fn forbidding_security_relaxation(self) -> Self
Treat any security relaxation as a hard error.
Trait Implementations§
Source§impl Clone for ProfileValidationOptions
impl Clone for ProfileValidationOptions
Source§fn clone(&self) -> ProfileValidationOptions
fn clone(&self) -> ProfileValidationOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProfileValidationOptions
impl Debug for ProfileValidationOptions
Source§impl Default for ProfileValidationOptions
impl Default for ProfileValidationOptions
Source§fn default() -> ProfileValidationOptions
fn default() -> ProfileValidationOptions
impl Eq for ProfileValidationOptions
Source§impl PartialEq for ProfileValidationOptions
impl PartialEq for ProfileValidationOptions
impl StructuralPartialEq for ProfileValidationOptions
Auto Trait Implementations§
impl Freeze for ProfileValidationOptions
impl RefUnwindSafe for ProfileValidationOptions
impl Send for ProfileValidationOptions
impl Sync for ProfileValidationOptions
impl Unpin for ProfileValidationOptions
impl UnsafeUnpin for ProfileValidationOptions
impl UnwindSafe for ProfileValidationOptions
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
key and return true if they are equal.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> ⓘ
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> ⓘ
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