[ 
https://issues.apache.org/jira/browse/KNOX-2071?focusedWorklogId=339544&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-339544
 ]

ASF GitHub Bot logged work on KNOX-2071:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 06/Nov/19 18:49
            Start Date: 06/Nov/19 18:49
    Worklog Time Spent: 10m 
      Work Description: smolnar82 commented on pull request #178: KNOX-2071 - 
Configurable maximum token lifetime for TokenStateService
URL: https://github.com/apache/knox/pull/178#discussion_r343264638
 
 

 ##########
 File path: 
gateway-service-knoxtoken/src/test/java/org/apache/knox/gateway/service/knoxtoken/TokenServiceResourceTest.java
 ##########
 @@ -679,6 +680,40 @@ public void 
testTokenRenewal_Enabled_WithRenewersWithValidSubject() throws Excep
     validateSuccessfulRenewalResponse(renewalResponse);
   }
 
+  @Test
+  public void testTokenRenewal_Enabled_WithDefaultMaxTokenLifetime() throws 
Exception {
+    final String caller = "yarn";
+
+    // Max lifetime duration is 10ms
+    Pair<TestTokenStateService, Response> testResult =
+                  doTestTokenRenewal(true, caller, null, 
createTestSubject(caller));
+
+    TestTokenStateService tss = testResult.getLeft();
+    assertEquals(1, tss.issueTimes.size());
+    String token = tss.issueTimes.keySet().iterator().next();
+
+    // Verify that the configured max lifetime was honored
+    assertEquals(tss.getDefaultMaxLifetimeDuration(), 
tss.getMaxLifetime(token) - tss.getIssueTime(token));
+  }
+
+
+  @Test
+  public void testTokenRenewal_Enabled_WithConfigurableMaxTokenLifetime() 
throws Exception {
 
 Review comment:
   Do we need the underscores in the method name (see in another new method 
above too)?
 
----------------------------------------------------------------
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:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 339544)
    Time Spent: 2h  (was: 1h 50m)

> Configurable maximum token lifetime for TokenStateService
> ---------------------------------------------------------
>
>                 Key: KNOX-2071
>                 URL: https://issues.apache.org/jira/browse/KNOX-2071
>             Project: Apache Knox
>          Issue Type: Bug
>          Components: Server
>    Affects Versions: 1.3.0
>            Reporter: Philip Zampino
>            Assignee: Philip Zampino
>            Priority: Minor
>             Fix For: 1.4.0
>
>          Time Spent: 2h
>  Remaining Estimate: 0h
>
> With KNOX-2067, and the ability to renew tokens up to a maximum token 
> lifetime, it should be possible to configure this maximum lifetime as either 
> a gateway-level configuration item, or as a service param of a deployed 
> instance of a token issuing service (e.g., KnoxToken service).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to