pub struct CapsuleOverlay {
pub name: String,
pub targets: Option<Vec<String>>,
pub capabilities: BTreeSet<CapabilityGrant>,
pub note: Option<String>,
}Expand description
A tenant overlay (R0.9 wave 2): the grant ceiling an operator attaches
to a tenant, further restricting what capsules in that tenant may do.
The contract half of the overlay plane lives here (golden-pinned, like
every wire shape); the authorization half — who may author an
overlay, against which capsules — is the server’s Cedar decision
(rusty-server/src/capsule_policy.rs, feature capsules).
The narrowing rule is enforced twice, and the structural half comes
first: applying an overlay is intersect_grants, a set intersection
that mechanically cannot add a grant; Cedar then decides the overlay’s
legality. Policy decides legality; arithmetic decides narrowing.
Fields§
§name: StringThe overlay’s name — its registry key within the tenant.
targets: Option<Vec<String>>The capsule identity names the overlay applies to. None (the
sparse wire shape) means every capsule in the tenant; an empty list
is refused at validation for the same reason an empty grant scope
is — an overlay applying to nothing carries no meaning worth
storing.
capabilities: BTreeSet<CapabilityGrant>The grant ceiling. The effective capability set of a manifest
under this overlay is intersect_grants(manifest, ceiling) —
never the manifest’s grants alone and never the ceiling’s alone.
note: Option<String>Human-facing context (why the ceiling exists). Metadata, read by no enforcement point.
Implementations§
Source§impl CapsuleOverlay
impl CapsuleOverlay
Sourcepub fn validate(&self) -> Result<()>
pub fn validate(&self) -> Result<()>
Contract validation, run at every attach boundary: the name and any targets are in the identifier grammar, and every ceiling grant passes the manifest’s per-grant rule.
Sourcepub fn applies_to(&self, capsule_name: &str) -> bool
pub fn applies_to(&self, capsule_name: &str) -> bool
true when this overlay governs the capsule named capsule_name
(its identity name, the RunManifest pin key).
Sourcepub fn effective_grants(
&self,
manifest_grants: &BTreeSet<CapabilityGrant>,
) -> BTreeSet<CapabilityGrant>
pub fn effective_grants( &self, manifest_grants: &BTreeSet<CapabilityGrant>, ) -> BTreeSet<CapabilityGrant>
The effective grant set of manifest_grants under this overlay —
intersect_grants, the only composition this wave defines.