feat: gpgtools ssh-config-summary - per-host table of gpg-enabled logins (v0.11.0)

- read-only: one row per marker-managed block in ~/.ssh/config (or
  --config PATH): alias, hostname, user, key id (first 8 chars of
  the identity's SHA256 fingerprint via ssh-keygen -lf, material
  digest as fallback), and the fallback identity's name
- no managed blocks / missing config: fact + configure_ssh hint,
  exit 0 always (read-only command)
- spec items 2.8 + section 13 first, then tests, then code (SPEC
  6.12); 10 new tests (100 in test_gpgtools.py), registry
  description, README section, CHANGELOG 0.11.0, version pins

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
nvaldez
2026-11-19 09:49:35 +01:00
parent cdc209536f
commit 41c8b99bd6
9 changed files with 333 additions and 7 deletions
+36 -2
View File
@@ -18,6 +18,7 @@ Items are cited as `gpgtools spec item N.M`.
- [10. configure_ssh behavior](#10-configure_ssh-behavior)
- [11. store_publickey behavior](#11-store_publickey-behavior)
- [12. initialize behavior](#12-initialize-behavior)
- [13. ssh-config-summary behavior](#13-ssh-config-summary-behavior)
<!-- toc-end -->
@@ -73,6 +74,9 @@ Items are cited as `gpgtools spec item N.M`.
that gnupg is ready on this machine and installs what is
missing; the gnupg-only half of initialize_yubikey
(section 12).
- **2.8** `daedalus gpgtools ssh-config-summary
[--config PATH]` - prints the table of gpg-enabled ssh logins
found in the config (section 13); read-only.
## 3. initialize_yubikey behavior
@@ -225,7 +229,9 @@ Items are cited as `gpgtools spec item N.M`.
sources including the store chain and fingerprint mismatch,
challenge sign/verify success and refusal, send idempotence by
material, store: file sources, append, preservation,
idempotence, perms, dry run, and the CLI wiring, guards, and
idempotence, perms, dry run, summary: block parsing (each
field), key-id resolution and both id fallbacks, the empty
and missing-config paths, and the CLI wiring, guards, and
dry runs.
- **8.3** The change order is spec item 6.12: this spec first,
then failing tests, then the smallest implementation.
@@ -239,7 +245,8 @@ Items are cited as `gpgtools spec item N.M`.
(argcomplete opt-in after the parser), 9.8 (version bump).
- **9.3** History: `CHANGELOG.md` entries 0.5.0, 0.6.0
(initialize/send), 0.7.0 (configure_ssh), 0.8.0
(--file source, store_publickey), 0.9.0 (initialize).
(--file source, store_publickey), 0.9.0 (initialize), 0.10.0
(init script), 0.11.0 (ssh-config-summary).
## 10. configure_ssh behavior
@@ -339,3 +346,30 @@ Host <alias>
store_publickey (item 11) - on a machine without the
YubiKey, run `initialize` first when a gpg-dependent source
(`--fingerprint`, `--url`, `--yubikey`) is wanted.
## 13. ssh-config-summary behavior
- **13.1** Scope: every marker-managed block (item 10.1) in
`--config` (default `~/.ssh/config`) is one gpg-enabled
login. The command never writes and never contacts any
host; it reads only the config and the IdentityFiles the
blocks name (`~` expanded).
- **13.2** Output is one row per block with the columns
`alias`, `hostname`, `user`, `key id`, `fallback`:
hostname defaults to the alias when the block omits
HostName; user prints `-` when absent (ssh's own default);
fallback prints `-` when the block has no second
IdentityFile. Columns are padded and separated by two
spaces, like the daedalus script listing.
- **13.3** Key id: taken from the block's *first* IdentityFile.
`ssh-keygen -lf <file>` yields the SHA256 fingerprint; the
row shows its first 8 chars after the `SHA256:` prefix
(shorter values print in full). When ssh-keygen fails or is
missing but the file is readable and holds a valid key line
(item 4.2), the id falls back to the first 8 chars of the
material digest (item 4.8) - both are stable per key. A
missing or unreadable IdentityFile prints `-` for the id.
- **13.4** No managed blocks - a missing config file counts -
prints that fact with the `configure_ssh` hint and exits 0.
- **13.5** Exit code is always 0; the command is read-only and
has no failure modes that would leave anything half-done.