Skip to main content

AplOptions

Struct AplOptions 

Source
pub struct AplOptions {
    pub dispatch_cache: Arc<DispatchCache>,
    pub session_store: Arc<dyn SessionStore>,
    pub pdps: Vec<Arc<dyn PdpResolver>>,
    pub pdp_factories: Vec<Arc<dyn PdpFactory>>,
    pub session_store_factories: Vec<Arc<dyn SessionStoreFactory>>,
    pub base_capabilities: Option<HashSet<String>>,
}
Expand description

Configuration for register_apl. All runtime collaborators APL needs to do its work are funneled through here so the call site reads as a single block instead of a multi-step builder.

Fields§

§dispatch_cache: Arc<DispatchCache>

Shared dispatch-plan cache. One Arc<DispatchCache> per host instance — clones are cheap (refcount bump) and the cache is internally synchronized.

§session_store: Arc<dyn SessionStore>

Pluggable session-scoped state. MemorySessionStore is the default in-process backend; production hosts swap in Redis / DynamoDB-backed impls.

§pdps: Vec<Arc<dyn PdpResolver>>

Zero or more code-supplied PDP resolvers. Each is registered into the visitor’s internal PdpRouter, so pdp(...) steps dispatch by dialect across this list and any resolvers the visitor builds from global.apl.pdp[] config entries. An empty list combined with empty pdp_factories means no PDP is wired — routes that call pdp(...) surface PdpError::NoResolver at evaluation time, which is the correct behavior for “you forgot to configure your policy decision point.”

§pdp_factories: Vec<Arc<dyn PdpFactory>>

PDP factories the visitor consults when it encounters a global.apl.pdp[] entry. Each factory advertises a kind() string that matches the YAML block’s kind: field — e.g. cedar-direct, opa. An empty list disables config-driven PDP wiring; hosts can still supply resolvers via pdps.

§session_store_factories: Vec<Arc<dyn SessionStoreFactory>>

Session-store factories the visitor consults when it encounters a global.apl.session_store block. Each factory advertises a kind() string matching the block’s kind: field — e.g. valkey. An empty list keeps the constructor-supplied session_store (the MemorySessionStore default) active, so existing deployments are unaffected.

§base_capabilities: Option<HashSet<String>>

Override the visitor’s baseline capabilities for installed AplRouteHandlers. None uses the visitor’s default (read-only across the common attribute namespaces); Some(set) replaces it entirely. The per-route plugin capability union is added on top regardless — this only controls the baseline.

Set to Some(HashSet::new()) for strict deployments where only plugin-declared caps should be granted.

Implementations§

Source§

impl AplOptions

Source

pub fn in_process() -> Self

Minimal options — in-process dispatch cache + memory session store, no PDP, default baseline capabilities. Useful for tests and single-process demos.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more