Class JWKSStaticSetHandlerImpl
java.lang.Object
uk.co.spudsoft.jwtvalidatorvertx.impl.JWKSStaticSetHandlerImpl
- All Implemented Interfaces:
JsonWebKeySetHandler
,JsonWebKeySetStaticHandler
- Author:
- jtalbut
-
Constructor Summary
ConstructorsConstructorDescriptionJWKSStaticSetHandlerImpl
(Collection<String> acceptableIssuerRegexes) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionAdd a JWK to the known set.io.vertx.core.Future<JWK>
Find a JWK for the given issuer and kid.Remove a JWK from the known set.void
validateIssuer
(String issuer) Confirm that the issuer matches at least one of the configured acceptable issuer regular expressions.
-
Constructor Details
-
JWKSStaticSetHandlerImpl
Constructor.- Parameters:
acceptableIssuerRegexes
- Collection of regular expressions (as Strings) that any passed in issuer must match. This JsonWebKeySet handler is entirely static, so the specification of acceptable issuers is not a vital security feature.
-
-
Method Details
-
addKey
Description copied from interface:JsonWebKeySetStaticHandler
Add a JWK to the known set.- Specified by:
addKey
in interfaceJsonWebKeySetStaticHandler
- Parameters:
issuer
- The issuer of the key being added.key
- The key being added.- Returns:
- this for fluent configuration.
-
removeKey
Description copied from interface:JsonWebKeySetStaticHandler
Remove a JWK from the known set.- Specified by:
removeKey
in interfaceJsonWebKeySetStaticHandler
- Parameters:
issuer
- The issuer of the key being removed.kid
- The ID of the key being removed.- Returns:
- this for fluent configuration.
-
validateIssuer
Description copied from interface:JsonWebKeySetHandler
Confirm that the issuer matches at least one of the configured acceptable issuer regular expressions.- Specified by:
validateIssuer
in interfaceJsonWebKeySetHandler
- Parameters:
issuer
- the issuer to confirm.- Throws:
IllegalArgumentException
- if the issuer is not in the list of acceptable issuers.
-
findJwk
Description copied from interface:JsonWebKeySetHandler
Find a JWK for the given issuer and kid.- Specified by:
findJwk
in interfaceJsonWebKeySetHandler
- Parameters:
issuer
- the issuer of the JWT (and JWK).kid
- The key ID being sought.- Returns:
- A Future that will be completed with a JWK.
-