Skip to main content

Module token

Module token 

Source
Expand description

Local status-api bearer token save path and prompts.

Constants§

MIN_API_TOKEN_HEX_LEN
Minimum tip bearer length. Box install writes 64 hex chars; shorter leftovers (including unit-test junk) must never be treated as a real Status API token.

Functions§

api_token_config_path
finish_save_api_token
Finish a save-token prompt given the raw answer (test seam).
offer_save_api_token
Propose saving the status-api bearer to ~/.config/horto-os-ui/api_token.
offer_save_api_token_with
Testable core of offer_save_api_token (canned_answer skips stdin when Some).
parse_api_token_drop
Parse drop-file contents: HORTO_API_TOKEN=<hex> or bare hex.
pull_remote_api_token
Pull the box Status API bearer over SSH (sudo) and save the tip file.
usable_api_token_hex
Return trimmed hex when it is usable as a tip Status API bearer.
write_api_token_file
Write hex bearer to the local config path with mode 0o600.