You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2020/04/14 15:34:42 UTC
[cxf] 04/06: Removing persistence configuration from the TokenStore,
where it's not required
This is an automated email from the ASF dual-hosted git repository.
coheigea pushed a commit to branch CXF-7594
in repository https://gitbox.apache.org/repos/asf/cxf.git
commit c4be478f8c9d49ad76a1f71c1d996d101f41b8e0
Author: Colm O hEigeartaigh <co...@apache.org>
AuthorDate: Fri Apr 10 12:40:32 2020 +0100
Removing persistence configuration from the TokenStore, where it's not required
---
.../org/apache/cxf/ws/security/tokenstore/EHCacheTokenStore.java | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/tokenstore/EHCacheTokenStore.java b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/tokenstore/EHCacheTokenStore.java
index 2d95ea4..591ae8d 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/tokenstore/EHCacheTokenStore.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/tokenstore/EHCacheTokenStore.java
@@ -20,11 +20,9 @@
package org.apache.cxf.ws.security.tokenstore;
import java.io.Closeable;
-import java.io.File;
import java.net.URL;
import java.util.Collection;
import java.util.HashSet;
-import java.util.Random;
import java.util.Set;
import org.apache.cxf.Bus;
@@ -68,12 +66,7 @@ public class EHCacheTokenStore implements TokenStore, Closeable, BusLifeCycleLis
xmlConfig.newCacheConfigurationBuilderFromTemplate(template,
String.class, SecurityToken.class);
- // Note, we don't require strong random values here, as the key should already end with the
- // hashcode of the endpoint info.
- String diskKey = key + "-" + Math.abs(new Random().nextInt());
- cacheManager = CacheManagerBuilder.newCacheManagerBuilder().withCache(key, configurationBuilder)
- .with(CacheManagerBuilder.persistence(
- new File(System.getProperty("java.io.tmpdir"), diskKey))).build();
+ cacheManager = CacheManagerBuilder.newCacheManagerBuilder().withCache(key, configurationBuilder).build();
cacheManager.init();
cache = cacheManager.getCache(key, String.class, SecurityToken.class);