#[non_exhaustive]
#[must_use]
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum Decision {
Allow {
obligations: Vec<String>,
},
Deny {
reason: DenyReason,
},
}
impl Decision {
#[must_use]
pub fn is_allow(&self) -> bool {
matches!(self, Decision::Allow { .. })
}
#[must_use]
pub fn is_deny(&self) -> bool {
matches!(self, Decision::Deny { .. })
}
}
#[non_exhaustive]
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum DenyReason {
NoPolicyMatch,
InsufficientRole,
TenantMismatch,
IncompleteContext,
EngineError,
OwnershipRequired,
MissingResource,
AttributeMismatch,
PermissionExpired,
PermissionNotYetActive,
DeviceTrustRequired,
DeviceTrustTierTooLow,
DeviceTrustRevoked,
UntrustedDeviceMetadata,
DeviceSessionBindingMismatch,
TestTrustProfileRequired,
}