smolnar82 commented on a change in pull request #213: KNOX-2136 - Caching 
credentials in DefaultKeystoreService when an alias is being added (instead of 
the first time someone fetches) and using a different cache implementation
URL: https://github.com/apache/knox/pull/213#discussion_r357247842
 
 

 ##########
 File path: 
gateway-server/src/main/java/org/apache/knox/gateway/services/security/impl/DefaultKeystoreService.java
 ##########
 @@ -71,8 +74,9 @@
   private static GatewayMessages LOG = 
MessagesFactory.get(GatewayMessages.class);
   private static GatewayResources RES = 
ResourcesFactory.get(GatewayResources.class);
 
+  //let's configure the cache with hard-coded attributes now; we can introduce 
new gateway configuration later on if needed
+  private final Cache<String, Map<String, String>> cache = 
Caffeine.newBuilder().expireAfterWrite(10, 
TimeUnit.MINUTES).maximumSize(1000).build();
 
 Review comment:
   So the following should be implemented:
   
   1. add an entry: into keystore and cache
   2. 10 minutes passed w/o reading that entry -> got evicted from cache
   3. fetch it -> we load it from the keystore but not adding into the cache
   
   The least should be changed to add it back to the cache, right?

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