The production approval: the system screen-lock prompt (fingerprint,
face, or the phone's PIN, pattern, password or passcode) behind an
approve control the host shows with the change (Operator's approve chip).
This small process (Rho.Supervisor starts it with Dyn) holds what the
human confirmed; only the host's UI, after the prompt passed, calls
confirm/1.
The screen's flow:
# the approve control reported a passed prompt for subject {:activate, n}:
:ok = Biometric.confirm({:activate, n})
{:ok, token} = Rho.Dyn.request_approval({:activate, n})
{:ok, gen} = Rho.Dyn.activate(n, token)confirm/1records that the human just approvedsubject: valid for 60 s, once.Rho.Dyn.Approval.request/1turns a fresh confirmation of exactly that subject into a token (consuming the confirmation); otherwise{:error, :approval_required}.Rho.Dyn.Approval.verify/2accepts a token minted for that subject, within 60 s, once.
Without the process running, nothing is approved. Option: :ttl_ms
(60 000).
Summary
Functions
Returns a specification to start this module under a supervisor.
The human approved subject (call right after the approve chip's "approved").
Started by Rho.Supervisor when Dyn is on. Option: :ttl_ms.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec confirm(Rho.Dyn.Approval.subject()) :: :ok
The human approved subject (call right after the approve chip's "approved").
@spec start_link(keyword()) :: GenServer.on_start()
Started by Rho.Supervisor when Dyn is on. Option: :ttl_ms.