pub struct CedarAuthorizationConfig {
pub policies: String,
pub tools: Option<Vec<ToolDefinition>>,
pub entities: Option<CedarEntities>,
pub schema: Option<String>,
pub namespace: Option<String>,
pub principal: Option<TypeAndId>,
pub principal_resolver: Option<PrincipalResolver>,
pub context_enricher: Option<ContextEnricher>,
pub on_error: Option<OnError>,
}Expand description
Settings of a CedarAuthorization (CedarAuthorizationConfig).
Fields§
§policies: StringCedar policy text, or the path of a .cedar file.
tools: Option<Vec<ToolDefinition>>Tools to generate a validation schema from, when no schema is given.
entities: Option<CedarEntities>Entity data; only needed for entity hierarchies and attributes.
schema: Option<String>A Cedar schema to validate the policies against: schema text, or the path of a
.cedarschema file. Generated from tools when unset.
namespace: Option<String>The namespace of actions and resources: Agent::Action::"search" instead of
Action::"search"; generated schemas keep it.
principal: Option<TypeAndId>A fixed principal. Defaults to User::"anonymous". Exclusive with principal_resolver.
principal_resolver: Option<PrincipalResolver>Resolves the principal per call, for multi-tenant agents. Exclusive with principal.
context_enricher: Option<ContextEnricher>Adds fields to context.session.
on_error: Option<OnError>What happens when the resolver or enricher fails. Defaults to OnError::Throw;
OnError::Deny fails closed; OnError::Proceed runs the tool without any check.
Implementations§
Source§impl CedarAuthorizationConfig
impl CedarAuthorizationConfig
Sourcepub fn builder() -> CedarAuthorizationConfigBuilder
pub fn builder() -> CedarAuthorizationConfigBuilder
Create an instance of CedarAuthorizationConfig using the builder syntax
Trait Implementations§
Source§impl Clone for CedarAuthorizationConfig
impl Clone for CedarAuthorizationConfig
Source§impl Debug for CedarAuthorizationConfig
impl Debug for CedarAuthorizationConfig
Auto Trait Implementations§
impl !RefUnwindSafe for CedarAuthorizationConfig
impl !UnwindSafe for CedarAuthorizationConfig
impl Freeze for CedarAuthorizationConfig
impl Send for CedarAuthorizationConfig
impl Sync for CedarAuthorizationConfig
impl Unpin for CedarAuthorizationConfig
impl UnsafeUnpin for CedarAuthorizationConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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