fix(rotate-secret): verify --save-to-bitwarden, and store the secret rather than the description #114
Loading…
Reference in a new issue
No description provided.
Delete branch "jfraeys/fix/rotate-secret-bitwarden"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found while checking --save-to-bitwarden after a rotate-secret run:
Now: scripts/lib/bitwarden.sh bw_store_verified puts the secret in the note body and the description in a custom field, syncs, reads the item back and compares (never printing the value), and returns non-zero on any failed step. rotate-secret.sh reports failure explicitly and says when a service has no Bitwarden item. The hint uses RUN_PREFIX.
Tests: scripts/tests/test-bitwarden-save.sh, 8 cases against a stateful fake bw (create, in-place update, failed create, failed sync, wrong stored value, secret never printed); reintroducing the overwrite bug fails 3 of them. Wired into lint. Not run against real Bitwarden.
Note: items already saved by the old code hold the description, not the secret; re-run --save-to-bitwarden after merging.
🤖 Generated with Claude Code