pub struct SignedEvent {
pub id: String,
pub agent_id: String,
pub event_type: String,
pub payload_hash: Vec<u8>,
pub signature: Option<Vec<u8>>,
pub attest_level: String,
pub timestamp: String,
pub prev_hash: Vec<u8>,
pub sequence: i64,
}Expand description
One row of the signed_events audit table.
id is a UUIDv4 minted by the writer; payload_hash is the
32-byte SHA-256 over the canonical-CBOR bytes that H2 hashed for
the original signature; signature mirrors the source row’s
memory_links.signature (NULL when the source write was
unsigned).
prev_hash and sequence are populated by
append_signed_event (writer fills them from the current chain
head — callers MUST NOT set them) and by [row_to_event] on read
(selecting back rows from the table).
Fields§
§id: String§agent_id: String§event_type: String§payload_hash: Vec<u8>§signature: Option<Vec<u8>>§attest_level: String§timestamp: String§prev_hash: Vec<u8>v34 — SHA-256 (32 bytes) over the canonical-bytes encoding of
the preceding row, or 32 zero bytes for the first row. Filled
by append_signed_event at insert time; callers MUST NOT
pre-populate this field — any value set by the caller is
ignored. Use ..SignedEvent::default() at the struct-literal
tail to leave this empty.
sequence: i64v34 — monotonically-increasing chain rank starting at 1.
Filled by append_signed_event at insert time; callers MUST
NOT pre-populate this field — any value set by the caller is
ignored. Use ..SignedEvent::default() at the struct-literal
tail to leave this zero.
Implementations§
Source§impl SignedEvent
impl SignedEvent
Sourcepub fn with_daemon_signature(
payload_hash: Vec<u8>,
agent_id: String,
event_type: String,
timestamp: String,
) -> Self
pub fn with_daemon_signature( payload_hash: Vec<u8>, agent_id: String, event_type: String, timestamp: String, ) -> Self
v0.7.0 #1099 (SR-1 #4, HIGH) — build a SignedEvent that
consults the process-wide daemon audit signing key (installed
at boot via crate::governance::audit::init) and applies it
to payload_hash. When a key is installed, the returned row
carries signature: Some(sig_bytes) + attest_level: "daemon_signed"; when no key is installed, falls back to
signature: None, attest_level: "unsigned".
Homogenises every production audit-row writer (pending_action
approve/reject/timeout, federation.quota_refused on both
sqlite + postgres paths, governance.check) so a downstream
auditor sees per-row signatures matching the daemon’s
VerifyingKey and the cross-row chain head together.
The other chain columns (prev_hash, sequence) are left at
their defaults — append_signed_event fills them at INSERT
time. Callers MUST NOT pre-populate them.
Trait Implementations§
Source§impl Clone for SignedEvent
impl Clone for SignedEvent
Source§fn clone(&self) -> SignedEvent
fn clone(&self) -> SignedEvent
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 SignedEvent
impl Debug for SignedEvent
Source§impl Default for SignedEvent
impl Default for SignedEvent
Source§fn default() -> SignedEvent
fn default() -> SignedEvent
impl Eq for SignedEvent
Source§impl PartialEq for SignedEvent
impl PartialEq for SignedEvent
Source§fn eq(&self, other: &SignedEvent) -> bool
fn eq(&self, other: &SignedEvent) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for SignedEvent
Auto Trait Implementations§
impl Freeze for SignedEvent
impl RefUnwindSafe for SignedEvent
impl Send for SignedEvent
impl Sync for SignedEvent
impl Unpin for SignedEvent
impl UnsafeUnpin for SignedEvent
impl UnwindSafe for SignedEvent
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