Skip to content

Improve master key storage precedence #220

@manojbajaj95

Description

@manojbajaj95

Problem

Authsome currently treats the local filesystem master key (~/.authsome/master.key) as the default master key source. That makes the least secure storage option the primary path.

Proposed behavior

Change master key resolution so Authsome prefers stronger/external sources first:

  1. Use AUTHSOME_MASTER_KEY from the environment when it exists.
  2. Otherwise, check the OS keyring for an existing master key.
  3. Fall back to the local filesystem master key only when neither environment nor keyring is available.

CLI impact

Update authsome init to initialize/configure the same precedence and make clear which master key source will be used.

Acceptance criteria

  • Master key resolution follows env -> keyring -> filesystem fallback.
  • Existing local master.key users continue to work as fallback.
  • authsome init creates/verifies the configured master key source using the same logic.
  • whoami/health output reflects the effective or configured encryption source clearly.
  • Tests cover env, keyring, and filesystem fallback behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions