pub trait PdpFactory: Send + Sync {
// Required methods
fn kind(&self) -> &str;
fn build(
&self,
config: &Value,
) -> Result<Arc<dyn PdpResolver>, Box<dyn Error + Send + Sync>>;
}Expand description
Build a PdpResolver from a unified-config block. Implemented per
PDP backend (cedar-direct, opa, …) and registered with
the apl-cpex visitor so unified-config YAML can declare PDPs
without the host pre-constructing them in code.
Hosts register a factory by handing it to apl-cpex’s
AplOptions.pdp_factories. When the visitor walks the unified
config and finds a global.apl.pdp[].kind matching the factory’s
reported kind(), it calls build with the rest of that block.
The error type is Box<dyn Error + Send + Sync> to keep this trait
in apl-core (which has no cpex deps). apl-cpex’s visitor wraps
the boxed error into VisitorError → PluginError::Config at the
manager boundary.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".