Leave no partial unlocker directory when adding an unlocker fails (closes #48) #90

Merged
clawbot merged 1 commits from issue-48-unlocker-no-partial-dir into next 2026-10-04 12:58:52 +02:00
1 Commits
Author SHA1 Message Date
sneak 20bc5f053f Leave no partial unlocker directory when adding an unlocker fails (closes #48)
check / check (push) Waiting to run
CreatePGPUnlocker looked up the GPG key's fingerprint, and the keychain
unlocker got the long-term key, only after writing part of the unlocker,
so a failure there left a directory with no metadata. Both now do every
step that can fail before writing anything. `secret unlocker add pgp`
looks the fingerprint up once, for its duplicate check, and passes it to
CreatePGPUnlocker to record. All four unlocker types write their files
through the new secret.WriteDir, which builds a new directory in a
temporary directory, renames it into place when complete and removes it
on a failure. A directory that already exists, as when an unlocker
replaces one of the same name, is written in place and never removed.

Model: opus-5-5
2026-10-04 10:44:58 +00:00