Skip to main content

Module backend_auth

Module backend_auth 

Source
Expand description

Backend server authentication setup and token resolution. Backend server authentication setup and token resolution.

This module owns the precedence logic for assembling auth credentials (CLI flags > environment variables > global config file) and the --init orchestration that generates and persists tokens on first run.

Enums§

InitAuthResult
Outcome of init_backend_auth.

Functions§

global_config_display_path
Return a display-friendly path to the global config file.
init_backend_auth
Check for existing backend auth in the global config; if absent, generate new tokens and persist them.
resolve_admin_tokens
Resolve admin tokens by merging CLI flags, the ITO_BACKEND_ADMIN_TOKEN env var, and global config entries — in that precedence order.
resolve_token_seed
Resolve the HMAC token seed from CLI flag, the ITO_BACKEND_TOKEN_SEED env var, or global config — returning the first non-empty value found.
write_auth_to_global_config
Write admin token and token seed into the global config file.