pzampino commented on a change in pull request #337:
URL: https://github.com/apache/knox/pull/337#discussion_r433919383



##########
File path: 
gateway-server/src/main/java/org/apache/knox/gateway/services/token/impl/AliasBasedTokenStateService.java
##########
@@ -143,15 +189,21 @@ protected void updateExpiration(final String tokenId, 
long expiration) {
 
   @Override
   protected List<String> getTokens() {
-    List<String> allAliases = new ArrayList<>();
+    List<String> tokenIds = null;
+
     try {
-      allAliases = 
aliasService.getAliasesForCluster(AliasService.NO_CLUSTER_NAME);
-      /* only get the aliases that represent tokens and extract the current 
list of tokens */
-      allAliases = allAliases.stream().filter(a -> 
a.contains(TOKEN_MAX_LIFETIME_POSTFIX)).map(a -> a.substring(0, 
a.indexOf(TOKEN_MAX_LIFETIME_POSTFIX)))
-          .collect(Collectors.toList());
+      List<String> allAliases = 
aliasService.getAliasesForCluster(AliasService.NO_CLUSTER_NAME);
+
+      // Filter for the token state aliases, and extract the token ID
+      tokenIds = allAliases.stream()
+                           .filter(a -> a.contains(TOKEN_MAX_LIFETIME_POSTFIX))
+                           .map(a -> a.substring(0, 
a.indexOf(TOKEN_MAX_LIFETIME_POSTFIX)))
+                           .collect(Collectors.toList());
     } catch (AliasServiceException e) {
-      log.errorEvictingTokens(e);
+      e.printStackTrace(); // TODO: PJZ: Logging

Review comment:
       This is an oversight. Thanks for catching it.




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


Reply via email to