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/06 15:28:34 UTC

[GitHub] [knox] pzampino commented on a change in pull request #178: KNOX-2071 - Configurable maximum token lifetime for TokenStateService

pzampino commented on a change in pull request #178: KNOX-2071 - Configurable maximum token lifetime for TokenStateService
URL: https://github.com/apache/knox/pull/178#discussion_r343159473
 
 

 ##########
 File path: gateway-spi/src/main/java/org/apache/knox/gateway/services/security/token/TokenStateService.java
 ##########
 @@ -27,22 +27,41 @@
 
   String CONFIG_SERVER_MANAGED = "knox.token.exp.server-managed";
 
+  /**
+   * @return The default duration (in milliseconds) for which a token's life will be extended when it is renewed.
+   */
+  long getDefaultRenewInterval();
+
+  /**
+   * @return The default maximum lifetime duration (in milliseconds) of a token.
+   */
+  long getDefaultMaxLifetimeDuration();
+
   /**
    * Add state for the specified token.
    *
    * @param token     The token.
    * @param issueTime The time the token was issued.
    */
-  void addToken(JWTToken token, long issueTime);
-
+  void addToken(JWTToken token, Long issueTime);
 
 Review comment:
   I made that change before subsequently exposing the methods for getting the default renewal interval and maximum lifetime values. The Long vs long was so that a null could be passed in, indicating that the default should be applied. Now, clients have to pass in a value, which they can get from the TokenStateService itself, so the params could be reverted to the long type again.

----------------------------------------------------------------
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