Insider.Recorder.Classification (Insider v0.1.0)

Copy Markdown View Source

Trusted, bounded sensitivity metadata bound to one exact recorded Event.

Classifications are companions to recorder entries rather than Event fields. Their event digest prevents a classification from being moved to different evidence, and their policy fingerprint selects the exact field rules that must be used at export.

Summary

Types

t()

@type t() :: %Insider.Recorder.Classification{
  event_digest: String.t(),
  event_id: String.t(),
  fingerprint: String.t(),
  policy_fingerprint: String.t(),
  policy_id: String.t(),
  schema: String.t(),
  sensitivity: :public | :internal | :confidential | :secret
}

Functions

decode_map(payload, event)

@spec decode_map(term(), Insider.Event.t()) ::
  {:ok, t()} | {:error, :invalid_classification}

new(event, sensitivity, policy)

@spec new(Insider.Event.t(), atom(), Insider.Redaction.Policy.t()) ::
  {:ok, t()} | {:error, :invalid_classification}

validate(classification, event, canonical)

@spec validate(term(), Insider.Event.t(), binary()) ::
  {:ok, t()} | {:error, :invalid_classification}