Struct cedar_policy::RequestBuilder
source · pub struct RequestBuilder<S> { /* private fields */ }
partial-eval
only.Expand description
Builder for a Request
The default for principal, action, resource, and context fields is Unknown for partial evaluation.
Implementations§
source§impl<S> RequestBuilder<S>
impl<S> RequestBuilder<S>
sourcepub fn principal(self, principal: Option<EntityUid>) -> Self
pub fn principal(self, principal: Option<EntityUid>) -> Self
Set the principal.
Note that you can create the EntityUid
using .parse()
on any
string (via the FromStr
implementation for EntityUid
).
Here, passing None
for principal
indicates that principal
does
not contribute to authorization decisions (e.g., because it is not
used in your policies).
This is different than Unknown for partial-evaluation purposes.
sourcepub fn action(self, action: Option<EntityUid>) -> Self
pub fn action(self, action: Option<EntityUid>) -> Self
Set the action.
Note that you can create the EntityUid
using .parse()
on any
string (via the FromStr
implementation for EntityUid
).
Here, passing None
for action
indicates that action
does
not contribute to authorization decisions (e.g., because it is not
used in your policies).
This is different than Unknown for partial-evaluation purposes.
sourcepub fn resource(self, resource: Option<EntityUid>) -> Self
pub fn resource(self, resource: Option<EntityUid>) -> Self
Set the resource.
Note that you can create the EntityUid
using .parse()
on any
string (via the FromStr
implementation for EntityUid
).
Here, passing None
for resource
indicates that resource
does
not contribute to authorization decisions (e.g., because it is not
used in your policies).
This is different than Unknown for partial-evaluation purposes.
source§impl RequestBuilder<&Schema>
impl RequestBuilder<&Schema>
Trait Implementations§
source§impl<S: Debug> Debug for RequestBuilder<S>
impl<S: Debug> Debug for RequestBuilder<S>
source§impl Default for RequestBuilder<UnsetSchema>
impl Default for RequestBuilder<UnsetSchema>
Auto Trait Implementations§
impl<S> Freeze for RequestBuilder<S>where
S: Freeze,
impl<S> RefUnwindSafe for RequestBuilder<S>where
S: RefUnwindSafe,
impl<S> Send for RequestBuilder<S>where
S: Send,
impl<S> Sync for RequestBuilder<S>where
S: Sync,
impl<S> Unpin for RequestBuilder<S>where
S: Unpin,
impl<S> UnwindSafe for RequestBuilder<S>where
S: UnwindSafe,
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> 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