ExGAM.Ingress behaviour (ExGAM v0.1.0)

Copy Markdown View Source

Authenticated boundary that creates a ExGAM.SubmissionContext.

A Domain is wired to exactly one ingress module. ref/0 must return that adapter's stable, non-secret identity; every context and observed Evidence produced by the adapter carries the same reference. Candidate payloads and ordinary call options are intentionally absent from authentication. They cannot select the authenticated principal or replace the Domain's adapter.

use ExGAM.Ingress, ref: "ingress:my-app:v1" declares the behaviour and an overridable ref/0. The reference is explicit and stays stable across module renames. Implement authenticate/5 and observe/4 yourself; no authentication, observation or permissive defaults are generated.

This contract describes the mediated same-BEAM boundary. It does not turn a shared VM into a sandbox; stronger deployments isolate the ingress and make its authentication mechanism independently verifiable.

Summary

Types

Validated module and its stable ingress reference.

Callbacks

Authenticates an input for the named Domain and Scope at the supplied time.

Turns input into one or more observations bound to its authenticated context.

Returns this adapter's stable identity within SubmissionContext records.

Functions

Builds observed Evidence with every trusted ingress binding forced by the context.

Types

binding()

@type binding() :: {module(), String.t()}

Validated module and its stable ingress reference.

Callbacks

authenticate(t, t, term, non_neg_integer, keyword)

@callback authenticate(String.t(), String.t(), term(), non_neg_integer(), keyword()) ::
  {:ok, ExGAM.SubmissionContext.t()} | {:error, term()}

Authenticates an input for the named Domain and Scope at the supplied time.

observe(t, term, integer, keyword)

@callback observe(ExGAM.SubmissionContext.t(), term(), integer(), keyword()) ::
  {:ok, ExGAM.Evidence.t() | [ExGAM.Evidence.t()]} | {:error, term()}

Turns input into one or more observations bound to its authenticated context.

ref()

@callback ref() :: String.t()

Returns this adapter's stable identity within SubmissionContext records.

Functions

evidence(context, observed_at, attrs)

@spec evidence(ExGAM.SubmissionContext.t(), integer(), map() | keyword()) ::
  {:ok, ExGAM.Evidence.t()} | {:error, term()}

Builds observed Evidence with every trusted ingress binding forced by the context.