risdenk commented on a change in pull request #257: KNOX-2214 - Periodic job to 
evict expired tokens
URL: https://github.com/apache/knox/pull/257#discussion_r377137751
 
 

 ##########
 File path: 
gateway-server/src/main/java/org/apache/knox/gateway/services/token/impl/AliasBasedTokenStateService.java
 ##########
 @@ -147,4 +151,18 @@ protected void updateExpiration(final String token, long 
expiration) {
       log.failedToUpdateTokenExpiration(e);
     }
   }
+
+  @Override
+  protected List<String> getTokens() {
+    List<String> allAliases = new ArrayList();
+    try {
+      allAliases = 
aliasService.getAliasesForCluster(AliasService.NO_CLUSTER_NAME);
+      /* only get the aliases that represent tokens and extract the current 
list of tokens */
+      allAliases.stream().filter(a -> 
a.contains("TOKEN_MAX_LIFETIME_POSTFIX")).map(a -> a.substring(0, 
a.indexOf("TOKEN_MAX_LIFETIME_POSTFIX")))
 
 Review comment:
   Yea you have TOKEN_MAX_LIFETIME_POSTFIX as a string with 
"TOKEN_MAX_LIFETIME_POSTFIX". Instead of just using TOKEN_MAX_LIFETIME_POSTFIX.

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


With regards,
Apache Git Services

Reply via email to