-
Notifications
You must be signed in to change notification settings - Fork 6k
Single-key Key Selector #7055
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
Single-key Key Selector #7055
Conversation
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.
Thanks. This looks good. Go ahead and merge once you have thought about if SingleKeyJWSKeySelector should be submitted to Nimbus
* @author Josh Cummings | ||
* @since 5.2 | ||
*/ | ||
final class SingleKeyJWSKeySelector<C extends SecurityContext> implements JWSKeySelector<C> { |
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.
Should we consider submitting this to Nimbus?
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.
Thanks for checking on this. Yes, I'm planning on 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.
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.
Thanks @jzheaux. I left a couple comments.
JWSKeySelector<SecurityContext> jwsKeySelector = | ||
new JWSVerificationKeySelector<>(this.jwsAlgorithm, jwkSource); | ||
new SingleKeyJWSKeySelector<>(this.jwsAlgorithm, this.secretKey); |
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 don't think this should have changed since it's the SecretKey
builder and the issue raised is for PublicKey
.
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.
Makes sense, I've raised #7056 so that this gets articulated.
private final List<Key> keySet; | ||
private final JWSAlgorithm expectedJwsAlgorithm; | ||
|
||
public SingleKeyJWSKeySelector(JWSAlgorithm expectedJwsAlgorithm, Key key) { |
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.
You can remove the public
modifier since the class is package-private
Fixes: gh-7049