foundation capa

foundation-audit-log

Immutable, append-only audit logging for compliance and security

Immutable, append-only audit logging for compliance and security

Tierfoundation
Roleunclassified (baselined)
Pathcrates/foundation/audit-log
Edition2021
Targetsaudit-attest, fleet-inventory-gen, foundation_audit_log, attest_cluster, attest_inventory, attest_pure, pg_attest, pg_consumer_convergence, pg_starter_seed, pg_worm_enforcement
Public items213 across 21 modules
Tests236

What it is for

# foundation-audit-log

Immutable, append-only audit logging for compliance and security.

Answers "Who did what, when, and where?" with permanent records.

Core Principle

Audit logs are NEVER updated or deleted. Once created, a log entry is permanent.

Example

use foundation_audit_log::{AuditLog, Sensitivity, actions};
use uuid::Uuid;

// Log a model operation
let log = AuditLog::builder()
.action(actions::UPDATE)
.actor(Uuid::new_v4(), "john@example.com")
.target("posts.Post", "123", "Post: Hello World")
.sensitivity(Sensitivity::Normal)
.build();

// Log a non-model event
let event = AuditLog::event(actions::LOGIN_FAILED)
.actor_display("unknown@example.com")
.sensitivity(Sensitivity::High)
.build();

Capabilities

actions (other)

Standard audit log action constants.

Item
pub const CREATE: & str
pub const UPDATE: & str
pub const DELETE: & str
pub const VIEW: & str
pub const LOGIN: & str
pub const LOGOUT: & str
pub const LOGIN_FAILED: & str
pub const PASSWORD_CHANGED: & str
pub const SESSION_REVOKED: & str
pub const PASSWORD_RESET_REQUESTED: & str
pub const PERMISSION_DENIED: & str
pub const EXPORT: & str
pub const IMPORT: & str
pub const CORRECTION: & str
pub const ARCHIVE: & str
pub const RESTORE: & str
pub const APPROVE: & str
pub const REJECT: & str
pub const SUBMIT: & str

attest::auth (other)

Authentication enforcement (Sprint 3.1, US-3.1.4).

Item
pub const INVALID_PASSWORD_SQLSTATE: & str
pub const INVALID_AUTHORIZATION_SQLSTATE: & str
pub const INVALID_CATALOG_SQLSTATE: & str
pub const SENTINEL_PASSWORD: & str
fn auth_probe_dsn(dsn : & str) -> Option <String>
fn classify_audit_grants(role : & str, can_select : bool, can_insert : bool, can_update : bool, can_delete : bool,) -> CheckOutcome
fn classify_backup_currency(database : & str, age_hours : Option <u64>, window_hours : u64,) -> CheckOutcome

AuthProbeError

Authentication enforcement (Sprint 3.1, US-3.1.4).

Item
pub struct AuthProbeError
fn classify_auth_probe(result : Result <(), AuthProbeError>) -> CheckOutcome

attest::cluster (other)

Cluster-level authentication posture (Sprint 3.1, US-3.1.1).

Item
fn ipv4_mask_to_prefix(mask : & str) -> String
fn check_hba_auth_methods(rules : & HbaRule) -> ClusterOutcome
fn check_hba_exposure(rules : & HbaRule) -> ClusterOutcome
fn check_login_passwords(roles : & LoginRole) -> ClusterOutcome

ClusterCheckId

Cluster-level authentication posture (Sprint 3.1, US-3.1.1).

Item
pub enum ClusterCheckId
ClusterCheckId :: fn as_str(self) -> & 'static str
ClusterCheckId :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result

ClusterOutcome

Cluster-level authentication posture (Sprint 3.1, US-3.1.1).

Item
pub struct ClusterOutcome
fn check_transport_encryption(ssl_enabled : bool) -> ClusterOutcome

HbaRule

Cluster-level authentication posture (Sprint 3.1, US-3.1.1).

Item
pub struct HbaRule

LoginRole

Cluster-level authentication posture (Sprint 3.1, US-3.1.1).

Item
pub struct LoginRole

attest::db (other)

The SQL shell: catalog inspection + the destructive-probe harness.

Item
async fn attest_cluster(admin_url : & str,) -> Result <Vec <super::cluster::ClusterOutcome>, sqlx::Error>
async fn check_endpoint(c : & mut PgConnection) -> CheckOutcome
async fn check_topology(c : & mut PgConnection) -> CheckOutcome
async fn check_no_rules(c : & mut PgConnection) -> CheckOutcome
async fn check_triggers(c : & mut PgConnection) -> CheckOutcome
async fn check_truncate_guard_catalog(c : & mut PgConnection) -> CheckOutcome
async fn check_event_guards(c : & mut PgConnection) -> CheckOutcome
async fn check_ownership(c : & mut PgConnection, runtime_role : & str) -> CheckOutcome
async fn check_force_rls(c : & mut PgConnection) -> CheckOutcome
async fn check_row_hash(c : & mut PgConnection, statement_timeout_ms : u32) -> Vec <CheckOutcome>
async fn observe_invariant(c : & mut PgConnection) -> Result <InvariantRecord, sqlx::Error>
async fn check_fingerprint(c : & mut PgConnection, expected : Option <& str>) -> CheckOutcome

AttestConfig

The SQL shell: catalog inspection + the destructive-probe harness.

Item
pub struct AttestConfig
AttestConfig :: fn new(inspect_url : impl Into <String>, runtime_role : impl Into <String>) -> Self
async fn probe_once(rt : & mut PgConnection, cfg : & AttestConfig, kind : ProbeKind, sql : & str,) -> CheckOutcome
async fn attest(cfg : & AttestConfig) -> Result <Evidence, sqlx::Error>

attest::evidence (other)

The per-database evidence record, and DSN redaction.

Item
fn redact_dsn(dsn : & str) -> String
fn dsn_identity(dsn : & str) -> String

Evidence

The per-database evidence record, and DSN redaction.

Item
pub struct Evidence
Evidence :: fn new(dsn : & str, runtime_role : & str, checks : Vec <CheckOutcome>) -> Self
Evidence :: fn with_fingerprints(mut self, expected : String, observed : String) -> Self

attest::fingerprint (other)

Deployed-invariant fingerprinting.

Item
fn normalize_definition(src : & str) -> String
fn is_definition_key(key : & str) -> bool
pub const CANONICAL_FINGERPRINT: & str

InvariantRecord

Deployed-invariant fingerprinting.

