pub struct PolicyApproval {
pub generation: u64,
pub approved_hash: [u8; 32],
}Expand description
An approval record (design §14 containment backstop): the human-approved binding of a
policy generation to its expected hash. The loader accepts ONLY a policy whose recomputed
hash matches an approval for its generation. Even an undetected compiler bug then can’t
smuggle authority past review. S5 produces these (signed (UCAN_CID, bundle_hash)); here
we model the hash-match the loader enforces.
Fields§
§generation: u64§approved_hash: [u8; 32]Implementations§
Source§impl PolicyApproval
impl PolicyApproval
Sourcepub fn from_verified(binding: &ApprovalBinding) -> Self
pub fn from_verified(binding: &ApprovalBinding) -> Self
S5 → S4 keystone (#571 M2, additive). Convert a verified UCAN approval
binding into the PolicyApproval this loader requires. This is the one
wire that lets the S5 compiler’s output reach the S4 loader: the reviewer
signs a UCAN approval whose bundle_hash is exactly
CompiledPolicy::policy_hash; once the signature is verified
(SignedApproval::verify / verify_binds, hybrid COSE) the resulting
ApprovalBinding’s
(generation, bundle_hash) ARE the (generation, approved_hash) the loader
matches against — with the loader RECOMPUTING the hash itself (it never
trusts a transmitted hash; see PolicyLoader::load).
Pass only a binding you have already verified — borrowing the
&ApprovalBinding returned by SignedApproval::verify/verify_binds makes
that the natural call shape. No did:key/crypto happens here: this is a pure
field projection of an already-trusted binding.
Trait Implementations§
Source§impl Clone for PolicyApproval
impl Clone for PolicyApproval
Source§fn clone(&self) -> PolicyApproval
fn clone(&self) -> PolicyApproval
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 PolicyApproval
impl Debug for PolicyApproval
Source§impl PartialEq for PolicyApproval
impl PartialEq for PolicyApproval
Source§fn eq(&self, other: &PolicyApproval) -> bool
fn eq(&self, other: &PolicyApproval) -> bool
self and other values to be equal, and is used by ==.impl Eq for PolicyApproval
impl StructuralPartialEq for PolicyApproval
Auto Trait Implementations§
impl Freeze for PolicyApproval
impl RefUnwindSafe for PolicyApproval
impl Send for PolicyApproval
impl Sync for PolicyApproval
impl Unpin for PolicyApproval
impl UnsafeUnpin for PolicyApproval
impl UnwindSafe for PolicyApproval
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<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.§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
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.§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request