wasm_capability_contract/capability/vo/capability_grant.rs
1//! [`CapabilityGrant`] — one capability actually granted to a route.
2
3use serde::{Deserialize, Serialize};
4
5use crate::CapabilityScope;
6
7/// One capability granted to a component's route, by name and scope.
8///
9/// A component's `ComponentManifest.capabilities` declares what it wants;
10/// a `Vec<CapabilityGrant>` is what the deployer actually grants for that
11/// route. `ComponentValidator` rejects any declared capability with no
12/// matching entry here — deny-by-default (ADR-001).
13#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
14pub struct CapabilityGrant {
15 /// The capability name, e.g. `"some-capability"`. Looked up in a
16 /// `CapabilityRegistry` to resolve the host import it wires to.
17 pub name: String,
18 /// This grant's scope — bounds what the named capability may reach.
19 pub scope: CapabilityScope,
20}