Item
pub struct InvariantRecord
InvariantRecord :: fn new() -> Self
InvariantRecord :: fn put(& mut self, key : impl Into <String>, value : impl AsRef <str>)
InvariantRecord :: fn get(& self, key : & str) -> Option <& str>
InvariantRecord :: fn len(& self) -> usize
InvariantRecord :: fn is_empty(& self) -> bool
InvariantRecord :: fn iter(& self) -> impl Iterator <Item =(& str, & str)>
InvariantRecord :: fn drifted_keys(& self, other : & Self) -> Vec <String>
InvariantRecord :: fn definitions(& self) -> Self
fn fingerprint(record : & InvariantRecord) -> String

EphemeralRule

The fleet inventory — the scope declaration for an attestation run.

Item
pub struct EphemeralRule

Inventory

The fleet inventory — the scope declaration for an attestation run.

Item
pub struct Inventory
Inventory :: fn len(& self) -> usize
Inventory :: fn is_empty(& self) -> bool
Inventory :: fn get(& self, name : & str) -> Option <& InventoryEntry>
Inventory :: fn names(& self) -> impl Iterator <Item = & str>
Inventory :: fn entries(& self) -> impl Iterator <Item = & InventoryEntry>
Inventory :: fn is_ephemeral(& self, name : & str) -> bool
Inventory :: fn undeclared <'a>(& self, live : & 'a String) -> Vec <& 'a String>
fn parse_inventory(src : & str) -> Result <Inventory, InventoryError>

InventoryEntry

The fleet inventory — the scope declaration for an attestation run.

Item
pub struct InventoryEntry
InventoryEntry :: fn scope_state(& self) -> ScopeState

InventoryError

The fleet inventory — the scope declaration for an attestation run.

Item
pub enum InventoryError
InventoryError :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result

attest::probe (other)

Destructive-probe classification — the attestor's sharpest edge.

Item
pub const WORM_SQLSTATE: & str
fn classify_probe(kind : ProbeKind, result : Result <(), ProbeError>) -> CheckOutcome

ProbeError

Destructive-probe classification — the attestor's sharpest edge.

Item
pub struct ProbeError

ProbeKind

Destructive-probe classification — the attestor's sharpest edge.

Item
pub enum ProbeKind
ProbeKind :: fn check_id(self) -> CheckId
ProbeKind :: fn as_str(self) -> & 'static str

FleetReport

Fleet roll-up: SOURCE COMPLETE is not DEPLOYED COMPLETE.

Item
pub struct FleetReport
FleetReport :: fn new() -> Self
FleetReport :: fn record(& mut self, database : impl Into <String>, state : ScopeState)
FleetReport :: fn passing(& self) -> usize
FleetReport :: fn failing(& self) -> usize
FleetReport :: fn not_certified(& self) -> usize
FleetReport :: fn len(& self) -> usize
FleetReport :: fn is_empty(& self) -> bool
FleetReport :: fn verdict(& self) -> CheckStatus
FleetReport :: fn render_markdown(& self) -> String

ScopeState

Fleet roll-up: SOURCE COMPLETE is not DEPLOYED COMPLETE.

Item
pub enum ScopeState
ScopeState :: fn status(self) -> Option <CheckStatus>
ScopeState :: fn label(self) -> String

attest::status (other)

Check identity, evidence status, and the fail-closed roll-up.

Item
fn roll_up(checks : & CheckOutcome) -> CheckStatus

CheckId

Check identity, evidence status, and the fail-closed roll-up.

Item
pub enum CheckId
CheckId :: fn as_str(self) -> & 'static str
CheckId :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result

CheckOutcome

Check identity, evidence status, and the fail-closed roll-up.

Item
pub struct CheckOutcome
CheckOutcome :: fn new(id : CheckId, status : CheckStatus, detail : impl Into <String>) -> Self

CheckStatus

Check identity, evidence status, and the fail-closed roll-up.

Item
pub enum CheckStatus
CheckStatus :: fn is_passing(self) -> bool
CheckStatus :: fn as_str(self) -> & 'static str
CheckStatus :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result
fn exit_code(verdict : CheckStatus) -> i32

AuditEventBuilder:AuditEventBuilder

Builder patterns for audit log entries.

Item
pub struct AuditEventBuilder

AuditEventBuilder:actor

Builder patterns for audit log entries.

Item
AuditEventBuilder :: fn actor(mut self, id : Uuid, display : impl Into <String>) -> Self
AuditEventBuilder :: fn actor_display(mut self, display : impl Into <String>) -> Self

AuditEventBuilder:build

Builder patterns for audit log entries.

Item
AuditEventBuilder :: fn build(self) -> AuditLog

AuditEventBuilder:ip

Builder patterns for audit log entries.

Item
AuditEventBuilder :: fn ip(mut self, ip : impl Into <String>) -> Self

AuditEventBuilder:metadata

Builder patterns for audit log entries.

Item
AuditEventBuilder :: fn metadata(mut self, metadata : JsonValue) -> Self

AuditEventBuilder:new

Builder patterns for audit log entries.

Item
AuditEventBuilder :: fn new(action : impl Into <String>) -> Self

AuditEventBuilder:outcome

Builder patterns for audit log entries.

Item
AuditEventBuilder :: fn outcome(mut self, outcome : AuditOutcome) -> Self

AuditEventBuilder:request

Builder patterns for audit log entries.

Item
AuditEventBuilder :: fn request_context(mut self, ctx : RequestContext) -> Self

AuditEventBuilder:sensitivity

Builder patterns for audit log entries.

Item
AuditEventBuilder :: fn sensitivity(mut self, level : Sensitivity) -> Self

AuditEventBuilder:source

Builder patterns for audit log entries.

Item
AuditEventBuilder :: fn source(mut self, source : AuditSource) -> Self

AuditEventBuilder:system

Builder patterns for audit log entries.

Item
AuditEventBuilder :: fn system(mut self) -> Self

AuditEventBuilder:tenant

Builder patterns for audit log entries.

Item
AuditEventBuilder :: fn tenant(mut self, tenant_id : Uuid) -> Self

AuditEventBuilder:user

Builder patterns for audit log entries.

Item
AuditEventBuilder :: fn user_agent(mut self, ua : impl Into <String>) -> Self

AuditLogBuilder:AuditLogBuilder

Builder patterns for audit log entries.

Item
pub struct AuditLogBuilder

AuditLogBuilder:action

Builder patterns for audit log entries.

Item
AuditLogBuilder :: fn action(mut self, action : impl Into <String>) -> Self

AuditLogBuilder:actor

Builder patterns for audit log entries.

Item
AuditLogBuilder :: fn actor(mut self, id : Uuid, display : impl Into <String>) -> Self
AuditLogBuilder :: fn actor_display(mut self, display : impl Into <String>) -> Self

AuditLogBuilder:build

Builder patterns for audit log entries.

Item
AuditLogBuilder :: fn build(self) -> AuditLog

AuditLogBuilder:changes

Builder patterns for audit log entries.

