-
Notifications
You must be signed in to change notification settings - Fork 298
deserialization support for some missing algorithms #324
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
Conversation
@Keats
Let me know if you want me to remove |
src/algorithms.rs
Outdated
@@ -80,6 +83,11 @@ impl Algorithm { | |||
Algorithm::EdDSA => AlgorithmFamily::Ed, | |||
} | |||
} | |||
|
|||
/// Converting Key Algorithm to Algorithm | |||
pub fn from_key_algorithm(s: &KeyAlgorithm) -> Result<Self> { |
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 it makes more sense to do KeyAlgorithm.to_algorithm
since this is not really meant to be public in practice and this way all the logic is contained in jwk.rs?
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.
Agreed. I previously thought so but in the example auth0.rs
it needed Algorithm
from KeyAlgorithm
at Validation::new
. I think we don't need public method just for that, we can do it via Algorithm::from_str
src/algorithms.rs
Outdated
== KeyAlgorithm::from_str(s).unwrap() as isize | ||
); | ||
} | ||
} |
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.
let's remove that test, I don't want tests to rely on enum ordering
Any update on this? It's been approved for some time now, but still hasn't gotten merged, would be nice to atleast know the reason why |
I forgot about it |
Fix towards #252
Added deserialization support for some missing algorithms in order to avoid panic while deserialization.