pub struct IntegrityPolicyGate { /* private fields */ }Expand description
Enforces signature, sequence, and route identity integrity before persistence.
This is the P0 policy gate: every record must pass all checks here before it is allowed through to storage.
Implementations§
Source§impl IntegrityPolicyGate
impl IntegrityPolicyGate
pub fn new() -> Self
pub fn register_device( &mut self, device_id: impl Into<String>, key: VerifyingKey, )
Sourcepub fn enforce(
&mut self,
record: &AuditRecord,
cert_identity: Option<&str>,
) -> Result<(), IngestError>
pub fn enforce( &mut self, record: &AuditRecord, cert_identity: Option<&str>, ) -> Result<(), IngestError>
Run all integrity checks for record.
Checks (in order):
- Route identity —
cert_identitymust matchrecord.device_idwhen present. - Signature — payload hash must be signed by the registered device key.
- Sequence — must be strictly monotonic and non-duplicate.
- Previous-record hash — must match the last accepted record’s hash.
Trait Implementations§
Source§impl Default for IntegrityPolicyGate
impl Default for IntegrityPolicyGate
Source§fn default() -> IntegrityPolicyGate
fn default() -> IntegrityPolicyGate
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for IntegrityPolicyGate
impl RefUnwindSafe for IntegrityPolicyGate
impl Send for IntegrityPolicyGate
impl Sync for IntegrityPolicyGate
impl Unpin for IntegrityPolicyGate
impl UnsafeUnpin for IntegrityPolicyGate
impl UnwindSafe for IntegrityPolicyGate
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
Mutably borrows from an owned value. Read more