# `Spectre.GAM.Ingress`
[🔗](https://github.com/elchemista/spectre/blob/0.4.0/lib/spectre/gam/ingress.ex#L1)

Authenticated boundary that creates a `Spectre.GAM.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 Spectre.GAM.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.

# `binding`

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

Validated module and its stable ingress reference.

# `authenticate`

```elixir
@callback authenticate(String.t(), String.t(), term(), non_neg_integer(), keyword()) ::
  {:ok, Spectre.GAM.SubmissionContext.t()} | {:error, term()}
```

# `observe`

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

# `ref`

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

Returns this adapter's stable identity within SubmissionContext records.

# `evidence`

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

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

---

*Consult [api-reference.md](api-reference.md) for complete listing*
