Insider.Sentinel.DraftCreation.DisclosureAuthority behaviour (Insider Lab v0.1.0)

Copy Markdown View Source

Behaviour for an explicitly configured disclosure-policy authority.

The authority evaluates an exact payload reference for one exact provider. Returned references are opaque policy-decision identifiers. Content hashes establish record identity; they do not establish the authority's authenticity.

Summary

Types

deadline()

@type deadline() :: integer()

decision_reference()

@type decision_reference() :: binary()

payload_reference()

@type payload_reference() :: %{required(String.t()) => term()}

Callbacks

authorize(payload_reference, provider, deadline)

@callback authorize(
  payload_reference(),
  Insider.Sentinel.DraftCreation.Identity.provider(),
  deadline()
) ::
  {:approved, decision_reference()} | {:denied, atom()}

identity()