AshAuthentication.AddOn.AuditLog.VerifierHelpers (ash_authentication v5.0.0-rc.4)

Copy Markdown View Source

Helpers for strategy verifiers that need to validate a brute_force_strategy {:audit_log, :name} configuration against the audit-log add-on on the resource.

Summary

Functions

Verify that the given action on the resource is included in the set of actions logged by the given audit-log add-on.

Verify that a strategy of provider :audit_log with the given name exists on the resource.

Functions

validate_action_audit_logged(dsl_state, strategy, action_name, audit_log)

@spec validate_action_audit_logged(map(), struct(), atom(), struct()) ::
  :ok | {:error, Exception.t()}

Verify that the given action on the resource is included in the set of actions logged by the given audit-log add-on.

validate_audit_log_exists(dsl_state, strategy, audit_log_name)

@spec validate_audit_log_exists(map(), struct(), atom()) ::
  {:ok, struct()} | {:error, Exception.t()}

Verify that a strategy of provider :audit_log with the given name exists on the resource.

Returns {:ok, audit_log} on success, or a DslError exception tagged to the given strategy's brute_force_strategy path on failure.