Tags: Adembc/lazyssh
Tags
feat(parser): refactor ssh_config parser and writer to preserve unman… …aged fields, comments, and directives (#45) This PR introduces a major refactor of the SSH config parsing and writing logic. The new implementation is more robust and secure, ensuring that only the intended changes are applied while preserving the original file’s structure. Key changes - Lossless parsing/writing: Preserve unmanaged fields (e.g., `ProxyJump`), comments, and directives such as `Include` and `Match`. - Library update: Switched to [github.com/kevinburke/ssh_config](https://github.com/kevinburke/ssh_config) as the base parser, with a custom fork to support required modifications https://github.com/adembc/ssh_config. - Backup policy: Before any modification, create a backup of the SSH config file. Maintain up to 10 backups (configurable in the future) and automatically delete older ones. - IdentityFile handling: Parse IdentityFile as an array instead of a single string, with improved update logic. - Bug fix: Resolve issue where tags could not be fully removed. - Multiple aliases: Support defining and managing multiple aliases for a single server. - Testability: Code has been refactored with testability in mind. Follow-up PRs will include dedicated tests.