pub struct PartialResponse(/* private fields */);
partial-eval
only.Expand description
A partially evaluated authorization response.
Splits the results into several categories: satisfied, false, and residual for each policy effect. Also tracks all the errors that were encountered during evaluation.
Implementations§
Source§impl PartialResponse
impl PartialResponse
Sourcepub fn decision(&self) -> Option<Decision>
pub fn decision(&self) -> Option<Decision>
Attempt to reach a partial decision; the presence of residuals may result in returning None
,
indicating that a decision could not be reached given the unknowns
Sourcepub fn concretize(self) -> Response
pub fn concretize(self) -> Response
Convert this response into a concrete evaluation response. All residuals are treated as errors
Sourcepub fn definitely_satisfied(&self) -> impl Iterator<Item = Policy> + '_
pub fn definitely_satisfied(&self) -> impl Iterator<Item = Policy> + '_
Returns the set of Policy
s that were definitely satisfied.
This will be the set of policies (both permit
and forbid
) that evaluated to true
Sourcepub fn definitely_errored(&self) -> impl Iterator<Item = &PolicyId>
pub fn definitely_errored(&self) -> impl Iterator<Item = &PolicyId>
Returns the set of PolicyId
s that encountered errors
Sourcepub fn may_be_determining(&self) -> impl Iterator<Item = Policy> + '_
pub fn may_be_determining(&self) -> impl Iterator<Item = Policy> + '_
Returns an over-approximation of the set of determining policies
This is all policies that may be determining for any substitution of the unknowns. Policies not in this set will not affect the final decision, regardless of any substitutions.
For more information on what counts as “determining” see: https://docs.cedarpolicy.com/auth/authorization.html#request-authorization
Sourcepub fn must_be_determining(&self) -> impl Iterator<Item = Policy> + '_
pub fn must_be_determining(&self) -> impl Iterator<Item = Policy> + '_
Returns an under-approximation of the set of determining policies
This is all policies that must be determining for all possible substitutions of the unknowns.
This set will include policies that evaluated to true
and are guaranteed to be
contributing to the final authorization decision.
For more information on what counts as “determining” see: https://docs.cedarpolicy.com/auth/authorization.html#request-authorization
Sourcepub fn nontrivial_residuals(&self) -> impl Iterator<Item = Policy> + '_
pub fn nontrivial_residuals(&self) -> impl Iterator<Item = Policy> + '_
Returns the set of non-trivial (meaning more than just true
or false
) residuals expressions
Sourcepub fn all_residuals(&self) -> impl Iterator<Item = Policy> + '_
pub fn all_residuals(&self) -> impl Iterator<Item = Policy> + '_
Returns every policy as a residual expression
Sourcepub fn get(&self, id: &PolicyId) -> Option<Policy>
pub fn get(&self, id: &PolicyId) -> Option<Policy>
Return the residual for a given PolicyId
, if it exists in the response
Attempt to re-authorize this response given a mapping from unknowns to values
Trait Implementations§
Source§impl Clone for PartialResponse
impl Clone for PartialResponse
Source§fn clone(&self) -> PartialResponse
fn clone(&self) -> PartialResponse
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for PartialResponse
impl Debug for PartialResponse
Source§impl RefCast for PartialResponse
impl RefCast for PartialResponse
Source§impl TryFrom<PartialResponse> for ResidualResponse
impl TryFrom<PartialResponse> for ResidualResponse
Source§impl TryFrom<PartialResponse> for Response
impl TryFrom<PartialResponse> for Response
Source§type Error = Infallible
type Error = Infallible
Auto Trait Implementations§
impl Freeze for PartialResponse
impl RefUnwindSafe for PartialResponse
impl Send for PartialResponse
impl Sync for PartialResponse
impl Unpin for PartialResponse
impl UnwindSafe for PartialResponse
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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