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
impl AplOptions
Sourcepub fn in_process() -> Self
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.