fix(yubikey): vertical yk-status, pubkey zsh nomatch, GitHub UI link, drop stale yk-ssh-load files#304
Merged
Conversation
…I link, drop yk-ssh-load files Four user-reported papercuts: 1. yk-status: switch to vertical layout. Heading was a horizontal dot-separated string (device type + serial + fw + FIPS marker), which was hard to scan. Now the device type is the heading and Serial / Firmware / FIPS / Form factor / FIDO2 PIN / SSH key are vertical rows, one fact per line. Backticks in the warning messages dropped (showed as literal '\\`' in fish). 2. pubkey: fix zsh NOMATCH error. In zsh 'for x in ~/.ssh/id_ecdsa_sk_*.pub' aborts the function with 'no matches found' the moment one pattern doesn't match. Use find(1) for glob expansion so unmatched patterns just return empty. 3. GitHub Settings URL printed alongside every gh ssh-key add. Not everyone has gh installed and configured. Every nudge in yk-enroll, yk-ssh-new, yk-git-sign-setup and work-checklist now also points at https://github.com/settings/keys for the GUI flow. yk-git-sign-setup also got a missing --type authentication line. 4. .chezmoiremove for yk-ssh-load. When PR #303 deleted the yk-ssh-load source files, chezmoi did not remove the destination copies on apply (chezmoi only manages files in the source state; removed sources don't cascade to destination deletions). Add home/.chezmoiremove.tmpl listing both files so a plain 'chezmoi apply' cleans them up. Tests: yk-status.bats updated for the vertical output (5 assertion blocks). New pubkey.bats with 5 cases including a zsh NOMATCH regression. yk-enroll.bats + work-checklist.bats now also assert the GitHub Settings URL is printed. 51 cases green.
6462029 to
f98a977
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Four user-reported papercuts.
1.
yk-status: vertical layoutThe horizontal heading was hard to scan, especially with three keys plugged in. New layout:
Heading is just the device type. Detail rows are vertical, one fact per line. Also dropped the literal backticks in the warning messages (
yk-enroll→`yk-enroll`showed as\yk-enroll`` in fish).2.
pubkey: fix zsh NOMATCH errorzsh's
NOMATCHoption madefor x in ~/.ssh/id_ecdsa_sk_*.pubabort the whole function the moment one pattern didn't match. Usefind(1)for glob expansion so unmatched patterns just return empty.3. GitHub Settings URL printed alongside every
gh ssh-key addNot everyone has
ghinstalled/configured. Every nudge inyk-enroll,yk-ssh-new,yk-git-sign-setupandwork-checklistnow also points at https://github.com/settings/keys for the GUI flow.yk-git-sign-setupalso picked up a missing--type authenticationline in its mandatory upload prompt.4.
.chezmoiremoveforyk-ssh-loadWhen PR #303 deleted the
yk-ssh-loadsource files, chezmoi did not remove the destination copies on apply (chezmoi only manages files in source state; deletions don't cascade). Newhome/.chezmoiremove.tmpllists bothyk-ssh-load.shandyk_ssh_load.fishso a plainchezmoi applycleans them up.Verify
51 cases green. New tests:
yk-status.bats— assertions rewritten for the vertical layout, asserts no horizontal· serial / fw / FIPSmarkers leak.pubkey.bats(new) — 5 cases including apubkey: works under zsh (no NOMATCH error on unmatched globs)regression.yk-enroll.bats+work-checklist.bats— now also asserthttps://github.com/settings/keysappears.Files
home/dot_config/{shell,fish}/functions/yk_status.{sh,fish}— vertical layouthome/dot_config/shell/aliases.sh(pubkey) —find-based discovery, no shell-glob NOMATCHhome/dot_config/{shell,fish}/functions/yk-enroll.*— GitHub URLhome/dot_config/{shell,fish}/functions/yk-ssh-new.*— GitHub URLhome/dot_config/{shell,fish}/functions/yk-git-sign-setup.*— GitHub URL + missing--type authenticationhome/dot_config/{shell,fish}/functions/work-checklist.*— GitHub URLhome/.chezmoiremove.tmpl(new) — drops staleyk-ssh-loadfiles on next applytests/bash/yk-status.bats— vertical assertionstests/bash/pubkey.bats(new)tests/bash/yk-enroll.bats+work-checklist.bats— URL assertionsdocs/yubikey.md— Quick start gained the GitHub UI link