Expand description
Shared-token authentication for coordinator connections.
On startup the coordinator generates a random hex token and writes it to
a well-known file. The CLI and daemons read this file before connecting
and append ?token=<hex> to the WebSocket URL.
Structs§
- Auth
Token - Opaque authentication token.
Functions§
- config_
token_ path - Return the token path inside the user’s config directory
(e.g.
~/.config/dora/.dora-tokenon Linux). - constant_
time_ eq - Constant-time byte comparison to prevent timing side-channel attacks.
- discover_
token - Attempt to read the auth token from (in order):
- generate_
token - Generate a cryptographically random 32-byte token.
- read_
token - Read the token from
<working_dir>/.dora-token. - token_
path - Compute the token file path for a given working directory.
- write_
token - Write the token to
<working_dir>/.dora-tokenand to the user config directory (e.g.~/.config/dora/.dora-token).