pub struct NewTransaction {
pub request_id: String,
pub request_hash: String,
pub action_name: String,
pub risk_level: RiskLevel,
pub approval_id: Option<String>,
pub summary: String,
pub warnings: Vec<String>,
}Expand description
Data provided by the caller when recording a new transaction.
The initial status is always Queued — it is not caller-controllable.
Hardcoding this in the store prevents callers from bypassing the state
machine by recording a transaction in a terminal state.
Fields§
§request_id: String§request_hash: String§action_name: String§risk_level: RiskLevel§approval_id: Option<String>§summary: StringHuman-readable description of the planned action.
Chain-hashed at INSERT; intentionally not in the mutable field set.
summary is captured in crate::audit_chain::ChainContent and
baked into chain_hash = ed25519_sign(canonical(fields) || prev_hash, key)
at the moment the row is written. After that point the stored signature
is a one-time commitment.
Do not add an update_summary API (or any equivalent that modifies
this field in an existing row). Any such change will cause
sysknife audit verify to report VerifyOutcome::Broken for the
modified row, because the signature will no longer verify against the
stored chain_hash.
If a correction is genuinely needed, use one of the two safe strategies
documented on crate::audit_chain::ChainContent:
- Insert a corrective row that references the original
transaction_id. - Extend the chain protocol with a dedicated amendment record type.
warnings: Vec<String>Trait Implementations§
Source§impl Clone for NewTransaction
impl Clone for NewTransaction
Source§fn clone(&self) -> NewTransaction
fn clone(&self) -> NewTransaction
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 NewTransaction
impl Debug for NewTransaction
impl Eq for NewTransaction
Source§impl PartialEq for NewTransaction
impl PartialEq for NewTransaction
impl StructuralPartialEq for NewTransaction
Auto Trait Implementations§
impl Freeze for NewTransaction
impl RefUnwindSafe for NewTransaction
impl Send for NewTransaction
impl Sync for NewTransaction
impl Unpin for NewTransaction
impl UnsafeUnpin for NewTransaction
impl UnwindSafe for NewTransaction
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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