feat: gpgtools configure_ssh, store_publickey, --file source, initialize (v0.7.0-v0.9.0)

- configure_ssh (0.7.0): marker-managed per-host ssh client block in
  ~/.ssh/config, idempotent, unmanaged-alias guard (exit 11)
- store_publickey (0.8.0): on-site bootstrap mirror of send_pubkey -
  run on the machine access is granted to, installs the key into the
  local authorized_keys (multi-key preserving, material dedup, 700/600,
  no possession check by design); shared --file PATH source (USB
  stick) for both store subcommands; identity block printed before
  acting (line, source, SHA-256 material digest)
- initialize (0.9.0): gnupg readiness check + install, no card
  expectations; --dry-run; initialize_yubikey step 1 shares the flow
- spec-first per SPEC 6.11/6.12: gpgtools spec.md items 2.6/2.7,
  4.1.5, 4.8, sections 10-12; 91 tests in test_gpgtools.py;
  README/registry/CHANGELOG/version pins through 0.9.0

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
nvaldez
2026-11-19 08:57:30 +01:00
parent 85e8342a74
commit e9b716b399
9 changed files with 1283 additions and 74 deletions
+57 -2
View File
@@ -8,15 +8,70 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and
## [Unreleased]
### Added
- Nothing yet.
## [0.9.0] - 2026-11-19
### Added in 0.9.0
- `gpgtools initialize`: checks that gnupg is ready on this machine
(`gpg --version`) and installs what is missing — the gnupg-only
half of `initialize_yubikey`, with no card expectations. Missing gpg
triggers the same manager detection and sudo install; the check
re-runs once after a successful install. `--dry-run` prints
`already ready` or the install command and changes nothing. Intended
as the on-site companion to `store_publickey --fingerprint` on a
bare server. Spec section 12 written first, then tests, then code
(SPEC 6.12); `initialize_yubikey` step 1 now runs the same shared
flow instead of its own inline copy.
## [0.8.0] - 2026-11-19
### Added in 0.8.0
- `gpgtools store_publickey`: the on-site bootstrap mirror of
`send_pubkey`. Run on the machine that access is being granted
**to** (a server with ssh password authentication disabled, no key
there yet, you at its console), it resolves one SSH public key and
appends it to this machine's `authorized_keys` — so the machine
holding the YubiKey can ssh in afterwards. Same five sources as
`send_pubkey`; by design there is no proof-of-possession (the
private half is elsewhere). Existing entries preserved verbatim,
idempotent by key material, `~/.ssh`/file modes forced to 700/600,
`--authorized-keys` override, `--dry-run`. Spec section 11 written
first, then tests, then code (SPEC 6.12).
- New shared source `--file PATH` for both `send_pubkey` and
`store_publickey`: a file holding the SSH public key line,
typically `yubikey_auth.pub` carried on a USB stick — no network,
no gpg needed. Several keys in one file refuse rather than guess.
- Both resolve-and-store subcommands now print an identity block (key
line, source, and the key material's SHA-256 digest) before acting,
so what was resolved can be compared across machines.
## [0.7.0] - 2026-11-19
### Added in 0.7.0
- `gpgtools configure_ssh` (guide step 7): writes a marker-managed
`Host <alias>` block into the ssh client config — YubiKey identity
first, fallback identity only when it exists, `IdentitiesOnly yes`.
Idempotent (re-runs replace the block; everything outside the
markers is preserved), `--dry-run`, and a guard that refuses when an
unmanaged `Host` with the same alias would shadow the block. Spec
items 2.5 and 10 written first, then tests, then code (SPEC 6.12).
- Per-script local specs (SPEC items 6.11, 6.12): every script gets a
spec that completely describes it — `spec.md` in a Python script's
folder, `<name>.spec.md` beside bash/PowerShell/batch scripts — in
the sectionized format of SPEC.md. Script work is spec first, then
tests, then code (SPEC item 6.12). First specs added:
tests, then code. First specs added:
`gpgtools`, `hello`, `hello_bash`.
### Fixed in 0.7.0
- Test fixtures no longer carry private values: the real server IP,
host alias, card serial, and public key fingerprint were replaced
with documentation-range placeholders.
## [0.6.0] - 2026-11-18
### Added in 0.6.0