[java-shib-profile] branch main updated: OSJ-382 - Support for legacy class transitions in getSubcontext(String)

Scott Cantor cantor.2 at osu.edu
Thu Jun 1 21:15:19 UTC 2023


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

scantor pushed a commit to branch main
in repository java-shib-profile.

View the commit online:
http://git.shibboleth.net/view/?p=java-shib-profile.git;a=commit;h=a83b563ec4c9680d462510b2e764cba0f90a1af7

The following commit(s) were added to refs/heads/main by this push:
     new a83b563  OSJ-382 - Support for legacy class transitions in getSubcontext(String)
a83b563 is described below

commit a83b563ec4c9680d462510b2e764cba0f90a1af7
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Thu Jun 1 17:15:16 2023 -0400

    OSJ-382 - Support for legacy class transitions in getSubcontext(String)
    
    https://shibboleth.atlassian.net/browse/OSJ-382
    
    Register context class look aside map if injected into config bean.
---
 .../profile/spring/impl/OpenSAMLConfigBean.java    | 28 ++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/shib-profile-impl/src/main/java/net/shibboleth/profile/spring/impl/OpenSAMLConfigBean.java b/shib-profile-impl/src/main/java/net/shibboleth/profile/spring/impl/OpenSAMLConfigBean.java
index 0bb77cb..cdef90f 100644
--- a/shib-profile-impl/src/main/java/net/shibboleth/profile/spring/impl/OpenSAMLConfigBean.java
+++ b/shib-profile-impl/src/main/java/net/shibboleth/profile/spring/impl/OpenSAMLConfigBean.java
@@ -17,6 +17,8 @@
 
 package net.shibboleth.profile.spring.impl;
 
+import java.util.Map;
+
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
 
@@ -24,11 +26,13 @@ import org.opensaml.core.config.ConfigurationService;
 import org.opensaml.core.config.InitializationException;
 import org.opensaml.core.config.InitializationService;
 import org.opensaml.core.xml.config.XMLObjectProviderRegistry;
+import org.opensaml.messaging.context.BaseContext;
 import org.opensaml.xmlsec.config.DecryptionParserPool;
 import org.slf4j.Logger;
 
 import com.codahale.metrics.MetricRegistry;
 
+import net.shibboleth.shared.collection.CollectionSupport;
 import net.shibboleth.shared.component.AbstractInitializableComponent;
 import net.shibboleth.shared.component.ComponentInitializationException;
 import net.shibboleth.shared.primitive.LoggerFactory;
@@ -52,6 +56,9 @@ public class OpenSAMLConfigBean extends AbstractInitializableComponent {
     /** Optional {@link MetricRegistry} to configure. */
     @Nullable private MetricRegistry metricRegistry;
     
+    /** Optional map of renamed classes for string-based context navigation. */
+    @Nullable private Map<String,Class<? extends BaseContext>> contextLookAsideMap;
+    
     /**
      * Get the global {@link ParserPool} to configure.
      * 
@@ -112,6 +119,22 @@ public class OpenSAMLConfigBean extends AbstractInitializableComponent {
         metricRegistry = registry;
     }
     
+    /**
+     * Set the global map of relocated context classes.
+     * 
+     * @param map map of relocated context classes
+     * 
+     * @since 5.0.0
+     */
+    public void setContextLookAsideMap(@Nullable final Map<String,Class<? extends BaseContext>> map) {
+        checkSetterPreconditions();
+        if (map != null) {
+            contextLookAsideMap = CollectionSupport.copyToMap(map);
+        } else {
+            contextLookAsideMap = null;
+        }
+    }
+    
     /** {@inheritDoc} */
     protected void doInitialize() throws ComponentInitializationException {
 
@@ -143,6 +166,11 @@ public class OpenSAMLConfigBean extends AbstractInitializableComponent {
         if (decryptionParserPool != null) {
             ConfigurationService.register(DecryptionParserPool.class, new DecryptionParserPool(decryptionParserPool));
         }
+        
+        if (contextLookAsideMap != null) {
+            ConfigurationService.register(BaseContext.DeprecatedContextClassNameLookAside.class,
+                    new BaseContext.DeprecatedContextClassNameLookAside(contextLookAsideMap));
+        }
     }
     
 }
\ No newline at end of file

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


More information about the commits mailing list