Use gpg.conf's default-key when unlocker add pgp has no --keyid #167

Merged
clawbot merged 1 commits from fix/141-gpgconf-default-key into next 2026-10-15 00:31:54 +02:00
1 Commits
Author SHA1 Message Date
sneak f40f3f4041 Use gpg.conf's default-key when unlocker add pgp has no --keyid (closes #141)
check / check (push) Canceled after 0s
getDefaultGPGKey took the default-key value from `gpgconf --list-options
gpg` as printed. gpgconf prints a string value with a leading `"` and
percent-escaped, so gpg rejected the key ID. The parsing moved into
parseDefaultGPGKey, which drops the `"` and percent-decodes the rest with
url.PathUnescape, which leaves `+` alone. A value that does not decode is
an error, not a fallback to the first secret key.

Rule suppressed: gosec G703 on the test's write of gpg.conf into the
GNUPGHOME directory newTestGPGKey made.

Model: opus-5-5
2026-10-14 22:00:41 +00:00