# `ExGAM.Secret.Broker`
[🔗](https://github.com/elchemista/ex_gam/blob/0.1.0/lib/ex_gam/secret/broker.ex#L1)

Host boundary that exchanges a committed Attempt for an execution capability.

A broker must never return a reusable credential. The value it releases is
scoped to the supplied executor and Act and is kept outside durable records.
A failed checkout returns only validated Evidence and an opaque `details_ref`;
raw credential-store errors must never become durable payloads.

`use ExGAM.Secret.Broker, ref: "broker:my-app", profile: :mediated`
declares the behaviour and overridable `ref/0` and `profile/0`. Both choices
are required: the macro cannot establish deployment isolation. Implement
`checkout/4` explicitly; no credential access or successful checkout is
supplied by default.

# `failure_metadata`

```elixir
@type failure_metadata() :: %{
  evidence: ExGAM.Evidence.t() | [ExGAM.Evidence.t()],
  details_ref: String.t()
}
```

# `profile`

```elixir
@type profile() :: :development | :mediated | :isolated
```

# `checkout`

```elixir
@callback checkout(
  ExGAM.Secret.CheckoutReceipt.t(),
  ExGAM.Act.t(),
  ExGAM.Attempt.t(),
  keyword()
) ::
  {:ok, term()} | {:error, :ambiguous, failure_metadata()}
```

Exchanges a committed checkout receipt for capability scoped to its Act and Attempt.

# `profile`

```elixir
@callback profile() :: profile()
```

Declares the strongest deployment boundary this broker actually provides.

# `ref`

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

Returns the stable identity bound into checkout receipts.

---

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