pub struct OrgPolicyV1 {
pub schema_version: u32,
pub kind: String,
pub org: String,
pub policy_version: String,
pub issued_at: String,
pub enforced: bool,
pub pack_toml: String,
pub signer_public_key: Option<String>,
pub signature: Option<String>,
}Expand description
A signed, centrally distributed org policy.
signature / signer_public_key are excluded from the signed payload (set
to None while computing the canonical bytes), exactly like the other
signed artifacts in the engine.
Fields§
§schema_version: u32§kind: StringDiscriminator so a verifier can refuse unrelated signed JSON.
org: StringOrganisation identifier (acme) — also selects the signing key.
policy_version: StringAdmin-set distribution version (2026.06.1) — lets a client see which
rollout it currently holds (independent of the pack’s own version).
issued_at: StringWhen the admin signed this rollout (RFC 3339).
enforced: boolWhen true, a client that has pinned this org’s key MUST apply the pack
as a floor (the runtime does; this flag is the admin’s declared intent
and is surfaced by policy org status).
pack_toml: StringThe authoritative pack source (verbatim TOML). Re-parsed + re-validated client-side, so the body cannot be swapped without breaking validation.
signer_public_key: Option<String>Ed25519 public key of the signing org key (hex). None until signed.
signature: Option<String>Ed25519 signature over the canonical bytes (hex). None until signed.
Implementations§
Source§impl OrgPolicyV1
impl OrgPolicyV1
Sourcepub fn build(
org: &str,
policy_version: &str,
enforced: bool,
pack_toml: &str,
) -> Result<Self, PolicyError>
pub fn build( org: &str, policy_version: &str, enforced: bool, pack_toml: &str, ) -> Result<Self, PolicyError>
Build an unsigned artifact from an authored pack source. The TOML is parsed + validated + resolved up front so an admin never distributes a pack that would be rejected on the endpoint.
Sourcepub fn pack(&self) -> Result<PolicyPack, PolicyError>
pub fn pack(&self) -> Result<PolicyPack, PolicyError>
The wrapped pack, re-parsed and validated from pack_toml.
Sourcepub fn resolved(&self) -> Result<ResolvedPolicy, PolicyError>
pub fn resolved(&self) -> Result<ResolvedPolicy, PolicyError>
The wrapped pack, fully resolved (its extends chain folded in).
Sourcepub fn canonical_bytes(&self) -> Result<Vec<u8>, String>
pub fn canonical_bytes(&self) -> Result<Vec<u8>, String>
Deterministic bytes that get signed/verified: the whole struct with the two signature fields cleared. Identical on sign and verify.
Sourcepub fn sign(&mut self) -> Result<(), String>
pub fn sign(&mut self) -> Result<(), String>
Sign with the org signing key from the keystore (created on first use).
Sourcepub fn sign_with_key(&mut self, key: &SigningKey)
pub fn sign_with_key(&mut self, key: &SigningKey)
Sign with an explicit key (used by sign and by hermetic tests). The
public key is embedded so the artifact is self-verifying.
Sourcepub fn verify(&self) -> OrgVerifyResult
pub fn verify(&self) -> OrgVerifyResult
Verify the embedded signature against the embedded public key — offline,
no audit trail, no network. A failure means the artifact was altered or
was never validly signed. Trust (is this key ours?) is a separate
check in super::trust.
Trait Implementations§
Source§impl Clone for OrgPolicyV1
impl Clone for OrgPolicyV1
Source§fn clone(&self) -> OrgPolicyV1
fn clone(&self) -> OrgPolicyV1
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 OrgPolicyV1
impl Debug for OrgPolicyV1
Source§impl<'de> Deserialize<'de> for OrgPolicyV1
impl<'de> Deserialize<'de> for OrgPolicyV1
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 OrgPolicyV1
impl PartialEq for OrgPolicyV1
Source§impl Serialize for OrgPolicyV1
impl Serialize for OrgPolicyV1
impl StructuralPartialEq for OrgPolicyV1
Auto Trait Implementations§
impl Freeze for OrgPolicyV1
impl RefUnwindSafe for OrgPolicyV1
impl Send for OrgPolicyV1
impl Sync for OrgPolicyV1
impl Unpin for OrgPolicyV1
impl UnsafeUnpin for OrgPolicyV1
impl UnwindSafe for OrgPolicyV1
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more