GenServer-backed ephemeral long-term TURN credential store.
What problem this solves
Operators and the HTTP API need to provision username/password pairs for
WebRTC clients without a separate database. This process creates random or
explicit credentials, writes them to Auth.Table, indexes USERHASH for
privacy-preserving lookup, and expires rows after @auth_lifetime ms.
Use create_user/1, create_user/2, or add_user/4 from the REST API or
application code; authentication handlers call get_details/1 and
get_details_by_hash/1 during Allocate.
RFCs
Summary
Functions
Stores explicit username/pass for ns and peer_id.
Returns a specification to start this module under a supervisor.
Generates a random username/password for namespace ns with empty peer_id.
Generates a random username/password for ns and peer_id.
Looks up credentials by username.
Looks up credentials by USERHASH (SHA-256 of username:realm).
Starts the auth GenServer (registered name __MODULE__).
Functions
Stores explicit username/pass for ns and peer_id.
Returns {:ok, user, pass}.
Returns a specification to start this module under a supervisor.
See Supervisor.
Generates a random username/password for namespace ns with empty peer_id.
Returns {:ok, username, password}.
Generates a random username/password for ns and peer_id.
Returns {:ok, username, password}.
Looks up credentials by username.
Returns {:ok, pass, ns, peer_id} or :error.
Looks up credentials by USERHASH (SHA-256 of username:realm).
Returns {:ok, username, pass, ns, peer_id} or :error.
Starts the auth GenServer (registered name __MODULE__).