You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@knox.apache.org by GitBox <gi...@apache.org> on 2019/11/15 20:28:41 UTC

[GitHub] [knox] pzampino commented on a change in pull request #195: KNOX-2126. Add an API to retrieve the public key used for Knox JWT verification.

pzampino commented on a change in pull request #195: KNOX-2126. Add an API to retrieve the public key used for Knox JWT verification.
URL: https://github.com/apache/knox/pull/195#discussion_r346996391
 
 

 ##########
 File path: gateway-service-knoxtoken/src/test/java/org/apache/knox/gateway/service/knoxtoken/TokenServiceResourceTest.java
 ##########
 @@ -778,6 +785,32 @@ public void testTokenRevocation_Enabled_WithRenewersWithValidSubject() throws Ex
     validateSuccessfulRevocationResponse(renewalResponse);
   }
 
+  @Test
+  public void testGetPublicKey() throws Exception {
+    TokenResource tr = createTokenResourceForPublicKeyTests(false);
+
+    Response response = tr.publicKey();
+    assertEquals("Unexpected response code", Status.OK.getStatusCode(), response.getStatus());
+    String retString = response.getEntity().toString();
+    Map<String, String> responseMap = parseJSONResponse(retString);
+    assertNotNull("PublicKey is null", responseMap.get(TokenResource.PUBLIC_KEY));
+    assertNotNull("Algorithm is null", responseMap.get(TokenResource.ALGORITHM));
+    assertEquals("Mismatched algorithm", responseMap.get(TokenResource.ALGORITHM),
 
 Review comment:
   Nitpick: Generally, the expected value is first in assertEquals(expected, actual)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services