pub struct SignableWrite<'a> {
pub agent_id: &'a str,
pub namespace: &'a str,
pub title: &'a str,
pub kind: &'a str,
pub created_at: &'a str,
pub content_sha256: &'a [u8; 32],
}Expand description
The six fields the store-path write signature commits to.
Decoupled from crate::models::Memory on purpose: the signed bundle
pins exactly the identity-bearing surface of a write (who, where, what
title, what content, what kind, when) without dragging the full
Memory shape — so the verifier can re-derive the bytes directly from
the persisted row, and the canonical encoder has a single, audited
shape to commit to.
content_sha256 is the SHA-256 of the UTF-8 bytes of the memory
content (the same string that lands in memories.content). Hashing it
before signing keeps the canonical payload bounded regardless of body
length — a multi-kilobyte memory would otherwise dominate the signed
envelope and inflate every signed_events.payload_hash recomputation.
Fields§
§agent_id: &'a strThe claiming agent’s id. This is the field the attestation gate exists to bind: the signature proves the signer held the keypair registered to this id, upgrading the write from claimed to attested.
namespace: &'a strNamespace the write targets.
title: &'a strMemory title (the (title, namespace) pair is the upsert key, so
it is identity-bearing and must be inside the signed surface).
kind: &'a strMemory kind discriminant (e.g. "fact", "plan"). Pinned so a
signature minted for one kind cannot be replayed onto another.
created_at: &'a strRFC3339 creation timestamp pinned at insert time. Inside the signed surface so a captured signature cannot be replayed to back- or forward-date a write.
content_sha256: &'a [u8; 32]SHA-256 (32 bytes) over the rendered memory content’s UTF-8 bytes. Bounds the signed payload size.
Trait Implementations§
Source§impl<'a> Clone for SignableWrite<'a>
impl<'a> Clone for SignableWrite<'a>
Source§fn clone(&self) -> SignableWrite<'a>
fn clone(&self) -> SignableWrite<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'a> Debug for SignableWrite<'a>
impl<'a> Debug for SignableWrite<'a>
impl<'a> Eq for SignableWrite<'a>
Source§impl<'a> PartialEq for SignableWrite<'a>
impl<'a> PartialEq for SignableWrite<'a>
Source§fn eq(&self, other: &SignableWrite<'a>) -> bool
fn eq(&self, other: &SignableWrite<'a>) -> bool
self and other values to be equal, and is used by ==.impl<'a> StructuralPartialEq for SignableWrite<'a>
Auto Trait Implementations§
impl<'a> Freeze for SignableWrite<'a>
impl<'a> RefUnwindSafe for SignableWrite<'a>
impl<'a> Send for SignableWrite<'a>
impl<'a> Sync for SignableWrite<'a>
impl<'a> Unpin for SignableWrite<'a>
impl<'a> UnsafeUnpin for SignableWrite<'a>
impl<'a> UnwindSafe for SignableWrite<'a>
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§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> ErasedDestructor for Twhere
T: 'static,
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