[java-identity-provider] branch main updated: OSJ-358 - Turn Revocation/ReplayCache into interfaces/implementations

Scott Cantor cantor.2 at osu.edu
Fri Aug 5 18:50:21 UTC 2022


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch main
in repository java-identity-provider.

View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=81be7b8d561f30d371fb2ee3ea4df64efa6076d7

The following commit(s) were added to refs/heads/main by this push:
     new 81be7b8d5 OSJ-358 - Turn Revocation/ReplayCache into interfaces/implementations
81be7b8d5 is described below

commit 81be7b8d561f30d371fb2ee3ea4df64efa6076d7
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Fri Aug 5 14:50:18 2022 -0400

    OSJ-358 - Turn Revocation/ReplayCache into interfaces/implementations
    
    https://shibboleth.atlassian.net/browse/OSJ-358
---
 .../idp/authn/revocation/impl/DoRevocationCacheOperation.java | 11 +++++++----
 .../authn/revocation/impl/RevocationCacheConditionTest.java   |  6 +++---
 .../main/resources/net/shibboleth/idp/conf/authn-system.xml   |  2 +-
 .../main/resources/net/shibboleth/idp/conf/global-system.xml  |  2 +-
 4 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/revocation/impl/DoRevocationCacheOperation.java b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/revocation/impl/DoRevocationCacheOperation.java
index 90b674932..cc173fa74 100644
--- a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/revocation/impl/DoRevocationCacheOperation.java
+++ b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/revocation/impl/DoRevocationCacheOperation.java
@@ -86,6 +86,9 @@ public class DoRevocationCacheOperation extends AbstractProfileAction {
     /** JSON object mapper. */
     @NonnullAfterInit private ObjectMapper objectMapper;
 
+    /** Revocation Cache ID. */
+    @Nullable @NotEmpty private String cacheId;
+    
     /** Revocation context to operate on. */
     @Nullable @NotEmpty private String context;
     
@@ -148,18 +151,18 @@ public class DoRevocationCacheOperation extends AbstractProfileAction {
             }
             
             
-            final String id = getParameter(requestContext, CACHE_ID);
+            cacheId = getParameter(requestContext, CACHE_ID);
             context = getParameter(requestContext, CONTEXT);
             key = getParameter(requestContext, KEY);
             
-            if (Strings.isNullOrEmpty(id) || Strings.isNullOrEmpty(context) || Strings.isNullOrEmpty(key)) {
+            if (Strings.isNullOrEmpty(cacheId) || Strings.isNullOrEmpty(context) || Strings.isNullOrEmpty(key)) {
                 sendError(HttpServletResponse.SC_NOT_FOUND,
                         "Missing revocation cache ID, context, or key",
                         "No revocation cache ID, context, key specified.");
                 return false;
             }
 
-            revocationCache = getBean(requestContext, id, RevocationCache.class);
+            revocationCache = getBean(requestContext, cacheId, RevocationCache.class);
             if (revocationCache == null) {
                 sendError(HttpServletResponse.SC_NOT_FOUND,
                         "Invalid Revocation Cache", "Invalid revocation cache identifier in path.");
@@ -222,7 +225,7 @@ public class DoRevocationCacheOperation extends AbstractProfileAction {
                     g.writeStartObject();
                     g.writeObjectFieldStart("data");
                     g.writeStringField("type", "revocation-records");
-                    g.writeStringField("id", revocationCache.getId() + '/' + context + '/' + key);
+                    g.writeStringField("id", cacheId + '/' + context + '/' + key);
                     g.writeObjectFieldStart("attributes");
                     g.writeStringField("revocation", revocation);
                 }
diff --git a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/revocation/impl/RevocationCacheConditionTest.java b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/revocation/impl/RevocationCacheConditionTest.java
index f0eec367e..8149c9faf 100644
--- a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/revocation/impl/RevocationCacheConditionTest.java
+++ b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/revocation/impl/RevocationCacheConditionTest.java
@@ -29,8 +29,8 @@ import net.shibboleth.idp.authn.impl.testing.BaseAuthenticationContextTest;
 import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
 import net.shibboleth.utilities.java.support.logic.FunctionSupport;
 
-import org.opensaml.storage.RevocationCache;
 import org.opensaml.storage.impl.MemoryStorageService;
+import org.opensaml.storage.impl.StorageServiceRevocationCache;
 import org.testng.Assert;
 import org.testng.annotations.AfterMethod;
 import org.testng.annotations.BeforeMethod;
@@ -40,7 +40,7 @@ import org.testng.annotations.Test;
 public class RevocationCacheConditionTest extends BaseAuthenticationContextTest {
     
     private MemoryStorageService storageService;
-    private RevocationCache revocationCache;
+    private StorageServiceRevocationCache revocationCache;
     private RevocationCacheCondition condition; 
 
     @BeforeMethod
@@ -52,7 +52,7 @@ public class RevocationCacheConditionTest extends BaseAuthenticationContextTest
         storageService.setCleanupInterval(Duration.ZERO);
         storageService.initialize();
         
-        revocationCache = new RevocationCache();
+        revocationCache = new StorageServiceRevocationCache();
         revocationCache.setStorage(storageService);
         revocationCache.setId("test");
         revocationCache.initialize();
diff --git a/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/authn-system.xml b/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/authn-system.xml
index 8746328d7..c2c4e3dbe 100644
--- a/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/authn-system.xml
+++ b/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/authn-system.xml
@@ -550,7 +550,7 @@
         c:g-ref="shibboleth.PrincipalNameLookup.Session"
         c:f-ref="shibboleth.ChildLookup.SessionContext" />
     
-    <bean id="shibboleth.AuthnRevocationCache" class="org.opensaml.storage.RevocationCache" lazy-init="true"
+    <bean id="shibboleth.AuthnRevocationCache" class="org.opensaml.storage.impl.StorageServiceRevocationCache" lazy-init="true"
         p:entryExpiration="#{'%{idp.authn.revocation.lifetime:%{idp.authn.defaultLifetime:PT12H}}'}"
         p:storage-ref="#{'%{idp.authn.revocation.StorageService:shibboleth.StorageService}'.trim()}"
         p:strict="%{idp.authn.revocation.strict:false}" />
diff --git a/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/global-system.xml b/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/global-system.xml
index 3111680a5..fd283bdda 100644
--- a/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/global-system.xml
+++ b/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/global-system.xml
@@ -259,7 +259,7 @@
         </property>
     </bean>
 
-    <bean id="shibboleth.ReplayCache" class="org.opensaml.storage.ReplayCache"
+    <bean id="shibboleth.ReplayCache" class="org.opensaml.storage.impl.StorageServiceReplayCache"
         p:storage-ref="#{'%{idp.replayCache.StorageService:shibboleth.StorageService}'.trim()}"
         p:strict="%{idp.replayCache.strict:true}" />
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list