Item
AuditLogBuilder :: fn changes(mut self, changes : JsonValue) -> Self

AuditLogBuilder:ip

Builder patterns for audit log entries.

Item
AuditLogBuilder :: fn ip(mut self, ip : impl Into <String>) -> Self

AuditLogBuilder:metadata

Builder patterns for audit log entries.

Item
AuditLogBuilder :: fn metadata(mut self, metadata : JsonValue) -> Self

AuditLogBuilder:new

Builder patterns for audit log entries.

Item
AuditLogBuilder :: fn new() -> Self

AuditLogBuilder:outcome

Builder patterns for audit log entries.

Item
AuditLogBuilder :: fn outcome(mut self, outcome : AuditOutcome) -> Self

AuditLogBuilder:request

Builder patterns for audit log entries.

Item
AuditLogBuilder :: fn request_context(mut self, ctx : RequestContext) -> Self
AuditLogBuilder :: fn request_id(mut self, id : impl Into <String>) -> Self

AuditLogBuilder:sensitivity

Builder patterns for audit log entries.

Item
AuditLogBuilder :: fn sensitivity(mut self, level : Sensitivity) -> Self

AuditLogBuilder:source

Builder patterns for audit log entries.

Item
AuditLogBuilder :: fn source(mut self, source : AuditSource) -> Self

AuditLogBuilder:system

Builder patterns for audit log entries.

Item
AuditLogBuilder :: fn system(mut self) -> Self

AuditLogBuilder:target

Builder patterns for audit log entries.

Item
AuditLogBuilder :: fn target(mut self, model_label : impl Into <String>, object_id : impl Into <String>, object_repr : impl Into <String>,) -> Self

AuditLogBuilder:tenant

Builder patterns for audit log entries.

Item
AuditLogBuilder :: fn tenant(mut self, tenant_id : Uuid) -> Self

AuditLogBuilder:trace

Builder patterns for audit log entries.

Item
AuditLogBuilder :: fn trace_id(mut self, id : impl Into <String>) -> Self

AuditLogBuilder:user

Builder patterns for audit log entries.

Item
AuditLogBuilder :: fn user_agent(mut self, ua : impl Into <String>) -> Self

Checkpoint

Signed Merkle checkpoints (Sprint 3.23A).

Item
pub struct Checkpoint
Checkpoint :: fn signing_bytes(& self) -> Vec <u8>
Checkpoint :: fn sign(& self, signing_key : & SigningKey) -> SignedCheckpoint

SignedCheckpoint

Signed Merkle checkpoints (Sprint 3.23A).

Item
pub struct SignedCheckpoint
SignedCheckpoint :: fn verify(& self, verifying_key : & VerifyingKey,) -> Result <(), foundation_crypto_sign::Error>

RequestContext

Request context for audit logging.

Item
pub struct RequestContext
RequestContext :: fn new() -> Self
RequestContext :: fn with_ip(mut self, ip : impl Into <String>) -> Self
RequestContext :: fn with_user_agent(mut self, ua : impl Into <String>) -> Self
RequestContext :: fn with_request_id(mut self, id : impl Into <String>) -> Self
RequestContext :: fn with_trace_id(mut self, id : impl Into <String>) -> Self
RequestContext :: fn extract_ip_from_forwarded(forwarded : Option <& str>, direct : Option <& str>,) -> Option <String>
RequestContext :: fn extract_client_ip(forwarded : Option <& str>, direct : Option <& str>, trusted_proxy_count : usize,) -> Option <String>

InMemorySubjectKeyStore

De-identification model (Sprint 0.55, T4).

Item
pub struct InMemorySubjectKeyStore
InMemorySubjectKeyStore :: fn new() -> Self
InMemorySubjectKeyStore :: fn ensure(& mut self, subject_id : Uuid, key_material : Vec <u8>) -> Pseudonym
InMemorySubjectKeyStore :: fn get(& self, subject_id : Uuid) -> Option <& u8>
InMemorySubjectKeyStore :: fn pseudonym_of(& self, subject_id : Uuid) -> Option <Pseudonym>
InMemorySubjectKeyStore :: fn shred(& mut self, subject_id : Uuid) -> Option <Pseudonym>
InMemorySubjectKeyStore :: fn is_erased(& self, subject_id : Uuid) -> bool

Pseudonym

De-identification model (Sprint 0.55, T4).

Item
pub struct Pseudonym
Pseudonym :: fn random() -> Self
Pseudonym :: fn from_uuid(id : Uuid) -> Self
Pseudonym :: fn as_uuid(& self) -> Uuid
fn row_affected_by(actor : Option <Pseudonym>, target : Option <Pseudonym>, subject : Pseudonym,) -> bool

SubjectKeyStore

De-identification model (Sprint 0.55, T4).

Item
pub trait SubjectKeyStore

AuditError

Error types for audit logging.

Item
pub enum AuditError

hash (other)

Tamper-evidence library crates (Sprint 0.55, T3).

Item
fn canonicalize(value : & Value) -> Vec <u8>
fn sha256_hex(bytes : & u8) -> String
fn hmac_hex(key : & u8, data : & u8) -> String
fn row_hash(key : & u8, payload : & Value) -> String
fn merkle_root(leaf_hashes : & String) -> Option <String>

Sha256Stream

Tamper-evidence library crates (Sprint 0.55, T3).

Item
pub struct Sha256Stream
Sha256Stream :: fn new() -> Self
Sha256Stream :: fn update(& mut self, chunk : & u8)
Sha256Stream :: fn finalize_hex(self) -> String

AuditLog

Audit log model.

Item
pub struct AuditLog
AuditLog :: fn builder() -> AuditLogBuilder
AuditLog :: fn event(action : impl Into <String>) -> AuditEventBuilder
AuditLog :: fn login(actor_id : Uuid, display : impl Into <String>) -> AuditEventBuilder
AuditLog :: fn logout(actor_id : Uuid, display : impl Into <String>) -> AuditEventBuilder
AuditLog :: fn login_failed(attempted_identity : impl Into <String>) -> AuditEventBuilder
AuditLog :: fn module(& self) -> Option <& str>
AuditLog :: fn model_name(& self) -> Option <& str>
AuditLog :: fn id(& self) -> Uuid

AuditOutcome

Provenance for an audit entry: which surface it came from (source) and how

Item
pub enum AuditOutcome
AuditOutcome :: fn as_str(& self) -> & 'static str
AuditOutcome :: fn parse(s : & str) -> Option <Self>
AuditOutcome :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result

AuditSource

Provenance for an audit entry: which surface it came from (source) and how

Item
pub enum AuditSource
AuditSource :: fn as_str(& self) -> & 'static str
AuditSource :: fn parse(s : & str) -> Option <Self>
AuditSource :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result

