-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
refactor(ext/crypto): clean up rust side importKey #13036
refactor(ext/crypto): clean up rust side importKey #13036
Conversation
@seanwykes Does the pattern introduced here work for the JWK implementation? |
Yes, should do, we'll just add two more members to KeyData enum. :) |
This commit cleans up the Rust side of `import_key` by using a bunch of enums instead of structs with "type" and "data" fields. This commit does add some duplicated code for the time being, because a lot of the other ops still need to get the same cleanup treatment.
0a5da3d
to
82ca50b
Compare
As in two fields inside |
I personally find new enum members to be cleaner than having a single big In #12022, I use different structs and enum members for Symmetric, RSA and EC JWKs: |
Makes sense. Let's cross that bridge when we get to it :-) |
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.
neat
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.
LGTM
This commit cleans up the Rust side of
import_key
by using a bunch ofenums instead of structs with "type" and "data" fields.
This commit does add some duplicated code for the time being, because
a lot of the other ops still need to get the same cleanup treatment.
This is an alternative to the Rust side changes in #13027.