Skip to content

Make Algorithm enum non_exhaustive - #494

Merged
arckoor merged 1 commit into
Keats:masterfrom
arckoor:algo-non-exhaustive
May 12, 2026
Merged

Make Algorithm enum non_exhaustive#494
arckoor merged 1 commit into
Keats:masterfrom
arckoor:algo-non-exhaustive

Conversation

@arckoor

@arckoor arckoor commented Mar 17, 2026

Copy link
Copy Markdown
Collaborator

Closes #480.
Given that a few other PRs are wanting to add more algorithms and that that would be a breaking change anyway I figure this can just be merged when necessary.
Also addresses Jwk::compute_digest not returning a Result<>.

@arckoor

arckoor commented Mar 18, 2026

Copy link
Copy Markdown
Collaborator Author

Needs an MSRV bump probably

@arckoor
arckoor force-pushed the algo-non-exhaustive branch from be40f88 to 9c16fcf Compare April 14, 2026 21:58
@arckoor
arckoor force-pushed the algo-non-exhaustive branch from 9c16fcf to e26a5bc Compare May 12, 2026 12:58
@arckoor
arckoor force-pushed the algo-non-exhaustive branch from e26a5bc to 23c78f3 Compare May 12, 2026 13:01
@arckoor
arckoor merged commit fa89018 into Keats:master May 12, 2026
10 checks passed
@arckoor
arckoor deleted the algo-non-exhaustive branch May 17, 2026 14:38
@arckoor arckoor mentioned this pull request Jun 30, 2026
Comment thread src/jwk.rs
}
AlgorithmParameters::OctetKeyPair(a) => match a.curve {
EllipticCurve::P256 | EllipticCurve::P384 | EllipticCurve::P521 => {
panic!("OctetKeyPair can't contain this curve type")

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Since we return an error now in this function, can we not panic here and above?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JwkUtils::compute_digest must not fail

2 participants