Spectre.GAM.Secret.Broker behaviour (Spectre v0.4.0)

Copy Markdown View Source

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 Spectre.GAM.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.

Summary

Callbacks

Declares the strongest deployment boundary this broker actually provides.

Returns the stable identity bound into checkout receipts.

Types

failure_metadata()

@type failure_metadata() :: %{
  evidence: Spectre.GAM.Evidence.t() | [Spectre.GAM.Evidence.t()],
  details_ref: String.t()
}

profile()

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

Callbacks

checkout(t, t, t, keyword)

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

profile()

@callback profile() :: profile()

Declares the strongest deployment boundary this broker actually provides.

ref()

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

Returns the stable identity bound into checkout receipts.