MailglassAdmin.Inbound.DestructiveAction (MailglassAdmin v1.2.0)

Copy Markdown View Source

Action-time authorization helper for destructive inbound work (replay).

Sibling of MailglassAdmin.Operator.DestructiveAction (D-48-10 / D-48-13). Rides the existing MailglassAdmin.Auth.authorize/3 atom() action type — NO new auth surface — with action :replay_inbound, and passes the record under the :inbound_record context key, NEVER :delivery. An adopter Auth implementation may pattern-match %Mailglass.Outbound.Delivery{} on the :delivery key, so an inbound record under that key would silently misclassify.

Summary

Functions

authorize(socket, adapter, inbound_record)

@spec authorize(Phoenix.LiveView.Socket.t(), module() | nil, map()) ::
  {:ok, Phoenix.LiveView.Socket.t()} | {:error, {:auth, String.t()}}