Skip to main content

wasm_capability_contract/component/dto/
validate_component_request.rs

1//! [`ValidateComponentRequest`] — input to [`crate::ComponentValidator::validate`].
2
3use serde::{Deserialize, Serialize};
4
5use crate::{CapabilityGrant, ComponentManifest};
6
7/// Everything a `ComponentValidator` needs to check one component before
8/// its route is registered: the manifest it claims, the real bytes it
9/// ships, and what the route was actually granted.
10#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
11pub struct ValidateComponentRequest {
12    /// The component's own claimed manifest.
13    pub manifest: ComponentManifest,
14    /// The real `.wasm` component bytes — structurally inspected for its
15    /// actual imports.
16    pub component_bytes: Vec<u8>,
17    /// What this route was actually granted, independent of what the
18    /// manifest declares wanting.
19    pub granted_capabilities: Vec<CapabilityGrant>,
20}