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 — checked against
15 /// `manifest.artifact_provenance.checksum_sha256` and structurally
16 /// inspected for its actual imports.
17 pub component_bytes: Vec<u8>,
18 /// What this route was actually granted, independent of what the
19 /// manifest declares wanting.
20 pub granted_capabilities: Vec<CapabilityGrant>,
21}