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



##########
File path: 
gateway-provider-security-jwt/src/main/java/org/apache/knox/gateway/provider/federation/jwt/filter/AbstractJWTFilter.java
##########
@@ -120,6 +126,29 @@ public void init( FilterConfig filterConfig ) throws 
ServletException {
         }
       }
     }
+
+    // Setup the verified tokens cache
+    initializeVerifiedTokensCache(filterConfig);
+  }
+
+  /**
+   * Initialize the cache for token verifications records.
+   *
+   * @param config The filter configuration
+   */
+  private void initializeVerifiedTokensCache(final FilterConfig config) {
+    int maxCacheSize = JWT_VERIFIED_CACHE_MAX_DEFAULT;
+
+    String configValue = config.getInitParameter(JWT_VERIFIED_CACHE_MAX);
+    if (configValue != null && !configValue.isEmpty()) {
+      try {
+        maxCacheSize = Integer.parseInt(configValue);
+      } catch (NumberFormatException e) {
+        //

Review comment:
       Log an error (or at least a warning indicating the wrong configuration)?




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