pub struct DogwoodAuthorizationConfig {
pub policies: String,
pub tools: Option<Vec<ToolSpec>>,
pub action_schema: Option<String>,
pub entities: Option<Vec<EntityInput>>,
pub namespace: Option<String>,
pub principal: Option<EntityRef>,
pub principal_resolver: Option<PrincipalResolver>,
pub context_enricher: Option<ContextEnricher>,
pub on_error: Option<OnError>,
}Expand description
Settings of a DogwoodAuthorization (DogwoodAuthorizationConfig).
Fields§
§policies: StringDogwood policy text, or the path of a .dw file.
tools: Option<Vec<ToolSpec>>Tools the action schema is generated from, when no action_schema is given. A tool’s spec
is Tool::tool_spec.
action_schema: Option<String>Cedar action schema text, or the path of a .cedarschema file; generated from tools
when unset. The handler reads the namespace from the schema’s actions, so the schema must
declare its user entity as User and its resource entity as Resource.
entities: Option<Vec<EntityInput>>Entities supplied to every decision. Needs action_schema: a generated schema declares
User and Resource with no attributes and no membership.
namespace: Option<String>The namespace of a generated action schema: Acme::Action::"search" instead of
Action::"search", with the default principal Acme::User::"anonymous". Only valid with
tools.
principal: Option<EntityRef>A fixed principal. Defaults to User::"anonymous", qualified by the schema’s namespace.
Exclusive with principal_resolver; against a generated schema its type must be User.
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. A
failed Dogwood decision always denies.
Implementations§
Source§impl DogwoodAuthorizationConfig
impl DogwoodAuthorizationConfig
Sourcepub fn builder() -> DogwoodAuthorizationConfigBuilder
pub fn builder() -> DogwoodAuthorizationConfigBuilder
Create an instance of DogwoodAuthorizationConfig using the builder syntax
Trait Implementations§
Source§impl Clone for DogwoodAuthorizationConfig
impl Clone for DogwoodAuthorizationConfig
Source§impl Debug for DogwoodAuthorizationConfig
impl Debug for DogwoodAuthorizationConfig
Auto Trait Implementations§
impl !RefUnwindSafe for DogwoodAuthorizationConfig
impl !UnwindSafe for DogwoodAuthorizationConfig
impl Freeze for DogwoodAuthorizationConfig
impl Send for DogwoodAuthorizationConfig
impl Sync for DogwoodAuthorizationConfig
impl Unpin for DogwoodAuthorizationConfig
impl UnsafeUnpin for DogwoodAuthorizationConfig
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