New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pass or collect comments for ssh private keys #9019
base: main
Are you sure you want to change the base?
Conversation
@alex could you plz review this pr? |
It's on my TODO list for this weekend.
…On Fri, Jun 9, 2023 at 12:53 PM James Z.M. Gao ***@***.***> wrote:
@alex <https://github.com/alex> could you plz review this pr?
—
Reply to this email directly, view it on GitHub
<#9019 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAAGBFDMIQJMTC3WV5KRYTXKNIJ3ANCNFSM6AAAAAAYZH4S6U>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
All that is necessary for evil to succeed is for good people to do nothing.
|
comment_collector: typing.Union[ | ||
typing.Callable[[bytes], None], None | ||
] = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This API is pretty out of step with anything we have elsewhere. Are there any ways we can avoid a callback like this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another way is to save the comments in a runtime attribute of the loaded private key
if hasattr(encryption_algorithm, "_comment"): | ||
_comment_attr = getattr(encryption_algorithm, "_comment") | ||
if isinstance(_comment_attr, bytes): | ||
comment = _comment_attr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what this is for, or where the comment attribute is supposed to come from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, we can omit checking isinstance of bytes
IMO, this signature is too foreign to the rest of our API surface. Another (possibly bad) idea: should we have a separate loader |
@reaperhulk another api is ok, but most codes of the new api have to be copied directly from the original one |
close #8980