Skip to main content

write_api_token_file

Function write_api_token_file 

Source
pub fn write_api_token_file(token: &str) -> Result<PathBuf>
Expand description

Write hex bearer to the local config path with mode 0o600.

Rejects short / non-hex input before creating or truncating the tip file, so a bad caller cannot wipe a real PC token with junk.

ยงErrors

Returns crate::HortoError when the token is unusable, or the directory / file cannot be written.