Skip to content
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

JWKSet is not cloneable #203

Closed
Eric-Arellano opened this issue Mar 4, 2021 · 3 comments · Fixed by #204
Closed

JWKSet is not cloneable #203

Eric-Arellano opened this issue Mar 4, 2021 · 3 comments · Fixed by #204

Comments

@Eric-Arellano
Copy link

Hello, thank you for an excellent library! This has been really helpful and I appreciate the JWK support.

It looks like JWKSet does not derive Clone:

biscuit/src/jwk.rs

Lines 665 to 670 in 9148092

/// A JSON object that represents a set of JWKs.
#[derive(Debug, Eq, PartialEq, Serialize, Deserialize)]
pub struct JWKSet<T> {
/// Containted JWKs
pub keys: Vec<JWK<T>>,
}

However, JWK does:

biscuit/src/jwk.rs

Lines 616 to 630 in 9148092

/// A JSON object that represents a cryptographic key.
/// The members of the object represent properties of the key, including its value.
/// Type `T` is a struct representing additional JWK properties
#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)]
pub struct JWK<T> {
/// Common JWK parameters
#[serde(flatten)]
pub common: CommonParameters,
/// Key algorithm specific parameters
#[serde(flatten)]
pub algorithm: AlgorithmParameters,
/// Additional JWK parameters
#[serde(flatten)]
pub additional: T,
}

Do you know if there is a particular reason for this, or it's only an oversight? I'd be happy to submit a small patch for 0.6.* if you'd be interested.

@lawliet89
Copy link
Owner

It's an oversight. Please submit a PR to add it in, if you have the time.

lawliet89 added a commit that referenced this issue Mar 4, 2021
@lawliet89
Copy link
Owner

Had some time so I've opened and will merge in #204 once tests pass.

lawliet89 added a commit that referenced this issue Mar 4, 2021
@Eric-Arellano
Copy link
Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants