fix: honor ssh_key_path config in SessionKeyManager and config.local.…#139
Conversation
|
Sorry! My 1st PR. Didn't see that it required flake & black checks. I think everything should pass now! |
jahwag
left a comment
There was a problem hiding this comment.
Hey, nice fix! This solves a real annoyance reported in #82. Couple things before merging:
The _find_ssh_key method has a bunch of new branches now but no tests. Would be
great to add at least a few covering the main paths (configured file, configured
dir, default fallback).
Also the new user-facing messages use print() but the class already has
self.logger.
Minor thing: the check on line 47 that tries to guess whether a non-existent
path is a file or directory (configured.suffix or
configured.name.startswith("id_")) could misfire for keys with unusual names.
Probably better to just always treat it as a missing file if it doesn't exist.
One more thing: commits need to be signed for this repo. Could you rebase with
signed commits?
d1860fc to
b48ac13
Compare
|
Thanks for the great suggestions. I signed my files, cleaned up that duplicate comment, added some tests, used self-logger, and agreed with your simplified approach on checking file vs directory. Let me know if it looks good to you! |
Problem
Setting
ssh_key_pathin.claudesync/config.local.jsonhas no effect.SessionKeyManageris instantiated without any arguments, and_find_ssh_key()only searches
~/.ssh/for hardcoded filenames (id_ed25519,id_ecdsa).Users with custom-named keys (e.g.,
~/.ssh/my_claude_key) are prompted toenter a path on every run, even with a valid config entry.
Fix
SessionKeyManager.__init__now accepts an optionalssh_key_pathparameter_find_ssh_key()checks the configured path first:~/.ssh/~/.ssh/fallback with standard key namesFileConfigManagernow passesself.get("ssh_key_path")wheninstantiating
SessionKeyManagerid_ed25519if not using a custom
ssh_key_pathconfigFiles Changed
src/claudesync/session_key_manager.pysrc/claudesync/configmanager/file_config_manager.py