Expand description
API keys: Authorization: Bearer dm_<random>.
The keys file (mode 0600) holds one line per key: the SHA-256 of the whole key text
(dm_...) as 64 lowercase hex digits, the principal id, and optionally the key’s own
limit in requests per minute; # starts a comment. The plaintext of a key is never stored
by the mesh: create_key writes it to a file of its own (mode 0600) and nowhere else.
Structs§
Constants§
- KEY_
PREFIX - The prefix of every key.
Functions§
- create_
key - Creates a key for
principal: appends its hash line tokeys_file(created with mode 0600 if missing; refused if it exists with a wider mode) and writes the key itself, with a final newline, toout(created new, mode 0600; refused if it exists). Nothing is printed. - new_key
- A new key:
dm_and 64 hex digits of 256 bits from the operating system’s CSPRNG.