Self-contained SSH key management via ssh_key_name#18
Merged
Conversation
Add an optional `ssh_key_name` field to the Host configuration. This bare filename will be resolved against managed key directories at runtime. When both `ssh_key_name` and `ssh_identity_file` are set, `ssh_key_name` takes precedence. Closes #17 (partial) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
New `keys::resolve(name)` searches `~/.config/git-supervisor/keys/` then falls back to `~/.ssh/`. Validates Unix permissions (must be 0600 or 0400). Includes unit tests using tempfile for isolation. Closes #17 (partial) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ssh_run and ssh_run_with_stdin now call keys::resolve() when ssh_key_name is set, with precedence over ssh_identity_file. The resolved path is passed to ssh -i as before. Closes #17 (partial) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Show the new managed key approach alongside the existing ssh_identity_file option in deployments.sample.yaml. Closes #17 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When the config file is not found in the current directory and the path is a bare filename (e.g. the default deployments.yaml), fall back to ~/.config/git-supervisor/<filename>. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
ssh_key_nameconfig field toHost— a bare filename resolved from managed key directories (~/.config/git-supervisor/keys/→~/.ssh/fallback)keysmodule handles resolution with Unix permission validation (must be 0600/0400)ssh_key_nametakes precedence overssh_identity_filewhen both are set; full backward compatibilitydeployments.yamlfrom~/.config/git-supervisor/when not found in CWDCloses #17
Test plan
keys::testscover: priority search order, fallback, missing key error, permission rejection, 0400 acceptanceconfig::tests::ssh_key_name_parsedcovers YAML parsing with/without the field~/.config/git-supervisor/keys/, reference viassh_key_name, runsupervisor check🤖 Generated with Claude Code