mix bounded_authority_report_adapter.doctor (Bounded Authority Report Adapter v0.4.0)

Copy Markdown View Source

Preflight-checks a key-handle module against the adapter's behaviour contract.

mix bounded_authority_report_adapter.doctor --handle MyApp.HolderKey [--ref term] [--live]

FATAL (non-zero exit):

  • the module is not loaded / does not exist;
  • sign/2, public_key/1, or thumbprint/1 is missing;
  • public_key/1 returns something other than a 32-byte Ed25519 public key for the supplied ref.

ADVISORY (reported, exit stays zero if nothing fatal):

  • key_identity/1 absent — blocks sign_anchor/3 + sign_key_transition/3;
  • signing_identity/1 absent — blocks sign_grant/3;
  • with --ref + --live: a synthetic-message sign/2 probe whose signature does not verify against public_key/1's key (the same wrong-key guard the adapter enforces on every real sign). The probe signs a DOCTOR-GENERATED synthetic message only — never caller data.

--ref is an Elixir term, evaluated in the doctor's VM (--ref "{:demo, 1}") — a dev-tool affordance over your own configuration, nothing more. Read/probe only: the doctor never writes, never configures, and never signs caller material.

Summary

Functions

The pure preflight over a loaded handle module. Returns %{fatals: [String.t()], advisories: [String.t()]} — no printing, no exits, no side effects beyond the callbacks it probes.

Functions

check(module, ref, live?)

@spec check(module(), term(), boolean()) :: %{
  fatals: [String.t()],
  advisories: [String.t()]
}

The pure preflight over a loaded handle module. Returns %{fatals: [String.t()], advisories: [String.t()]} — no printing, no exits, no side effects beyond the callbacks it probes.