pub struct AuditEntry {
pub id: AuditEntryId,
pub timestamp: Timestamp,
pub session_id: SessionId,
pub principal: Option<PrincipalId>,
pub action: AuditAction,
pub authorization: AuthorizationProof,
pub outcome: AuditOutcome,
pub previous_hash: ContentHash,
pub runtime_key: PublicKey,
pub signature: Signature,
}Expand description
A single audit log entry.
Fields§
§id: AuditEntryIdUnique entry identifier.
timestamp: TimestampWhen this entry was created.
session_id: SessionIdSession this entry belongs to.
principal: Option<PrincipalId>The principal (user identity) this action was performed on behalf of.
None for system actions that have no user context.
action: AuditActionThe action being audited.
Authorization proof for this action.
outcome: AuditOutcomeOutcome of the action.
previous_hash: ContentHashHash of the previous entry (chain linking).
runtime_key: PublicKeyRuntime public key that signed this entry.
signature: SignatureSignature over entry contents.
Implementations§
Source§impl AuditEntry
impl AuditEntry
Sourcepub fn create(
session_id: SessionId,
action: AuditAction,
authorization: AuthorizationProof,
outcome: AuditOutcome,
previous_hash: ContentHash,
runtime_key: &KeyPair,
) -> Self
pub fn create( session_id: SessionId, action: AuditAction, authorization: AuthorizationProof, outcome: AuditOutcome, previous_hash: ContentHash, runtime_key: &KeyPair, ) -> Self
Create and sign a new audit entry.
Sourcepub fn create_with_principal(
session_id: SessionId,
principal: PrincipalId,
action: AuditAction,
authorization: AuthorizationProof,
outcome: AuditOutcome,
previous_hash: ContentHash,
runtime_key: &KeyPair,
) -> Self
pub fn create_with_principal( session_id: SessionId, principal: PrincipalId, action: AuditAction, authorization: AuthorizationProof, outcome: AuditOutcome, previous_hash: ContentHash, runtime_key: &KeyPair, ) -> Self
Create and sign a new audit entry with a principal.
Used when audit entries need to record which principal an action was performed on behalf of. Call sites will be wired when the kernel audit integration is updated.
Sourcepub fn signing_data(&self) -> Vec<u8> ⓘ
pub fn signing_data(&self) -> Vec<u8> ⓘ
Get the data used for signing.
Sourcepub fn content_hash(&self) -> ContentHash
pub fn content_hash(&self) -> ContentHash
Compute the content hash of this entry.
Sourcepub fn verify_signature(&self) -> AuditResult<()>
pub fn verify_signature(&self) -> AuditResult<()>
Verify the entry’s signature.
§Errors
Returns AuditError::InvalidSignature if the signature does not match
the entry contents.
Sourcepub fn follows(&self, previous: &AuditEntry) -> bool
pub fn follows(&self, previous: &AuditEntry) -> bool
Check if this entry follows another (chain linking).
Trait Implementations§
Source§impl Clone for AuditEntry
impl Clone for AuditEntry
Source§fn clone(&self) -> AuditEntry
fn clone(&self) -> AuditEntry
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more