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

Add missing non_exhaustive to enums #1957

Merged
merged 5 commits into from
Sep 19, 2023
Merged

Add missing non_exhaustive to enums #1957

merged 5 commits into from
Sep 19, 2023

Conversation

inahga
Copy link
Contributor

@inahga inahga commented Sep 18, 2023

Mainly targeting the ExtensionType, but I noticed other enums that could expand in the future in this crate are missing it.

Adding it to the HPKE types comes with unfortunate propagation of an error and unwraps. I'm open to whether this change is worth it. We could also alternatively have a panic here https://github.com/divviup/janus/pull/1957/files#diff-9c7b948f33912f9d1847860795daa701030c35ed114ba5d7e1fcd9674f234ba2R219.

@inahga inahga force-pushed the inahga/non-exhaustive branch from cd6192f to ca1d412 Compare September 18, 2023 20:35
@inahga inahga marked this pull request as ready for review September 18, 2023 20:38
@inahga inahga requested a review from a team as a code owner September 18, 2023 20:38
@@ -321,7 +323,8 @@ pub(super) async fn put_global_hpke_config<C: Clock>(
req.kem_id.unwrap_or(HpkeKemId::X25519HkdfSha256),
req.kdf_id.unwrap_or(HpkeKdfId::HkdfSha256),
req.aead_id.unwrap_or(HpkeAeadId::Aes128Gcm),
);
)
.unwrap();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should propagate this error instead of unwrapping it, since the algorithms could be unsupported if the operator makes a mistake.

@inahga inahga enabled auto-merge (squash) September 19, 2023 14:28
@inahga inahga merged commit 5faf3ee into main Sep 19, 2023
@inahga inahga deleted the inahga/non-exhaustive branch September 19, 2023 15:43
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 this pull request may close these issues.

2 participants