Use getLegacyKeyTitle for backward-compatible key lookup - #20
Merged
shawntz merged 8 commits intoJan 11, 2026
Merged
Conversation
18 tasks
Co-authored-by: shawntz <5200266+shawntz@users.noreply.github.com>
Co-authored-by: shawntz <5200266+shawntz@users.noreply.github.com>
Co-authored-by: shawntz <5200266+shawntz@users.noreply.github.com>
Co-authored-by: shawntz <5200266+shawntz@users.noreply.github.com>
Co-authored-by: shawntz <5200266+shawntz@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] WIP on background key rotation feedback implementation
Use getLegacyKeyTitle for backward-compatible key lookup
Dec 13, 2025
shawntz
marked this pull request as ready for review
December 19, 2025 09:54
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug where the getLegacyKeyTitle function was defined but never used, preventing cleanup of SSH keys created with the legacy format (cassh-{connID}) when users upgrade to the new format (cassh-{connID}@{hostname}). The fix enables backward-compatible key lookup to handle migration scenarios smoothly.
Key Changes:
- Enhanced
findGitHubKeyIDByTitleto extract connection IDs from new-format titles and check both new and legacy title formats with exact matching - Added fallback lookup in
rotatePersonalGitHubSSHfor migration scenarios whereGitHubKeyIDis unset, enabling discovery and cleanup of keys using either title format
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Owner
|
fizzy |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
shawntz
approved these changes
Jan 11, 2026
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.
Description
The
getLegacyKeyTitlefunction was defined but never called, preventing cleanup of SSH keys created with the old format (cassh-{connID}) when users upgrade to the new format (cassh-{connID}@{hostname}).Changes:
findGitHubKeyIDByTitle: Extracts connection ID from new-format titles, generates legacy title viagetLegacyKeyTitle(), and checks both formats in a single pass with exact matchingrotatePersonalGitHubSSH: Adds fallback lookup whenGitHubKeyIDis unset (migration scenario), attempts to find and delete keys using both title formats before generating new keyType of Change
Related Issues
Addresses feedback from #7 (comment r2608119934)
How Has This Been Tested?
Test environment:
Checklist
Security Considerations
CodeQL analysis: 0 alerts
Screenshots (if applicable)
N/A
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.