# `Rho.Dyn.Approval.Biometric`
[🔗](https://github.com/GenericJam/rho/blob/v0.1.0/lib/rho/dyn/approval.ex#L38)

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/1` records that the human just approved `subject`: valid for
  60 s, once.
* `c:Rho.Dyn.Approval.request/1` turns a fresh confirmation of exactly that subject into a
  token (consuming the confirmation); otherwise `{:error,
  :approval_required}`.
* `c:Rho.Dyn.Approval.verify/2` accepts a token minted for that subject, within 60 s,
  once.

Without the process running, nothing is approved. Option: `:ttl_ms`
(60 000).

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `confirm`

```elixir
@spec confirm(Rho.Dyn.Approval.subject()) :: :ok
```

The human approved `subject` (call right after the approve chip's `"approved"`).

# `start_link`

```elixir
@spec start_link(keyword()) :: GenServer.on_start()
```

Started by `Rho.Supervisor` when Dyn is on. Option: `:ttl_ms`.

---

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