-
Notifications
You must be signed in to change notification settings - Fork 122
Eagerly implemented Debug
trait
#343
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
base: main
Are you sure you want to change the base?
Conversation
For the same reason I flagged these as not being appropriate for |
I'll update them and push the next commit online :) |
26cede4
to
8c327f4
Compare
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 seems okay to me.
I'd prefer to avoid implementing Clone
on types that include a private key.
8c327f4
to
3982c1a
Compare
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.
Debug impl of CertifiedKey
3982c1a
to
7d6bd16
Compare
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 think instead of removing the Debug
impl, it would be better to manually implement it. that way, we don't add it back by accident. can be a followup though.
I can remove the implementations and leave it at that... but that just doesn't sit right to leave it at that. Maybe it is a great idea to create a proc macro crate that implements derive macros. Then we could derive a similar macro that actually implements the basic traits in a certain manner. For example: #[derive(DebugLimited)]
struct Issuer<'a, S> {
distinguished_name: &'a DistinguishedName,
key_identifier_method: &'a KeyIdMethod,
key_usages: &'a [KeyUsagePurpose],
#[debug_remove] // or #[debug_redact] to show the field but not the value
key_pair: &'a S,
} This would (in this case) implement the |
The costs of adding yet another derive macro are substantial. You could just do a manual Debug implementation instead, it's fine. |
In that case I would like to know what fields / types you would like me to redact / remove. |
Only remove |
7d6bd16
to
b48caf8
Compare
Issue #340 discussed implementing the most common traits for this crate. I implemented the
Debug
trait for all possiblestuct
s andenum
s in this PR.I also came across the
CertifiedKey
andIssuer
types that didn't derive theClone
trait, but are able to. Should this be addressed as well, or should we keep it that way?