redact (other)

Centralized, enforced redaction for audit changes / metadata payloads

Item
pub const REDACTED: & str
pub const DEFAULT_MAX_STRING_LEN: usize
pub const SECRET_KEY_DENYLIST: & & str
fn is_secret_key(key : & str) -> bool
fn redact(value : & Value) -> Value
fn redact_with_limit(value : & Value, max_string_len : usize) -> Value

Sensitivity

Sensitivity levels for audit log classification.

Item
pub enum Sensitivity
Sensitivity :: fn as_str(& self) -> & 'static str
Sensitivity :: fn parse(s : & str) -> Option <Self>
Sensitivity :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result

How to use it

From this crate's own rustdoc:

use foundation_audit_log::{AuditLog, Sensitivity, actions};
use uuid::Uuid;

// Log a model operation
let log = AuditLog::builder()
    .action(actions::UPDATE)
    .actor(Uuid::new_v4(), "john@example.com")
    .target("posts.Post", "123", "Post: Hello World")
    .sensitivity(Sensitivity::Normal)
    .build();

// Log a non-model event
let event = AuditLog::event(actions::LOGIN_FAILED)
    .actor_display("unknown@example.com")
    .sensitivity(Sensitivity::High)
    .build();

Module structure

foundation_audit_log

flowchart TD
  n_foundation_audit_log["foundation_audit_log"]
  n_foundation_audit_log --> n_actions["actions"]
  n_foundation_audit_log --> n_attest["attest"]
  n_attest --> n_attest__auth["auth"]
  n_attest --> n_attest__cluster["cluster"]
  n_attest --> n_attest__db["db"]
  n_attest --> n_attest__evidence["evidence"]
  n_attest --> n_attest__fingerprint["fingerprint"]
  n_attest --> n_attest__inventory["inventory"]
  n_attest --> n_attest__probe["probe"]
  n_attest --> n_attest__report["report"]
  n_attest --> n_attest__status["status"]
  n_foundation_audit_log --> n_builder["builder"]
  n_foundation_audit_log --> n_checkpoint["checkpoint"]
  n_foundation_audit_log --> n_context["context"]
  n_foundation_audit_log --> n_deid["deid"]
  n_foundation_audit_log --> n_error["error"]
  n_foundation_audit_log --> n_hash["hash"]
  n_foundation_audit_log --> n_model["model"]
  n_foundation_audit_log --> n_provenance["provenance"]
  n_foundation_audit_log --> n_redact["redact"]
  n_foundation_audit_log --> n_sensitivity["sensitivity"]

Public surface

`actions`

ItemWhat it is
pub const CREATE: & strCreate a new record.
pub const UPDATE: & strUpdate an existing record.
pub const DELETE: & strDelete a record (soft or hard).
pub const VIEW: & strView/read a record.
pub const LOGIN: & strSuccessful login.
pub const LOGOUT: & strLogout.
pub const LOGIN_FAILED: & strFailed login attempt.
pub const PASSWORD_CHANGED: & strPassword changed.
pub const SESSION_REVOKED: & strSession revoked (forced logout).
pub const PASSWORD_RESET_REQUESTED: & strPassword reset requested.
pub const PERMISSION_DENIED: & strPermission denied.
pub const EXPORT: & strExport data.
pub const IMPORT: & strImport data.
pub const CORRECTION: & strCorrection to a previous audit entry.
pub const ARCHIVE: & strArchive a record.
pub const RESTORE: & strRestore a record.
pub const APPROVE: & strApprove something (workflow).
pub const REJECT: & strReject something (workflow).
pub const SUBMIT: & strSubmit something (workflow).

`attest::auth`

ItemWhat it is
pub const INVALID_PASSWORD_SQLSTATE: & strinvalid_password — the server read the credential and rejected it
pub const INVALID_AUTHORIZATION_SQLSTATE: & strinvalid_authorization_specification — covers a pg_hba reject rule and "no pg_hba.conf entry"
pub const INVALID_CATALOG_SQLSTATE: & strinvalid_catalog_name — the database does not exist
pub const SENTINEL_PASSWORD: & strThe deliberately-wrong password used by the probe
pub struct AuthProbeErrorA connection failure reduced to the two fields classification depends on
fn auth_probe_dsn(dsn : & str) -> Option <String>Rewrite a runtime DSN into a negative-authentication probe DSN
fn classify_auth_probe(result : Result <(), AuthProbeError>) -> CheckOutcomeClassify one negative-authentication probe into evidence
fn classify_audit_grants(role : & str, can_select : bool, can_insert : bool, can_update : bool, can_delete : bool,) -> CheckOutcomeC18 — classify the runtime role's grants on audit_logs
fn classify_backup_currency(database : & str, age_hours : Option <u64>, window_hours : u64,) -> CheckOutcomeC19 — is there a current, verified backup for this database? age_hours = None means no backup has ever been recorded, which is the worst case and must never read softer than a stale one

`attest::cluster`

ItemWhat it is
pub enum ClusterCheckIdA cluster-scope finding
ClusterCheckId :: fn as_str(self) -> & 'static strStable snake_case identifier for evidence records.
ClusterCheckId :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result
pub struct ClusterOutcomeThe evidence one cluster-scope check produced.
pub struct HbaRuleOne row of pg_hba_file_rules, reduced to the fields posture depends on.
pub struct LoginRoleA role that can log in, and whether it has a password verifier.
fn ipv4_mask_to_prefix(mask : & str) -> StringConvert a dotted-quad netmask to a CIDR prefix length
fn check_hba_auth_methods(rules : & HbaRule) -> ClusterOutcomeDo any rules authenticate nothing, or authenticate weakly? trust is a Fail: some route accepts any credential
fn check_hba_exposure(rules : & HbaRule) -> ClusterOutcomeIs any rule reachable from an arbitrary source address? This is about reachability, not credentials, so an authenticated wildcard still fails: it exposes the port to the internet and reduces the boundary to one password.
fn check_login_passwords(roles : & LoginRole) -> ClusterOutcomeDoes every login role have a password? This is the ordering hazard made measurable
fn check_transport_encryption(ssl_enabled : bool) -> ClusterOutcomeIs traffic encrypted in transit? Partial rather than Fail when off, and the distinction is deliberate

`attest::db`

