Re-encode PublicKey in OpenSSH authorized_keys format#7
Merged
Conversation
ptoomey3
approved these changes
Feb 12, 2019
Member
ptoomey3
left a comment
There was a problem hiding this comment.
Seems sensible. I had one question, but otherwise LGTM.
| # Returns a PublicKey::Base subclass instance. | ||
| def self.parse(key) | ||
| def self.parse_openssh(key) | ||
| algo, raw, _ = SSHData.key_parts(key) |
Member
There was a problem hiding this comment.
Is there any reason we might not want to throw away the comment such that .openssh can round-trip an originally parsed key easily?
Contributor
Author
There was a problem hiding this comment.
It wouldn't hurt to keep it. The comment is OpenSSH specific though, so it seems "cleaner" to not keep it around...
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.
I need to be able to re-encode a public key in the format you'd fine in the
authorized_keysfile (that's what we store in the DB). This PR adds aPublicKey::Base#opensshmethod for doing this. It also renames some things and improves some comments.