Spectre.GAM.Consent (Spectre v0.4.0)

Copy Markdown View Source

Closed, portable material that a person must evaluate before approval.

The value is stored as a plain string-keyed map inside Candidate, Decision and Act records. data_digest is the canonical SHA-256 digest of the data represented by a Presentation; the data itself need not be duplicated in an Act. Purpose is repeated here deliberately and must match the Candidate's authoritative purpose fields.

Summary

Functions

Returns the canonical SHA-256 digest used to bind presented data.

Builds the canonical consent value and rejects unknown or missing fields.

Checks that the duplicated purpose is the Candidate's current purpose.

Types

t()

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

Functions

data_digest(data)

@spec data_digest(term()) :: {:ok, String.t()} | {:error, term()}

Returns the canonical SHA-256 digest used to bind presented data.

new(value)

@spec new(map() | keyword()) :: {:ok, t()} | {:error, term()}

Builds the canonical consent value and rejects unknown or missing fields.

validate_purpose(consent, purpose_ref, purpose_params)

@spec validate_purpose(t(), String.t(), map()) :: :ok | {:error, term()}

Checks that the duplicated purpose is the Candidate's current purpose.