Skip to content

Add a method to rotate encryption password #263

Open

Description

@danbarr

ToolHive currently lacks any method to rotate/change the encryption password. Users must delete the keyring entry (with thv secret reset-keyring) and secrets_encrypted file and start over.

It would be good to have a method to do this.

We might also consider letting ToolHive generate a random password, assuming keyring access is verified on the user's system? (This could also imply an additional thv secret init --generate command to do this initially, and/or a question when running the first secret command?)

Potential workflow

Interactive version:

$ thv secret rotate-password
Enter the new encryption password: 

# User enters new password, ToolHive re-encrypts the file, then updates the keyring entry

Non-interactive version:

$ thv secret rotate-password --generate

# ToolHive generates a strong random password, re-encrypts the file, then updates the keyring entry
# IF keyring update fails for any reason, display the generated password to the user so they're not locked out of their file?

Activity

  1. added
    enhancement
    on Apr 23, 2025
  2. added theissue type on Jun 29, 2025
  3. JAORMX commented on Jan 22, 2026

    @JAORMX
    Collaborator

    Still valid! Having to nuke everything with reset-keyring just to change your password isn't ideal.

    We've got the infrastructure in place to support this (the EncryptedManager can already re-encrypt, and we have GenerateSecurePassword() for the --generate flag). It's mostly a matter of wiring up the command.

    We'll get to this soon.

  4. added a commit that references this issue on Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions