Pkcs11ex.Audit.Storage.InMemory (pkcs11ex_audit v0.1.0)

Copy Markdown View Source

In-memory audit log storage. Agent-backed; serializes appends through the agent's mailbox.

Not durable

Suitable for tests, scripts, and one-off introspection. Production deployments should plug a durable adapter (Postgres, SQLite, append-only file with fsync, etc.).

Start one Agent per audit log:

{:ok, _} = Pkcs11ex.Audit.Storage.InMemory.start_link(name: :my_log)
audit = Pkcs11ex.Audit.new(Pkcs11ex.Audit.Storage.InMemory, :my_log)
{:ok, _entry} = Pkcs11ex.Audit.append(audit, %{...})

Summary

Functions

Test-only — direct mutation of an entry already in the store. Used by chain-tamper-detection tests. Production code never calls this.

Returns a specification to start this module under a supervisor.

Functions

__overwrite_for_test__(name, entry)

Test-only — direct mutation of an entry already in the store. Used by chain-tamper-detection tests. Production code never calls this.

child_spec(arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_link(opts \\ [])