pub struct TargetPolicyManifest {
pub allow_mutating_sessions: bool,
pub audit_capacity: u64,
pub max_snapshot_items: u32,
pub resources: Vec<ResourcePolicyManifest>,
pub schema_version: u32,
}Expand description
Target-wide ceiling policy manifest.
Fields are declared in alphabetical order to produce deterministic canonical JSON.
Fields§
§allow_mutating_sessions: boolWhether mutating sessions may be opened.
audit_capacity: u64Bounded audit capacity.
max_snapshot_items: u32Maximum snapshot items per bounded read snapshot.
resources: Vec<ResourcePolicyManifest>Per-resource ceiling policies, sorted by resource ID.
schema_version: u32Schema version (must be 1).
Implementations§
Source§impl TargetPolicyManifest
impl TargetPolicyManifest
Sourcepub fn engineering_default(
resources: &BTreeMap<ResourceId, MmioResource>,
) -> Self
pub fn engineering_default( resources: &BTreeMap<ResourceId, MmioResource>, ) -> Self
Default engineering ceiling policy for Phase 1 exploration.
Sourcepub fn from_bundle_ceiling(
resources: &BTreeMap<ResourceId, MmioResource>,
ceiling: &BTreeMap<ResourceId, ResourceCeiling>,
allow_mutating_sessions: bool,
) -> Self
pub fn from_bundle_ceiling( resources: &BTreeMap<ResourceId, MmioResource>, ceiling: &BTreeMap<ResourceId, ResourceCeiling>, allow_mutating_sessions: bool, ) -> Self
Constructs a canonical target policy manifest from offered resources and
their configured per-resource ceiling entries (including hard_denied
ranges and writable_registers).
Sourcepub fn canonicalize(&mut self) -> Result<(), PolicyValidationError>
pub fn canonicalize(&mut self) -> Result<(), PolicyValidationError>
Validates and canonicalizes the manifest.
Sourcepub fn to_canonical_json(&self) -> Result<String, Error>
pub fn to_canonical_json(&self) -> Result<String, Error>
Serializes to canonical JSON.
Sourcepub fn policy_digest(&self) -> Sha256Digest
pub fn policy_digest(&self) -> Sha256Digest
Computes the canonical SHA-256 digest of the manifest.
Sourcepub fn to_ceiling_map(&self) -> BTreeMap<ResourceId, ResourceCeiling>
pub fn to_ceiling_map(&self) -> BTreeMap<ResourceId, ResourceCeiling>
Converts resource manifests to a ceiling map for the policy engine.
Sourcepub fn narrow_with(&self, runtime: &Self) -> Result<Self, NarrowingError>
pub fn narrow_with(&self, runtime: &Self) -> Result<Self, NarrowingError>
Validates that runtime narrows or preserves (does not widen) this baseline manifest.
Returns the validated narrowed manifest.
Trait Implementations§
Source§impl Clone for TargetPolicyManifest
impl Clone for TargetPolicyManifest
Source§impl Debug for TargetPolicyManifest
impl Debug for TargetPolicyManifest
Source§impl<'de> Deserialize<'de> for TargetPolicyManifest
impl<'de> Deserialize<'de> for TargetPolicyManifest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for TargetPolicyManifest
Source§impl PartialEq for TargetPolicyManifest
impl PartialEq for TargetPolicyManifest
Source§impl Serialize for TargetPolicyManifest
impl Serialize for TargetPolicyManifest
impl StructuralPartialEq for TargetPolicyManifest
Auto Trait Implementations§
impl Freeze for TargetPolicyManifest
impl RefUnwindSafe for TargetPolicyManifest
impl Send for TargetPolicyManifest
impl Sync for TargetPolicyManifest
impl Unpin for TargetPolicyManifest
impl UnsafeUnpin for TargetPolicyManifest
impl UnwindSafe for TargetPolicyManifest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.