Lightning.Channels.Audit (Lightning v2.19.0-pre)

View Source

Audit trail for channel CRUD and auth method changes.

Provides event/5 (via Lightning.Auditing.Audit) for basic CRUD events, plus audit_auth_method_changes/4 which derives fine-grained audit events for client and destination auth method additions, removals, and swaps.

Summary

Functions

audit_auth_method_changes(multi, channel, changeset, actor)

Appends audit events for auth method changes to the given Multi.

Inspects the changeset for changes to :client_auth_methods and :destination_auth_method, emitting the appropriate added/removed/changed events. No-op when no auth method changes are present.

Step keys are unique per call, so the helper can be composed into a larger Multi any number of times — e.g. once per channel when batching audits across channels.

base_query()

event(event, item_id, actor, changes \\ %{}, metadata \\ %{})

save(changes)

update_changes(changes)

Callback implementation for Lightning.Auditing.Audit.update_changes/1.