Module credentials

Module credentials 

Source
Expand description

Phase 39: Credential Management

Stores and retrieves API tokens for the package registry.

Credentials are stored in a TOML file at ~/.config/logos/credentials.toml with restrictive permissions (0600 on Unix) to protect sensitive tokens.

§Token Resolution Order

When retrieving a token via get_token, the following order is used:

  1. LOGOS_TOKEN environment variable (highest priority)
  2. Credentials file entry for the registry URL

§Security

  • Tokens are stored in plaintext (like cargo, npm, etc.)
  • File permissions are set to owner-only on Unix systems
  • The LOGOS_CREDENTIALS_PATH env var can override the default location

Structs§

Credentials
Persistent storage for registry authentication tokens.

Enums§

CredentialsError
Errors that can occur when loading or saving credentials.

Functions§

credentials_path
Get the path to the credentials file
get_token
Get the token for a registry, checking env var first then credentials file