Skip to content

secrets identity rotate: per-vault scoping with --user / --project #196

Description

@xaaha

Part of #171. Identity rotation is per-vault, there is no global registry of vaults.

Command name

hulak secrets identity rotate in pkg/userFlags/secrets/rotate.go.

Goal

Make rotation explicit about which vault it is rotating, and document the multi-project reality honestly instead of implying a global rotate.

Changes

pkg/userFlags/secrets/rotate.go

The identity at <UserConfigDir()>/identity.txt is global. There is one per OS user. Rotation swaps the old identity for the new one in the recipient list of one specific vault and re-encrypts that vault.

Help text and docs need a note: a user with N project vaults runs rotate N times, once per cd. There is deliberately no --all flag, because discovery has no registry of every vault the user owns. Walking the filesystem to find them would be worse than making the user be explicit.

Tests

  • Rotating a project vault leaves user-vault recipients untouched
  • --user rotates the user vault from inside a project
  • Rotation succeeds while other vaults exist and are not touched
  • Rotation refuses with a clear error when no vault is in scope and no flag is given
  • The target vault path is printed before rotation begins

Depends on

#190, #195

Activity

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

    enhancementNew feature or requestepic: encryptionIssues that belong to the encryption epic

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions