Skip to main content

load_or_create_api_token

Function load_or_create_api_token 

Source
pub fn load_or_create_api_token(path: &Path) -> Result<String>
Expand description

Read the API bearer token, minting one on first use.

A missing file is ordinary first use. An unreadable or too-short one is replaced loudly: refusing to start the daemon over a damaged token file would be a worse answer than asking the caller to re-read the file.