ExGAM.Domain.Context (ExGAM v0.1.0)

Copy Markdown View Source

Authenticates and validates host-supplied SubmissionContexts.

The ingress input is intentionally opaque: an application adapter may accept text, decoded audio, telephony metadata or any other transport-specific value. ExGAM requires only that the adapter return a context bound to the configured Domain, Scope, ingress identity and host generation; the sealed result is then safe to present at the governed Admission boundary.

Summary

Functions

Normalizes and verifies a context against the current host generation.

Checks that a context names the ingress fixed for the running Domain.

Verifies a current context against its durable Scope opening.

Verifies a current context against an explicit provisional projection.

Functions

validate_current(state, input)

@spec validate_current(ExGAM.Domain.Sequencer.State.t(), term()) ::
  {:ok, ExGAM.SubmissionContext.t()} | {:error, term()}

Normalizes and verifies a context against the current host generation.

validate_ingress(state, context)

@spec validate_ingress(ExGAM.Domain.Sequencer.State.t(), ExGAM.SubmissionContext.t()) ::
  :ok | {:error, term()}

Checks that a context names the ingress fixed for the running Domain.

validate_scope(state, input)

@spec validate_scope(ExGAM.Domain.Sequencer.State.t(), term()) ::
  {:ok, ExGAM.SubmissionContext.t(), ExGAM.Scope.Opening.t()} | {:error, term()}

Verifies a current context against its durable Scope opening.

validate_scope(state, projection, input)

Verifies a current context against an explicit provisional projection.