Skip to main content

ComponentValidator

Trait ComponentValidator 

Source
pub trait ComponentValidator: Send + Sync {
    // Required method
    fn validate(
        &self,
        req: ValidateComponentRequest,
    ) -> Result<(), CapabilityError>;
}
Expand description

Checks a Wasm component’s manifest and real bytes before its route is registered. A real implementor enforces two gates, per ADR-001:

  1. Manifest-level grant check — every capability req.manifest.capabilities declares must appear in req.granted_capabilities (deny-by-default), and each grant’s CapabilityScope must be non-trivially empty for its kind.
  2. Structural import checkreq.component_bytes’ actual component-level imports must each be backed by either a granted capability with a real host implementation, or an unconditional base-ABI runtime-support import.

Zero implementation here — this port only declares the contract.

Required Methods§

Source

fn validate(&self, req: ValidateComponentRequest) -> Result<(), CapabilityError>

Validate req, per the two-gate contract above.

§Errors

Returns CapabilityError naming which gate failed and why.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§