pub struct PolicyCompiler<'a> { /* private fields */ }Expand description
Compose layers in system → application → tenant order. Every ordinary layer
intersects the previous snapshot; only authorize_replacement can relax it.
Implementations§
Source§impl<'a> PolicyCompiler<'a>
impl<'a> PolicyCompiler<'a>
Sourcepub fn new(
profile: PolicyProfile,
provider: &'a dyn CryptoProvider,
authorization: Option<PolicyValidity>,
) -> Result<Self, PolicyViolation>
pub fn new( profile: PolicyProfile, provider: &'a dyn CryptoProvider, authorization: Option<PolicyValidity>, ) -> Result<Self, PolicyViolation>
Construct a named profile using this engine’s advertised capabilities. LegacyVerify requires a valid authorization even before compilation.
Sourcepub fn restrict(self, layer: &PolicySet) -> Result<Self, PolicyViolation>
pub fn restrict(self, layer: &PolicySet) -> Result<Self, PolicyViolation>
Intersect another complete layer without granting any new permission.
None operation fields mean disabled, not unspecified inheritance.
Explicit relaxation path: replace the effective policy and retain the authenticated grant on every enabled operation. Earlier authorization lifetimes are intersected, so replacement cannot extend an existing grant.
Sourcepub fn compile(
self,
context: &PolicyCompileContext,
) -> Result<CompiledPolicies, PolicyViolation>
pub fn compile( self, context: &PolicyCompileContext, ) -> Result<CompiledPolicies, PolicyViolation>
Compile contradictions before parsing, resolver calls or cryptography.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for PolicyCompiler<'a>
impl<'a> !UnwindSafe for PolicyCompiler<'a>
impl<'a> Freeze for PolicyCompiler<'a>
impl<'a> Send for PolicyCompiler<'a>
impl<'a> Sync for PolicyCompiler<'a>
impl<'a> Unpin for PolicyCompiler<'a>
impl<'a> UnsafeUnpin for PolicyCompiler<'a>
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
Mutably borrows from an owned value. Read more