Xirsys.XTurn.Auth.Table (xturn v2.0.0)

Copy Markdown View Source

ETS-backed store for ephemeral long-term TURN credentials.

What problem this solves

Username/password pairs provisioned via the operator API or Auth.Client must be readable from authentication handlers on the hot path without serialising through a GenServer. A named public ETS table gives concurrent read access with low latency.

Internal: rows are {username, credential_map} shared between Auth.Client (writes) and authenticate actions (reads). Created once at application start via init/0.

RFCs

  • RFC 8489 (long-term credentials, USERHASH indexing for username lookup)

Summary

Functions

Removes the row for username.

Returns [{username, value}] or [] when username is absent.

Creates the named public table when it does not already exist.

Inserts or replaces the credential map for username.

Functions

delete(username)

Removes the row for username.

fetch(username)

Returns [{username, value}] or [] when username is absent.

init()

Creates the named public table when it does not already exist.

put(username, value)

Inserts or replaces the credential map for username.