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 2020/06/09 16:00:45 UTC

[GitHub] [knox] smolnar82 commented on a change in pull request #341: KNOX-2383 - Checking token expiration in cache should not depend on the validate flag

smolnar82 commented on a change in pull request #341:
URL: https://github.com/apache/knox/pull/341#discussion_r437484510



##########
File path: gateway-server/src/main/java/org/apache/knox/gateway/services/token/impl/AliasBasedTokenStateService.java
##########
@@ -166,24 +166,21 @@ protected long getMaxLifetime(final String tokenId) {
 
   @Override
   public long getTokenExpiration(String tokenId, boolean validate) throws UnknownTokenException {
-    long expiration = 0;
-
-    if (!validate) {
-      // If validation is not required, then check the in-memory collection first
-      try {
-        expiration = super.getTokenExpiration(tokenId, validate);
-        return expiration;
-      } catch (UnknownTokenException e) {
-        // It's not in memory
-      }
+    if (validate) {

Review comment:
       Fixed.




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