Skip to main content

Module auth

Module auth 

Source
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§

AuthToken
Opaque authentication token.

Functions§

config_token_path
Return the token path inside the user’s config directory (e.g. ~/.config/dora/.dora-token on 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-token and to the user config directory (e.g. ~/.config/dora/.dora-token).