pub struct GovernancePolicy {
pub schema: String,
pub policy_id: String,
pub frontier_id: String,
pub owner_epoch: u64,
pub bootstrap_epoch: u64,
pub valid_from_entry_hash: Option<String>,
pub rotate_quorum: Quorum,
pub emergency_quorum: Option<Quorum>,
pub policy_update_quorum: Option<Quorum>,
pub attestation_ttl_hours: u32,
pub created_at: String,
}Expand description
The full governance policy object. Serialized as
vela.registry_governance_policy.v0.1 JSON.
Fields§
§schema: String§policy_id: StringContent-addressed policy id (vgp_*). Derived from the
policy body excluding policy_id and valid_from_entry_hash.
frontier_id: StringFrontier this policy governs.
owner_epoch: u64Owner epoch this policy is authoritative for.
bootstrap_epoch: u64Epoch at which this policy was first content-addressed.
bootstrap_epoch == owner_epoch for bootstrap (genesis)
policies. The bootstrap relaxation
(current_owner_counts: true) is permitted only when
bootstrap_epoch == 0 AND owner_epoch == 0.
valid_from_entry_hash: Option<String>Optional hash of the registry entry the policy first attaches to. Populated when binding the policy; excluded from the content-address preimage so the id remains derivable from policy semantics alone.
rotate_quorum: Quorum§emergency_quorum: Option<Quorum>§policy_update_quorum: Option<Quorum>§attestation_ttl_hours: u32How long a governance attestation remains valid after signing. Default 168 hours (one week).
created_at: StringImplementations§
Source§impl GovernancePolicy
impl GovernancePolicy
Sourcepub fn from_draft(draft: PolicyDraft) -> Result<Self, String>
pub fn from_draft(draft: PolicyDraft) -> Result<Self, String>
Build a policy from a draft, deriving the content-addressed
policy_id from canonical bytes of the body. Validates the
policy and returns an error if any rule is violated.
Sourcepub fn derive_id(&self) -> Result<String, String>
pub fn derive_id(&self) -> Result<String, String>
Compute the content-addressed vgp_* id from the policy body.
Excludes policy_id and valid_from_entry_hash from the
preimage so the id is derivable from policy semantics alone.
Sourcepub fn validate(&self) -> Result<(), String>
pub fn validate(&self) -> Result<(), String>
Validate the policy against the v0.144 rules. Returns an error string describing the first violation found.
Sourcepub fn verify_content_address(&self) -> Result<(), String>
pub fn verify_content_address(&self) -> Result<(), String>
Re-derive the id and assert it matches the stored value. Used by consumers loading a policy from disk or the wire.
Trait Implementations§
Source§impl Clone for GovernancePolicy
impl Clone for GovernancePolicy
Source§fn clone(&self) -> GovernancePolicy
fn clone(&self) -> GovernancePolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GovernancePolicy
impl Debug for GovernancePolicy
Source§impl<'de> Deserialize<'de> for GovernancePolicy
impl<'de> Deserialize<'de> for GovernancePolicy
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>,
Source§impl PartialEq for GovernancePolicy
impl PartialEq for GovernancePolicy
Source§fn eq(&self, other: &GovernancePolicy) -> bool
fn eq(&self, other: &GovernancePolicy) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for GovernancePolicy
impl Serialize for GovernancePolicy
impl Eq for GovernancePolicy
impl StructuralPartialEq for GovernancePolicy
Auto Trait Implementations§
impl Freeze for GovernancePolicy
impl RefUnwindSafe for GovernancePolicy
impl Send for GovernancePolicy
impl Sync for GovernancePolicy
impl Unpin for GovernancePolicy
impl UnsafeUnpin for GovernancePolicy
impl UnwindSafe for GovernancePolicy
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.