ItemWhat it is
pub struct AttestConfigHow to attest one database.
AttestConfig :: fn new(inspect_url : impl Into <String>, runtime_role : impl Into <String>) -> SelfConfig with the documented safe defaults.
async fn attest_cluster(admin_url : & str,) -> Result <Vec <super::cluster::ClusterOutcome>, sqlx::Error>Read cluster-wide authentication posture
async fn check_endpoint(c : & mut PgConnection) -> CheckOutcomeC1 — endpoint identity
async fn check_topology(c : & mut PgConnection) -> CheckOutcomeC3 — topology
async fn check_no_rules(c : & mut PgConnection) -> CheckOutcomeC4 — the landmine
async fn check_triggers(c : & mut PgConnection) -> CheckOutcomeC5 — exact trigger inventory
async fn check_truncate_guard_catalog(c : & mut PgConnection) -> CheckOutcomeC13c — the TRUNCATE axis, carried by catalog evidence
async fn check_event_guards(c : & mut PgConnection) -> CheckOutcomeC6 — the superuser event-trigger guards must exist, be enabled, and no maintenance window may be open (an open window means they are bypassed).
async fn check_ownership(c : & mut PgConnection, runtime_role : & str) -> CheckOutcomeC7 — the primary invariant (consensus #24)
async fn check_force_rls(c : & mut PgConnection) -> CheckOutcomeC9 — RLS must be ENABLED and FORCED; without FORCE the owner bypasses every policy and tenant isolation is a no-op.
async fn check_row_hash(c : & mut PgConnection, statement_timeout_ms : u32) -> Vec <CheckOutcome>C10/C11 — consensus #15
async fn observe_invariant(c : & mut PgConnection) -> Result <InvariantRecord, sqlx::Error>Gather the structural record of the deployed invariant (consensus #25).
async fn check_fingerprint(c : & mut PgConnection, expected : Option <& str>) -> CheckOutcomeC8 — compare the observed invariant against the canonical fingerprint.
async fn probe_once(rt : & mut PgConnection, cfg : & AttestConfig, kind : ProbeKind, sql : & str,) -> CheckOutcomeRun one destructive statement inside an always-rolled-back transaction
async fn attest(cfg : & AttestConfig) -> Result <Evidence, sqlx::Error>Attest one database

`attest::evidence`

ItemWhat it is
fn redact_dsn(dsn : & str) -> StringStrip the password from a Postgres connection URL, preserving everything else
fn dsn_identity(dsn : & str) -> StringExtract a human-readable database identity (host:port/dbname) from a DSN, for report tables
pub struct EvidenceOne database's attestation result.
Evidence :: fn new(dsn : & str, runtime_role : & str, checks : Vec <CheckOutcome>) -> SelfBuild an evidence record, redacting the DSN and rolling up the verdict
Evidence :: fn with_fingerprints(mut self, expected : String, observed : String) -> SelfAttach the canonical/observed fingerprint pair.

`attest::fingerprint`

ItemWhat it is
fn normalize_definition(src : & str) -> StringNormalize a catalog-sourced definition for hashing
pub struct InvariantRecordA structural record of the deployed invariant: sorted key -> value facts
InvariantRecord :: fn new() -> SelfAn empty record.
InvariantRecord :: fn put(& mut self, key : impl Into <String>, value : impl AsRef <str>)Record one fact
InvariantRecord :: fn get(& self, key : & str) -> Option <& str>Read a recorded fact.
InvariantRecord :: fn len(& self) -> usizeNumber of recorded facts.
InvariantRecord :: fn is_empty(& self) -> boolWhether nothing has been recorded.
InvariantRecord :: fn iter(& self) -> impl Iterator <Item =(& str, & str)>Iterate the facts in stable key order.
InvariantRecord :: fn drifted_keys(& self, other : & Self) -> Vec <String>The keys whose values differ from other (either side missing counts)
fn is_definition_key(key : & str) -> boolKeys whose values are definition facts — identical on every correctly migrated database — as opposed to deployment facts that legitimately differ per install
InvariantRecord :: fn definitions(& self) -> SelfThe definition-only subset, which is what fingerprint is compared against CANONICAL_FINGERPRINT for.
pub const CANONICAL_FINGERPRINT: & strThe fingerprint of the definition subset produced by migrations 001005 on PostgreSQL 16
fn fingerprint(record : & InvariantRecord) -> StringSHA-256 over the record, in stable key order, as lowercase hex

`attest::inventory`

ItemWhat it is
pub enum InventoryErrorWhy an inventory could not be used
InventoryError :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result
pub struct EphemeralRuleA declared rule for recognising per-run test residue
pub struct InventoryEntryOne declared database.
InventoryEntry :: fn scope_state(& self) -> ScopeStateThe scope state implied by the declaration alone, before any attestation.
pub struct InventoryA validated scope declaration.
Inventory :: fn len(& self) -> usizeNumber of declared databases.
Inventory :: fn is_empty(& self) -> boolWhether nothing is declared (never true for a parsed inventory).
Inventory :: fn get(& self, name : & str) -> Option <& InventoryEntry>Look a database up by name.
Inventory :: fn names(& self) -> impl Iterator <Item = & str>Declared names, in stable order.
Inventory :: fn entries(& self) -> impl Iterator <Item = & InventoryEntry>Every declared entry, in stable order.
Inventory :: fn is_ephemeral(& self, name : & str) -> boolDoes name match a declared ephemeral rule (i.e
Inventory :: fn undeclared <'a>(& self, live : & 'a String) -> Vec <& 'a String>Live databases that are neither declared nor recognised as ephemeral
fn parse_inventory(src : & str) -> Result <Inventory, InventoryError>

`attest::probe`

ItemWhat it is
pub const WORM_SQLSTATE: & strSQLSTATE the canonical guards raise (insufficient_privilege).
pub enum ProbeKindThe destructive operations the attestor probes.
ProbeKind :: fn check_id(self) -> CheckIdThe check this probe reports under.
ProbeKind :: fn as_str(self) -> & 'static strSQL-ish name for messages.
pub struct ProbeErrorA database error reduced to the two fields classification depends on
fn classify_probe(kind : ProbeKind, result : Result <(), ProbeError>) -> CheckOutcomeClassify one destructive probe into evidence

`attest::report`

ItemWhat it is
pub enum ScopeStateWhat the attestor could establish about one in-scope database.
ScopeState :: fn status(self) -> Option <CheckStatus>The status this state contributes to the fleet verdict.
ScopeState :: fn label(self) -> StringReport label.
pub struct FleetReportThe fleet-wide roll-up.
FleetReport :: fn new() -> SelfAn empty report
FleetReport :: fn record(& mut self, database : impl Into <String>, state : ScopeState)Record one database's outcome.
FleetReport :: fn passing(& self) -> usizeDatabases with a proven-good verdict.
FleetReport :: fn failing(& self) -> usizeDatabases with a proven violation.
FleetReport :: fn not_certified(& self) -> usizeEverything that is not a proven PASS, excluding rows declared out of scope
FleetReport :: fn len(& self) -> usizeTotal in-scope rows recorded.
FleetReport :: fn is_empty(& self) -> boolWhether nothing was recorded.
FleetReport :: fn verdict(& self) -> CheckStatusThe worst status across the fleet
FleetReport :: fn render_markdown(& self) -> StringMarkdown table for the sprint doc / runbook.

`attest::status`

ItemWhat it is
pub enum CheckStatusThe evidence a single check produced
CheckStatus :: fn is_passing(self) -> boolOnly Pass certifies
CheckStatus :: fn as_str(self) -> & 'static strStable lowercase name for reports and evidence records.
CheckStatus :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result
pub enum CheckIdThe check catalog (US-3.0.5 C1–C16)
CheckId :: fn as_str(self) -> & 'static strStable snake_case identifier used in evidence records.
CheckId :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result
pub struct CheckOutcomeOne check's result plus the human-readable evidence for it.
CheckOutcome :: fn new(id : CheckId, status : CheckStatus, detail : impl Into <String>) -> SelfBuild an outcome with an owned detail string.
fn roll_up(checks : & CheckOutcome) -> CheckStatusRoll a check set up to a single verdict: the worst status observed
fn exit_code(verdict : CheckStatus) -> i32CI exit-code contract (consensus #14)

`builder`

ItemWhat it is
pub struct AuditLogBuilderBuilder for audit log entries with model targets.
AuditLogBuilder :: fn new() -> SelfCreate a new builder.
AuditLogBuilder :: fn action(mut self, action : impl Into <String>) -> SelfSet the action (required).
AuditLogBuilder :: fn tenant(mut self, tenant_id : Uuid) -> SelfSet the tenant ID (for multi-tenant applications).
AuditLogBuilder :: fn actor(mut self, id : Uuid, display : impl Into <String>) -> SelfSet the actor (user who performed the action).
AuditLogBuilder :: fn system(mut self) -> SelfMark as a system action (no human actor).
AuditLogBuilder :: fn actor_display(mut self, display : impl Into <String>) -> SelfSet the actor display without a DB user id — e.g
AuditLogBuilder :: fn target(mut self, model_label : impl Into <String>, object_id : impl Into <String>, object_repr : impl Into <String>,) -> SelfSet the target object.
AuditLogBuilder :: fn changes(mut self, changes : JsonValue) -> SelfSet the changes diff.
AuditLogBuilder :: fn request_context(mut self, ctx : RequestContext) -> SelfSet request context (IP, user agent, etc.).
AuditLogBuilder :: fn sensitivity(mut self, level : Sensitivity) -> SelfSet sensitivity level.
AuditLogBuilder :: fn metadata(mut self, metadata : JsonValue) -> SelfSet additional metadata.
AuditLogBuilder :: fn source(mut self, source : AuditSource) -> SelfSet the origin surface (Sprint 0.55 T11; default AuditSource::Web).
AuditLogBuilder :: fn outcome(mut self, outcome : AuditOutcome) -> SelfSet the outcome (Sprint 0.55 T11; default AuditOutcome::Success).
AuditLogBuilder :: fn ip(mut self, ip : impl Into <String>) -> SelfSet IP address directly.
AuditLogBuilder :: fn user_agent(mut self, ua : impl Into <String>) -> SelfSet user agent directly.
AuditLogBuilder :: fn request_id(mut self, id : impl Into <String>) -> SelfSet request ID directly.
AuditLogBuilder :: fn trace_id(mut self, id : impl Into <String>) -> SelfSet trace ID directly.
AuditLogBuilder :: fn build(self) -> AuditLogBuild the audit log entry.
pub struct AuditEventBuilderBuilder for audit event entries (no model target).
AuditEventBuilder :: fn new(action : impl Into <String>) -> SelfCreate a new event builder with the given action.
AuditEventBuilder :: fn tenant(mut self, tenant_id : Uuid) -> SelfSet the tenant ID (for multi-tenant applications).
AuditEventBuilder :: fn actor(mut self, id : Uuid, display : impl Into <String>) -> SelfSet the actor.
AuditEventBuilder :: fn actor_display(mut self, display : impl Into <String>) -> SelfSet actor display name without ID (for failed logins, etc.).
AuditEventBuilder :: fn system(mut self) -> SelfMark as a system action.
AuditEventBuilder :: fn sensitivity(mut self, level : Sensitivity) -> SelfSet sensitivity level.
AuditEventBuilder :: fn metadata(mut self, metadata : JsonValue) -> SelfSet additional metadata.
AuditEventBuilder :: fn source(mut self, source : AuditSource) -> SelfSet the origin surface (Sprint 0.55 T11; default AuditSource::Web).
AuditEventBuilder :: fn outcome(mut self, outcome : AuditOutcome) -> SelfSet the outcome (Sprint 0.55 T11; default AuditOutcome::Success).
AuditEventBuilder :: fn request_context(mut self, ctx : RequestContext) -> SelfSet request context.
AuditEventBuilder :: fn ip(mut self, ip : impl Into <String>) -> SelfSet IP address directly.
AuditEventBuilder :: fn user_agent(mut self, ua : impl Into <String>) -> SelfSet user agent directly.
AuditEventBuilder :: fn build(self) -> AuditLogBuild the audit log entry.

`checkpoint`

ItemWhat it is
pub struct CheckpointA tamper-evidence checkpoint over a contiguous seq range of audit rows
Checkpoint :: fn signing_bytes(& self) -> Vec <u8>The deterministic, domain-separated byte preimage this checkpoint is signed over
Checkpoint :: fn sign(& self, signing_key : & SigningKey) -> SignedCheckpointSigns this checkpoint with signing_key, producing a SignedCheckpoint carrying the alg-tagged signature
pub struct SignedCheckpointA Checkpoint paired with its signature.
SignedCheckpoint :: fn verify(& self, verifying_key : & VerifyingKey,) -> Result <(), foundation_crypto_sign::Error>Verifies this checkpoint's signature against verifying_key

`context`

ItemWhat it is
pub struct RequestContextRequest context information for audit entries.
RequestContext :: fn new() -> SelfCreate a new empty request context.
RequestContext :: fn with_ip(mut self, ip : impl Into <String>) -> SelfBuilder: set IP address.
RequestContext :: fn with_user_agent(mut self, ua : impl Into <String>) -> SelfBuilder: set user agent.
RequestContext :: fn with_request_id(mut self, id : impl Into <String>) -> SelfBuilder: set request ID.
RequestContext :: fn with_trace_id(mut self, id : impl Into <String>) -> SelfBuilder: set trace ID.
RequestContext :: fn extract_ip_from_forwarded(forwarded : Option <& str>, direct : Option <& str>,) -> Option <String>Extract client IP from X-Forwarded-For header or direct connection
RequestContext :: fn extract_client_ip(forwarded : Option <& str>, direct : Option <& str>, trusted_proxy_count : usize,) -> Option <String>Extract the trustworthy client IP given the number of trusted reverse proxies in front of the application (Sprint 0.55, T7)

`deid`

ItemWhat it is
pub struct PseudonymA random, opaque per-subject token stored in audit rows
Pseudonym :: fn random() -> SelfMint a fresh random pseudonym (UUIDv4 — not derived from the subject id).
Pseudonym :: fn from_uuid(id : Uuid) -> SelfReconstruct from a stored UUID.
Pseudonym :: fn as_uuid(& self) -> UuidThe underlying UUID (what gets stored in the audit row).
fn row_affected_by(actor : Option <Pseudonym>, target : Option <Pseudonym>, subject : Pseudonym,) -> boolDoes a shred of subject touch this row? A row is affected if the subject appears as the actor OR as the target — the latter captures PII about the subject written by someone else's action
pub trait SubjectKeyStorePer-subject key lifecycle for crypto-shred erasure
pub struct InMemorySubjectKeyStoreIn-memory SubjectKeyStore for tests and the decidable-logic layer
InMemorySubjectKeyStore :: fn new() -> Self
InMemorySubjectKeyStore :: fn ensure(& mut self, subject_id : Uuid, key_material : Vec <u8>) -> Pseudonym
InMemorySubjectKeyStore :: fn get(& self, subject_id : Uuid) -> Option <& u8>
InMemorySubjectKeyStore :: fn pseudonym_of(& self, subject_id : Uuid) -> Option <Pseudonym>
InMemorySubjectKeyStore :: fn shred(& mut self, subject_id : Uuid) -> Option <Pseudonym>
InMemorySubjectKeyStore :: fn is_erased(& self, subject_id : Uuid) -> bool

`error`

ItemWhat it is
pub enum AuditErrorErrors that can occur in audit logging operations.

`hash`

ItemWhat it is
fn canonicalize(value : & Value) -> Vec <u8>Deterministic canonical byte encoding of a JSON value
fn sha256_hex(bytes : & u8) -> StringSHA-256(bytes) rendered as lowercase hex
fn hmac_hex(key : & u8, data : & u8) -> StringHMAC-SHA256(key, data) rendered as lowercase hex.
pub struct Sha256StreamIncremental SHA-256, for a caller that streams bytes (e.g
Sha256Stream :: fn new() -> Self
Sha256Stream :: fn update(& mut self, chunk : & u8)
Sha256Stream :: fn finalize_hex(self) -> String
fn row_hash(key : & u8, payload : & Value) -> StringCompute the row_hash for an audit row from its canonical payload value
fn merkle_root(leaf_hashes : & String) -> Option <String>Compute a Merkle root over an ordered list of leaf hashes (lowercase hex row_hash strings, in seq order)

`model`

ItemWhat it is
pub struct AuditLogAn immutable audit log entry
AuditLog :: fn builder() -> AuditLogBuilderCreate a builder for logging model operations.
AuditLog :: fn event(action : impl Into <String>) -> AuditEventBuilderCreate a builder for logging events (no model target).
AuditLog :: fn login(actor_id : Uuid, display : impl Into <String>) -> AuditEventBuilderCreate a login success audit entry
AuditLog :: fn logout(actor_id : Uuid, display : impl Into <String>) -> AuditEventBuilderCreate a logout audit entry
AuditLog :: fn login_failed(attempted_identity : impl Into <String>) -> AuditEventBuilderCreate a failed login audit entry
AuditLog :: fn module(& self) -> Option <& str>Get the module part of the model label.
AuditLog :: fn model_name(& self) -> Option <& str>Get the model name part of the model label.
AuditLog :: fn id(& self) -> Uuid

`provenance`

ItemWhat it is
pub enum AuditSourceThe origin surface of an audit entry.
AuditSource :: fn as_str(& self) -> & 'static strString form, matching the DB CHECK constraint.
AuditSource :: fn parse(s : & str) -> Option <Self>Parse from string (case-insensitive); None if not a known source.
AuditSource :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result
pub enum AuditOutcomeHow an audited action resolved.
AuditOutcome :: fn as_str(& self) -> & 'static strString form, matching the DB CHECK constraint.
AuditOutcome :: fn parse(s : & str) -> Option <Self>Parse from string (case-insensitive); None if not a known outcome.
AuditOutcome :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result

`redact`

ItemWhat it is
pub const REDACTED: & strMarker substituted for a redacted value.
pub const DEFAULT_MAX_STRING_LEN: usizeDefault maximum length (bytes) for any single string value before it is truncated
pub const SECRET_KEY_DENYLIST: & & strCase-insensitive substrings that mark a JSON key as carrying a secret or direct credential
fn is_secret_key(key : & str) -> boolReturns true if the key name indicates a secret value that must be redacted.
fn redact(value : & Value) -> ValueRedact a JSON value with the default string-length cap.
fn redact_with_limit(value : & Value, max_string_len : usize) -> ValueRedact a JSON value, capping string length at max_string_len

`sensitivity`

ItemWhat it is
pub enum SensitivityClassification level for audit log entries
Sensitivity :: fn as_str(& self) -> & 'static strGet the string representation.
Sensitivity :: fn parse(s : & str) -> Option <Self>Parse from string.
Sensitivity :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result

Re-exports. Exported here, defined elsewhere.

ExportDefined in
AuditErrorerror::AuditError
AuditLogmodel::AuditLog
HasIdfoundation_basemodels::HasId
RequestContextcontext::RequestContext
Sensitivitysensitivity::Sensitivity
{AuditEventBuilder,AuditLogBuilder}builder::{AuditEventBuilder,AuditLogBuilder}
{AuditOutcome,AuditSource}provenance::{AuditOutcome,AuditSource}
{Checkpoint,SignedCheckpoint}checkpoint::{Checkpoint,SignedCheckpoint}
{FleetReport,ScopeState}report::{FleetReport,ScopeState}
{attest,attest_cluster,check_endpoint,check_event_guards,check_fingerprint,check_force_rls,check_no_rules,check_ownership,check_row_hash,check_topology,check_triggers,check_truncate_guard_catalog,observe_invariant,probe_once,AttestConfig,}db::{attest,attest_cluster,check_endpoint,check_event_guards,check_fingerprint,check_force_rls,check_no_rules,check_ownership,check_row_hash,check_topology,check_triggers,check_truncate_guard_catalog,observe_invariant,probe_once,AttestConfig,}
{auth_probe_dsn,classify_audit_grants,classify_auth_probe,classify_backup_currency,AuthProbeError,INVALID_AUTHORIZATION_SQLSTATE,INVALID_CATALOG_SQLSTATE,INVALID_PASSWORD_SQLSTATE,SENTINEL_PASSWORD,}auth::{auth_probe_dsn,classify_audit_grants,classify_auth_probe,classify_backup_currency,AuthProbeError,INVALID_AUTHORIZATION_SQLSTATE,INVALID_CATALOG_SQLSTATE,INVALID_PASSWORD_SQLSTATE,SENTINEL_PASSWORD,}
{check_hba_auth_methods,check_hba_exposure,check_login_passwords,check_transport_encryption,ipv4_mask_to_prefix,ClusterCheckId,ClusterOutcome,HbaRule,LoginRole,}cluster::{check_hba_auth_methods,check_hba_exposure,check_login_passwords,check_transport_encryption,ipv4_mask_to_prefix,ClusterCheckId,ClusterOutcome,HbaRule,LoginRole,}
{classify_probe,ProbeError,ProbeKind,WORM_SQLSTATE}probe::{classify_probe,ProbeError,ProbeKind,WORM_SQLSTATE}
{dsn_identity,redact_dsn,Evidence}evidence::{dsn_identity,redact_dsn,Evidence}
{exit_code,roll_up,CheckId,CheckOutcome,CheckStatus}status::{exit_code,roll_up,CheckId,CheckOutcome,CheckStatus}
{fingerprint,is_definition_key,normalize_definition,InvariantRecord,CANONICAL_FINGERPRINT,}fingerprint::{fingerprint,is_definition_key,normalize_definition,InvariantRecord,CANONICAL_FINGERPRINT,}
{parse_inventory,EphemeralRule,Inventory,InventoryEntry,InventoryError}inventory::{parse_inventory,EphemeralRule,Inventory,InventoryEntry,InventoryError}

Boundary

Depends on no other workspace tier.

Shares tier foundation with 27 other crates: foundation-basemodels, foundation-bounded-io, foundation-conversation-closure, foundation-crypto-sign, foundation-decisioning, foundation-encounter-vocabulary, foundation-fs-metadata, foundation-i18n, … (27 total).

_What this crate deliberately does NOT own is a judgment. No committed registry records one for it, so none is stated here._

Where it sits

Tier (ontology)foundation
Architectural role (taxonomy)unclassified (baselined)
Locationcrates/foundation/audit-log
Vocabulary in force (lexicon)current

Dependencies

Runtime, in this workspace.

CrateTierOptionalOnly on
`foundation-basemodels`foundationnoalways
`foundation-crypto-sign`foundationnoalways

Runtime, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
chrono^0.4serdenoalways
clap^4derive, envyesalways
hex^0.4noalways
hmac^0.12noalways
serde^1derivenoalways
serde_json^1noalways
sha2^0.10noalways
sqlx^0.8runtime-tokio, postgres, chrono, uuid, jsonnoalways
thiserror^2noalways
tokio^1fullnoalways
uuid^1v4, v7, serde, jsnoalways

Development, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
sqlx^0.8runtime-tokio, postgres, chrono, uuid, jsonnoalways
tokio^1full, macros, rt-multi-threadnoalways
tokio-test^0.4noalways

Build. None.

Depended on by. 25 workspace crates.

Signal flow — what reaches this crate, and what it reaches.

flowchart LR
  consumers["25 consumer crates"] -->|uses| SELF
  SELF["foundation-audit-log"]
  SELF -->|runtime| runtime_deps["2 workspace crates"]
  classDef self fill:#1f883d,stroke:#1f883d,color:#fff;
  class SELF self;

Feature flags

FeatureEnablesOn by default
attest-clidep:clapno
defaultyes
flowchart LR
  n_attest_cli["attest-cli"] --> n_dep_clap["dep:clap"]
  n_default["default"]

Targets

KindNameSource
binaudit-attest`src/bin/audit-attest.rs`
binfleet-inventory-gen`src/bin/fleet-inventory-gen.rs`
libfoundation_audit_log`src/lib.rs`
testattest_cluster`tests/attest_cluster.rs`
testattest_inventory`tests/attest_inventory.rs`
testattest_pure`tests/attest_pure.rs`
testpg_attest`tests/pg_attest.rs`
testpg_consumer_convergence`tests/pg_consumer_convergence.rs`
testpg_starter_seed`tests/pg_starter_seed.rs`
testpg_worm_enforcement`tests/pg_worm_enforcement.rs`

Error model

Error typeNamed by
AuditErrordeclared, no public signature returns it
AuthProbeErrorclassify_auth_probe
InventoryErrorparse_inventory
ProbeErrorAuthProbeError, classify_auth_probe, classify_probe

Operational characteristics

PropertyEvidence
async public surfaceyes
async runtimeyes
database accessyes
network I/Onone detected
unsafe codenone detected
environment variablesyes

No unsafe block, unsafe fn, unsafe impl or unsafe trait was found by the parser anywhere in this crate's source.

Configuration

VariableRead in
CARGO_PKG_VERSIONsrc/attest/evidence.rs

25 workspace crates depend on this one: application-audit-log, application-core, application-rbac, application-wiki, domain-domain-survey, domain-legal-evidence, identity-impersonation, infrastructure-adapters-google-gmail, infrastructure-tenant-pool, infrastructure-waf, observability-analytics, operations-approval-workflow, … (25 total).

Verification

KindCount
Unit tests121
Integration tests115
Examples0
Doctests1

Evidence by module. How often each public module is named by something executable.

ModuleTestsExamplesConsumers
actions19033
attest::auth900
attest::cluster900
attest::db1501
attest::evidence306
attest::fingerprint504
attest::inventory502
attest::probe400
attest::report200
attest::status505
builder200
checkpoint200
context101
deid400
error101
hash6027
model106
provenance202
redact608
sensitivity104

What the tests establish, by name:

Documentation coverage

MeasureDocumentedTotal
Public items with rustdoc195213
Public modules with a //! block2121
pie showData
    title Public items with rustdoc
    "Documented" : 195
    "No rustdoc detected" : 18

Metrics

MetricValue
Rust source files24
Source lines7030
Code lines4738
Public API items213
Public modules21
Tests236
Examples0
Cargo features2
Direct runtime dependencies13
Workspace reverse dependencies25
pie showData
    title Public API by kind
    "constant" : 28
    "enum" : 10
    "function" : 41
    "method" : 111
    "struct" : 22
    "trait" : 1
pie showData
    title Rust source composition
    "Code" : 4738
    "Blank or comment" : 2292

Generation

Rendered by tools-corpus corpus readme from repository evidence alone, renderer schema 2, lexicon current. No model, network service or database was consulted. Regenerate with tools-corpus corpus readme --write; verify with --check.

Todas las foundation · Manual