Class PublicKeyEndpoint
- java.lang.Object
-
- org.eclipse.microprofile.jwt.tck.config.PublicKeyEndpoint
-
@RequestScoped @Path("/endp") public class PublicKeyEndpoint extends Object
The common endpoint used by the various config tests
-
-
Constructor Summary
Constructors Constructor Description PublicKeyEndpoint()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
publicKey4k()
An endpoint that returns the contents of the bundled /publicKey4k.pem keyjakarta.json.JsonObject
publicKey4kAsJWKS(String kid)
An endpoint that converts the bundled /publicKey4k.pem key in the corresponding JWKS formatjakarta.json.JsonObject
verifyIssIsOk()
Check a token with an iss matches the mp.jwt.verify.issuer valuejakarta.json.JsonObject
verifyKeyAsBase64JWK(String kid)
Verify that the injected key is a base64 encoded JWK public keyjakarta.json.JsonObject
verifyKeyAsJWK(String kid)
Verify that the injected key is a JWK public keyjakarta.json.JsonObject
verifyKeyAsJWKS(String kid)
Verify that the injected key is a JWKS public keyjakarta.json.JsonObject
verifyKeyAsPEM()
Verify that the injected key is a PEM RSA public keyjakarta.json.JsonObject
verifyKeyLocationAsJWKResource(String kid)
jakarta.json.JsonObject
verifyKeyLocationAsJWKSResource(String kid)
jakarta.json.JsonObject
verifyKeyLocationAsJWKSUrl(String kid)
Check the location exists and is a URL whose contents are valid JWKS public keyjakarta.json.JsonObject
verifyKeyLocationAsPEMResource()
jakarta.json.JsonObject
verifyKeyLocationAsPEMUrl()
Check the location exists and is a URL whose contents are valid PEM public key
-
-
-
Method Detail
-
verifyKeyAsPEM
@GET @Path("/verifyKeyAsPEM") @Produces("application/json") @RolesAllowed("Tester") public jakarta.json.JsonObject verifyKeyAsPEM()
Verify that the injected key is a PEM RSA public key- Returns:
- json object for test result
-
verifyKeyLocationAsPEMResource
@GET @Path("/verifyKeyLocationAsPEMResource") @Produces("application/json") @RolesAllowed("Tester") public jakarta.json.JsonObject verifyKeyLocationAsPEMResource()
-
verifyKeyLocationAsPEMUrl
@GET @Path("/verifyKeyLocationAsPEMUrl") @Produces("application/json") @RolesAllowed("Tester") public jakarta.json.JsonObject verifyKeyLocationAsPEMUrl()
Check the location exists and is a URL whose contents are valid PEM public key- Returns:
- result of validation test
-
verifyKeyAsJWK
@GET @Path("/verifyKeyAsJWK") @Produces("application/json") @RolesAllowed("Tester") public jakarta.json.JsonObject verifyKeyAsJWK(@QueryParam("kid") String kid)
Verify that the injected key is a JWK public key- Returns:
- json object for test result
-
verifyKeyAsBase64JWK
@GET @Path("/verifyKeyAsBase64JWK") @Produces("application/json") @RolesAllowed("Tester") public jakarta.json.JsonObject verifyKeyAsBase64JWK(@QueryParam("kid") String kid)
Verify that the injected key is a base64 encoded JWK public key- Returns:
- json object for test result
-
verifyKeyAsJWKS
@GET @Path("/verifyKeyAsJWKS") @Produces("application/json") @RolesAllowed("Tester") public jakarta.json.JsonObject verifyKeyAsJWKS(@QueryParam("kid") String kid)
Verify that the injected key is a JWKS public key- Returns:
- json object for test result
-
verifyKeyLocationAsJWKResource
@GET @Path("/verifyKeyLocationAsJWKResource") @Produces("application/json") @RolesAllowed("Tester") public jakarta.json.JsonObject verifyKeyLocationAsJWKResource(@QueryParam("kid") String kid)
-
verifyKeyLocationAsJWKSResource
@GET @Path("/verifyKeyLocationAsJWKSResource") @Produces("application/json") @RolesAllowed("Tester") public jakarta.json.JsonObject verifyKeyLocationAsJWKSResource(@QueryParam("kid") String kid)
-
verifyKeyLocationAsJWKSUrl
@GET @Path("/verifyKeyLocationAsJWKSUrl") @Produces("application/json") @RolesAllowed("Tester") public jakarta.json.JsonObject verifyKeyLocationAsJWKSUrl(@QueryParam("kid") String kid)
Check the location exists and is a URL whose contents are valid JWKS public key- Parameters:
kid
- - expected kid of JWKS- Returns:
- result of validation test
-
verifyIssIsOk
@GET @Path("/verifyIssIsOk") @Produces("application/json") @RolesAllowed("Tester") public jakarta.json.JsonObject verifyIssIsOk()
Check a token with an iss matches the mp.jwt.verify.issuer value- Returns:
- result of validation test
-
publicKey4k
@GET @Path("/publicKey4k") @Produces("text/plain") @PermitAll public String publicKey4k() throws IOException
An endpoint that returns the contents of the bundled /publicKey4k.pem key- Returns:
- the /publicKey4k.pem classpath resource contents a PEM string
- Throws:
IOException
-
publicKey4kAsJWKS
@GET @Path("/publicKey4kAsJWKS") @Produces("application/json") @PermitAll public jakarta.json.JsonObject publicKey4kAsJWKS(@QueryParam("kid") String kid) throws Exception
An endpoint that converts the bundled /publicKey4k.pem key in the corresponding JWKS format- Parameters:
kid
- - the kid to use in the JWKS- Returns:
- the /publicKey4k.pem classpath resource contents a JWKS object
- Throws:
Exception
-
-