[java-shib-attribute] branch main updated: Allow for legacy tag names in metadata-driven config, start on tests.

Scott Cantor cantor.2 at osu.edu
Fri Mar 3 18:59:14 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-attribute.

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

The following commit(s) were added to refs/heads/main by this push:
     new 42404d5ed Allow for legacy tag names in metadata-driven config, start on tests.
42404d5ed is described below

commit 42404d5ed778940a0fc06c9e170c601b82c6de45
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Fri Mar 3 13:59:11 2023 -0500

    Allow for legacy tag names in metadata-driven config, start on tests.
---
 ...tMetadataDrivenConfigurationLookupStrategy.java | 198 +++++++++++++++++----
 .../spring/AttributeMappingNodeProcessorTest.java  |   2 +-
 ...t.java => MetadataDrivenConfigurationTest.java} | 136 +++++++-------
 .../idp/saml/attribute/impl/customBean.xml         |   2 +-
 .../idp/saml/attribute/impl/metadata.xml           |   9 +
 5 files changed, 237 insertions(+), 110 deletions(-)

diff --git a/shib-attribute-api/src/main/java/net/shibboleth/idp/attribute/config/AbstractMetadataDrivenConfigurationLookupStrategy.java b/shib-attribute-api/src/main/java/net/shibboleth/idp/attribute/config/AbstractMetadataDrivenConfigurationLookupStrategy.java
index 9ffda5620..165e7d68d 100644
--- a/shib-attribute-api/src/main/java/net/shibboleth/idp/attribute/config/AbstractMetadataDrivenConfigurationLookupStrategy.java
+++ b/shib-attribute-api/src/main/java/net/shibboleth/idp/attribute/config/AbstractMetadataDrivenConfigurationLookupStrategy.java
@@ -23,6 +23,7 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
+import java.util.Optional;
 import java.util.function.Function;
 import java.util.stream.Collectors;
 
@@ -53,6 +54,8 @@ import net.shibboleth.shared.component.AbstractInitializableComponent;
 import net.shibboleth.shared.component.ComponentInitializationException;
 import net.shibboleth.shared.logic.Constraint;
 import net.shibboleth.shared.logic.FunctionSupport;
+import net.shibboleth.shared.primitive.DeprecationSupport;
+import net.shibboleth.shared.primitive.DeprecationSupport.ObjectType;
 import net.shibboleth.shared.primitive.LoggerFactory;
 import net.shibboleth.shared.primitive.StringSupport;
 
@@ -94,12 +97,18 @@ public abstract class AbstractMetadataDrivenConfigurationLookupStrategy<T> exten
     /** Prevents prefixing of property name by profile/aliases. */
     private boolean explicitPropertyName;
     
-    /** Base name of property to produce. */
+    /** Base name of property to check for. */
     @NonnullAfterInit @NotEmpty private String propertyName;
-    
-    /** Alternative "full" property identifiers to support. */
+
+    /** Legacy name of property to check for (will warn). */
+    @Nullable @NotEmpty private String legacyPropertyName;
+
+    /** The "full" property identifiers to support. */
     @NonnullAfterInit @NonnullElements private Collection<String> propertyAliases;
-    
+
+    /** Legacy "full" property identifiers to support. */
+    @Nullable @NonnullElements private Collection<String> legacyPropertyAliases;
+
     /** Default to return in the absence of a property. */
     @Nonnull private Function<BaseContext,T> defaultValueStrategy;
     
@@ -186,11 +195,24 @@ public abstract class AbstractMetadataDrivenConfigurationLookupStrategy<T> exten
         propertyName = Constraint.isNotNull(StringSupport.trimOrNull(name), "Property name cannot be null or empty");
     }
     
+    /**
+     * Sets a legacy "base" name of the property/setting to derive.
+     * 
+     * <p>Use of this name will trigger a deprecation warning.</p>
+     * 
+     * @param name base property name
+     */
+    public void setLegacyPropertyName(@Nullable @NotEmpty final String name) {
+        checkSetterPreconditions();
+        
+        legacyPropertyName = StringSupport.trimOrNull(name);
+    }
+
     /**
      * Sets profile ID aliases to include when checking for metadata tags (the property name is suffixed to the
      * aliases).
      * 
-     * <p>This allows alternative tag names to be checked.</p>
+     * <p>This allows alternatively-prefixed tag names to be checked.</p>
      * 
      * @param aliases alternative profile IDs
      */
@@ -274,6 +296,13 @@ public abstract class AbstractMetadataDrivenConfigurationLookupStrategy<T> exten
             propertyAliases = Collections.emptyList();
         }
         
+        if (legacyPropertyName != null) {
+            final Collection<String> aliases = List.copyOf(propertyAliases);
+            legacyPropertyAliases = aliases.stream()
+                    .map(s -> s + (s.endsWith("/") ? legacyPropertyName : '/' + legacyPropertyName))
+                    .collect(Collectors.toUnmodifiableList());
+        }
+        
         // Now attach the property name to the end of the alias list entries.
         propertyAliases = propertyAliases.stream()
                 .map(s -> s + (s.endsWith("/") ? propertyName : '/' + propertyName))
@@ -281,7 +310,7 @@ public abstract class AbstractMetadataDrivenConfigurationLookupStrategy<T> exten
         
     }
 
-    // Checkstyle: CyclomaticComplexity|MethodLength OFF    
+    // Checkstyle: CyclomaticComplexity|MethodLength|ReturnCount OFF    
     /** {@inheritDoc} */
     @Nullable public T apply(@Nullable final BaseContext input) {
         checkComponentActive();
@@ -326,30 +355,61 @@ public abstract class AbstractMetadataDrivenConfigurationLookupStrategy<T> exten
             profileId = null;
         }
         
+        // This is a huge mess, but trying to "unroll" it into sub-methods ends up as bad or worse
+        // because it's just inherently messy. The best split would probably be to separate the mapped
+        // tag and native tag support.
+        
         // Look for "primary" tag name based on profile/property using mapped tags.
         IdPAttribute idpAttribute = findMatchingMappedTag(entity,
                 profileId != null ? profileId + '/' + propertyName : propertyName);
-        if (idpAttribute != null && !idpAttribute.getValues().isEmpty()) {
-            log.debug("Found matching tag '{}' for property '{}'", idpAttribute.getId(), propertyName);
-            final T result = translate(idpAttribute);
-            if (enableCaching) {
-                assert cacheContext != null;
-                cacheContext.getPropertyMap().put(propertyName, result);
-            }
-            return result;
+        Optional<T> result = processMappedTag(idpAttribute, cacheContext);
+        if (result != null) {
+            assert idpAttribute != null;
+            log.debug("Found matching mapped tag '{}' for property '{}'", idpAttribute.getId(), propertyName);
+            return result.orElse(null);
         }
         
         // Check aliases.
         for (final String alias : propertyAliases) {
+            assert alias != null;
             idpAttribute = findMatchingMappedTag(entity, alias);
-            if (idpAttribute != null && !idpAttribute.getValues().isEmpty()) {
-                log.debug("Found matching tag '{}' for property '{}'", idpAttribute.getId(), propertyName);
-                final T result = translate(idpAttribute);
-                if (enableCaching) {
-                    assert cacheContext != null;
-                    cacheContext.getPropertyMap().put(propertyName, result);
+            result = processMappedTag(idpAttribute, cacheContext);
+            if (result != null) {
+                assert idpAttribute != null;
+                log.debug("Found matching mapped tag '{}' for property '{}'", idpAttribute.getId(), propertyName);
+                return result.orElse(null);
+            }
+        }
+        
+        if (legacyPropertyName != null) {
+            
+            final String legacy = legacyPropertyName;
+            
+            // Check legacy property name,
+            idpAttribute = findMatchingMappedTag(entity, profileId != null ? profileId + '/' + legacy : legacy);
+            result = processMappedTag(idpAttribute, cacheContext);
+            if (result != null) {
+                assert idpAttribute != null;
+                log.debug("Found matching mapped tag '{}' for property '{}'", idpAttribute.getId(), propertyName);
+                DeprecationSupport.warnOnce(ObjectType.PROPERTY, legacy, "SAML Metadata EntityAttribute", propertyName);
+                return result.orElse(null);
+            }
+
+            // Check legacy aliases.
+            if (legacyPropertyAliases != null) {
+                for (final String alias : legacyPropertyAliases) {
+                    assert alias != null;
+                    idpAttribute = findMatchingMappedTag(entity, alias);
+                    result = processMappedTag(idpAttribute, cacheContext);
+                    if (result != null) {
+                        assert idpAttribute != null;
+                        log.debug("Found matching mapped tag '{}' for property '{}'", idpAttribute.getId(),
+                                propertyName);
+                        DeprecationSupport.warnOnce(ObjectType.PROPERTY, legacy, "SAML Metadata EntityAttribute",
+                                propertyName);
+                        return result.orElse(null);
+                    }
                 }
-                return result;
             }
         }
         
@@ -366,27 +426,52 @@ public abstract class AbstractMetadataDrivenConfigurationLookupStrategy<T> exten
         // Look for "primary" tag name based on profile/property.
         Attribute attribute = findMatchingTag(entity,
                 profileId != null ? profileId + '/' + propertyName : propertyName);
-        if (attribute != null) {
+        result = processTag(attribute, cacheContext);
+        if (result != null) {
+            assert attribute != null;
             log.debug("Found matching tag '{}' for property '{}'", attribute.getName(), propertyName);
-            final T result = translate(attribute);
-            if (enableCaching) {
-                assert cacheContext != null;
-                cacheContext.getPropertyMap().put(propertyName, result);
-            }
-            return result;
+            return result.orElse(null);
         }
         
         // Check aliases.
         for (final String alias : propertyAliases) {
             attribute = findMatchingTag(entity, alias);
-            if (attribute != null) {
+            result = processTag(attribute, cacheContext);
+            if (result != null) {
+                assert attribute != null;
                 log.debug("Found matching tag '{}' for property '{}'", attribute.getName(), propertyName);
-                final T result = translate(attribute);
-                if (enableCaching) {
-                    assert cacheContext != null;
-                    cacheContext.getPropertyMap().put(propertyName, result);
+                return result.orElse(null);
+            }
+        }
+        
+        if (legacyPropertyName != null) {
+            
+            final String legacy = legacyPropertyName;
+
+            // Check legacy property name,
+            attribute = findMatchingTag(entity, profileId != null ? profileId + '/' + legacy : legacy);
+            result = processTag(attribute, cacheContext);
+            if (result != null) {
+                assert attribute != null;
+                log.debug("Found matching tag '{}' for property '{}'", attribute.getName(), propertyName);
+                DeprecationSupport.warnOnce(ObjectType.PROPERTY, legacy, "SAML Metadata EntityAttribute", propertyName);
+                return result.orElse(null);
+            }
+
+            // Check legacy aliases.
+            if (legacyPropertyAliases != null) {
+                for (final String alias : legacyPropertyAliases) {
+                    assert alias != null;
+                    attribute = findMatchingTag(entity, alias);
+                    result = processMappedTag(idpAttribute, cacheContext);
+                    if (result != null) {
+                        assert attribute != null;
+                        log.debug("Found matching tag '{}' for property '{}'", attribute.getName(), propertyName);
+                        DeprecationSupport.warnOnce(ObjectType.PROPERTY, legacy, "SAML Metadata EntityAttribute",
+                                propertyName);
+                        return result.orElse(null);
+                    }
                 }
-                return result;
             }
         }
         
@@ -398,7 +483,7 @@ public abstract class AbstractMetadataDrivenConfigurationLookupStrategy<T> exten
         }
         return ret;
     }
-// Checkstyle: CyclomaticComplexity|MethodLength ON
+// Checkstyle: CyclomaticComplexity|MethodLength|ReturnCount ON
     
     /**
      * Translate the value(s) into a setting of the appropriate type.
@@ -451,6 +536,49 @@ public abstract class AbstractMetadataDrivenConfigurationLookupStrategy<T> exten
      */
     @Nullable protected abstract T doTranslate(@Nonnull final IdPAttribute tag); 
     
+    
+    /**
+     * Process a mapped tag by returning any value found and caching if necessary.
+     * 
+     * @param tag the mapped tag object
+     * @param cacheContext cache context
+     * 
+     * @return a possibly empty {@link Optional} containing the value if any, or null
+     */
+    @Nullable private Optional<T> processMappedTag(@Nullable final IdPAttribute tag,
+            @Nullable final CachedConfigurationContext cacheContext) {
+        if (tag != null && !tag.getValues().isEmpty()) {
+            final T result = translate(tag);
+            if (cacheContext != null) {
+                cacheContext.getPropertyMap().put(propertyName, result);
+            }
+            return Optional.ofNullable(result);
+        }
+        
+        return null;
+    }
+    
+    /**
+     * Process a tag by returning any value found and caching if necessary.
+     * 
+     * @param tag the tag object
+     * @param cacheContext cache context
+     * 
+     * @return a possibly empty {@link Optional} containing the value if any, or null
+     */
+    @Nullable private Optional<T> processTag(@Nullable final Attribute tag,
+            @Nullable final CachedConfigurationContext cacheContext) {
+        if (tag != null) {
+            final T result = translate(tag);
+            if (cacheContext != null) {
+                cacheContext.getPropertyMap().put(propertyName, result);
+            }
+            return Optional.ofNullable(result);
+        }
+        
+        return null;
+    }
+    
     /**
      * Find first matching attribute in the input object's node metadata.
      * 
diff --git a/shib-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/AttributeMappingNodeProcessorTest.java b/shib-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/AttributeMappingNodeProcessorTest.java
index 1f7a2fd1e..a6e2a64ca 100644
--- a/shib-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/AttributeMappingNodeProcessorTest.java
+++ b/shib-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/AttributeMappingNodeProcessorTest.java
@@ -120,7 +120,7 @@ public class AttributeMappingNodeProcessorTest extends XMLObjectBaseTestCase {
         final Multimap<String, IdPAttribute> map = container.get();
         assert map != null;
 
-        assertEquals(map.size(), 1);
+        assertFalse(map.isEmpty());
         Collection<IdPAttribute> attribute = map.get("http://macedir.org/entity-category");
         assertEquals(attribute.size(), 1);
 
diff --git a/shib-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/AttributeMappingNodeProcessorTest.java b/shib-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/MetadataDrivenConfigurationTest.java
similarity index 51%
copy from shib-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/AttributeMappingNodeProcessorTest.java
copy to shib-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/MetadataDrivenConfigurationTest.java
index 1f7a2fd1e..b19a2faeb 100644
--- a/shib-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/AttributeMappingNodeProcessorTest.java
+++ b/shib-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/MetadataDrivenConfigurationTest.java
@@ -20,48 +20,51 @@ package net.shibboleth.idp.attribute.resolver.spring;
 import static org.testng.Assert.*;
 
 import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
 import java.util.HashSet;
 
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
 
 import org.opensaml.core.testing.XMLObjectBaseTestCase;
+import org.opensaml.profile.context.ProfileRequestContext;
+import org.opensaml.profile.testing.RequestContextBuilder;
 import org.opensaml.saml.metadata.resolver.filter.FilterException;
-import org.opensaml.saml.saml2.metadata.AttributeConsumingService;
 import org.opensaml.saml.saml2.metadata.EntityDescriptor;
 import org.springframework.context.support.ConversionServiceFactoryBean;
 import org.springframework.context.support.GenericApplicationContext;
+import org.testng.Assert;
 import org.testng.annotations.AfterClass;
+import org.testng.annotations.AfterMethod;
 import org.testng.annotations.BeforeClass;
+import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
-import com.google.common.collect.Multimap;
-
-import net.shibboleth.idp.attribute.AttributesMapContainer;
-import net.shibboleth.idp.attribute.IdPAttribute;
-import net.shibboleth.idp.attribute.IdPRequestedAttribute;
-import net.shibboleth.idp.attribute.StringAttributeValue;
+import net.shibboleth.idp.attribute.config.BooleanConfigurationLookupStrategy;
+import net.shibboleth.idp.attribute.config.StringConfigurationLookupStrategy;
 import net.shibboleth.idp.attribute.transcoding.AttributeTranscoderRegistry;
 import net.shibboleth.idp.saml.attribute.impl.AttributeMappingNodeProcessor;
+import net.shibboleth.shared.collection.CollectionSupport;
+import net.shibboleth.shared.component.ComponentInitializationException;
+import net.shibboleth.shared.logic.FunctionSupport;
 import net.shibboleth.shared.service.ReloadableService;
 import net.shibboleth.shared.spring.config.StringToDurationConverter;
 import net.shibboleth.shared.spring.custom.SchemaTypeAwareXMLBeanDefinitionReader;
 
 /**
- * Test for {@link AttributeMappingNodeProcessor}.
+ * Tests for the metadata-driven config classes in shib-attribute-api.
  */
 @SuppressWarnings("javadoc")
-public class AttributeMappingNodeProcessorTest extends XMLObjectBaseTestCase {
-
-    @Nullable private EntityDescriptor entityDescriptor;
+public class MetadataDrivenConfigurationTest extends XMLObjectBaseTestCase {
 
-    @Nullable private ReloadableService<AttributeTranscoderRegistry> service;
+    private EntityDescriptor entityDescriptor;
 
-    @Nullable private AttributeMappingNodeProcessor processor;
+    private ReloadableService<AttributeTranscoderRegistry> service;
 
-    @Nullable private GenericApplicationContext pendingTeardownContext;
+    private AttributeMappingNodeProcessor processor;
+    
+    private GenericApplicationContext pendingTeardownContext;
+    
+    private ProfileRequestContext prc;
     
     @AfterClass public void tearDownTestContext() {
         if (null != pendingTeardownContext ) {
@@ -75,13 +78,22 @@ public class AttributeMappingNodeProcessorTest extends XMLObjectBaseTestCase {
         pendingTeardownContext = context;
     }
 
-    @BeforeClass public void setup() {
-        entityDescriptor = unmarshallElement("/net/shibboleth/idp/saml/attribute/impl/metadata.xml");
-        assertNotNull(entityDescriptor);
+    @BeforeClass public void globalSetup() {
         service = getService();
         assert service != null;
         processor = new AttributeMappingNodeProcessor(service);
     }
+    
+    @BeforeMethod public void testSetup() {
+        entityDescriptor = unmarshallElement("/net/shibboleth/idp/saml/attribute/impl/metadata.xml");
+        assertNotNull(entityDescriptor);
+        prc = new RequestContextBuilder().buildProfileRequestContext();
+    }
+    
+    @AfterMethod public void testTearDown() {
+        entityDescriptor = null;
+        prc = null;
+    }
 
     @Nonnull private ReloadableService<AttributeTranscoderRegistry> getService() {
         final GenericApplicationContext context = new GenericApplicationContext();
@@ -105,69 +117,47 @@ public class AttributeMappingNodeProcessorTest extends XMLObjectBaseTestCase {
         return context.getBean(ReloadableService.class);
     }
 
-    // Tests use of default mapping behavior for URI-named, string-valued tags.
-    @Test public void entityAttributes() throws FilterException {
-        assert entityDescriptor != null;
-        assertTrue(entityDescriptor.getObjectMetadata().get(AttributesMapContainer.class).isEmpty());
+    @Test public void testBooleanProfileTag() throws ComponentInitializationException, FilterException {
 
-        assert processor != null;
-        processor.process(entityDescriptor);
-
-        assert entityDescriptor != null;
-        final AttributesMapContainer container =
-                entityDescriptor.getObjectMetadata().get(AttributesMapContainer.class).get(0);
-
-        final Multimap<String, IdPAttribute> map = container.get();
-        assert map != null;
+        final BooleanConfigurationLookupStrategy fn = new BooleanConfigurationLookupStrategy();
+        fn.setProfileMetadataLookupStrategy(FunctionSupport.constant(entityDescriptor));
+        fn.setMessageMetadataLookupStrategy(FunctionSupport.constant(entityDescriptor));
+        fn.setPropertyName("encryptAssertions");
+        fn.setEnableCaching(false);
+        fn.initialize();
+        
+        prc.setProfileId("http://shibboleth.net/ns/profiles/saml2/sso/browser");
 
-        assertEquals(map.size(), 1);
-        Collection<IdPAttribute> attribute = map.get("http://macedir.org/entity-category");
-        assertEquals(attribute.size(), 1);
+        // Unmapped.
+        Assert.assertEquals(fn.apply(prc), true);
 
-        IdPAttribute attr = attribute.iterator().next();
-        assertEquals(attr.getValues().size(), 1);
-        StringAttributeValue sav = (StringAttributeValue) attr.getValues().iterator().next();
+        assert processor != null;
+        processor.process(entityDescriptor);
 
-        assertEquals(sav.getValue(), "http://id.incommon.org/category/research-and-scholarship");
-        
-        assertEquals(container.getStringValues("http://macedir.org/entity-category"),
-                Collections.singletonList("http://id.incommon.org/category/research-and-scholarship"));
+        // Mapped.
+        Assert.assertEquals(fn.apply(prc), true);
     }
 
-    @Test public void requiredAttributes() throws FilterException {
+    @Test public void testBooleanGlobalTag() throws ComponentInitializationException, FilterException {
 
-        assert entityDescriptor != null;
-        final AttributeConsumingService acs =
-                entityDescriptor.getSPSSODescriptor("urn:oasis:names:tc:SAML:1.1:protocol")
-                        .getDefaultAttributeConsumingService();
+        final BooleanConfigurationLookupStrategy fn = new BooleanConfigurationLookupStrategy();
+        fn.setProfileMetadataLookupStrategy(FunctionSupport.constant(entityDescriptor));
+        fn.setMessageMetadataLookupStrategy(FunctionSupport.constant(entityDescriptor));
+        fn.setPropertyName("encryptAssertions");
+        fn.setEnableCaching(false);
+        fn.setProfileAliases(CollectionSupport.singletonList("http://shibboleth.net/ns/profiles"));
+        fn.initialize();
+        
+        prc.setProfileId("foo");
 
-        assertTrue(acs.getObjectMetadata().get(AttributesMapContainer.class).isEmpty());
+        // Unmapped.
+        Assert.assertEquals(fn.apply(prc), true);
 
         assert processor != null;
-        processor.process(acs);
-
-        final AttributesMapContainer container = acs.getObjectMetadata().get(AttributesMapContainer.class).get(0);
-
-        final Multimap<String,IdPAttribute> map = container.get();
-        assert map != null;
-        assertEquals(map.size(), 3);
-
-        Collection<IdPAttribute> attribute = map.get("dn1");
-        assertEquals(attribute.size(), 1);
-        IdPRequestedAttribute attr = IdPRequestedAttribute.class.cast(attribute.iterator().next());
-        assertTrue(attr.getValues().isEmpty());
-        assertFalse(attr.isRequired());
+        processor.process(entityDescriptor);
 
-        attribute = map.get("dn2");
-        assertEquals(attribute.size(), 1);
-        attr = IdPRequestedAttribute.class.cast(attribute.iterator().next());
-        assertTrue(attr.getValues().isEmpty());
-        assertTrue(attr.isRequired());
-        
-        attribute = map.get("eppn");
-        assertEquals(attribute.size(), 1);
-        attr = IdPRequestedAttribute.class.cast(attribute.iterator().next());
-        assertTrue(attr.getValues().isEmpty());
-        assertFalse(attr.isRequired());
+        // Mapped.
+        Assert.assertEquals(fn.apply(prc), true);
     }
-}
+
+}
\ No newline at end of file
diff --git a/shib-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/saml/attribute/impl/customBean.xml b/shib-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/saml/attribute/impl/customBean.xml
index 247e20bbb..0c35475de 100644
--- a/shib-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/saml/attribute/impl/customBean.xml
+++ b/shib-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/saml/attribute/impl/customBean.xml
@@ -20,7 +20,7 @@
     </util:map>
     
     <bean id="shibboleth.Predicate" destroy-method=""
-        class="com.google.common.base.Predicates" factory-method="alwaysFalse"/>
+        class="net.shibboleth.shared.logic.PredicateSupport" factory-method="alwaysFalse"/>
     
     <bean id="shibboleth.PropertySourcesPlaceholderConfigurer" destroy-method=""
         class="org.springframework.context.support.PropertySourcesPlaceholderConfigurer"
diff --git a/shib-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/saml/attribute/impl/metadata.xml b/shib-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/saml/attribute/impl/metadata.xml
index b94e1651f..65a6788d4 100644
--- a/shib-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/saml/attribute/impl/metadata.xml
+++ b/shib-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/saml/attribute/impl/metadata.xml
@@ -7,6 +7,15 @@
 				<saml:AttributeValue>http://id.incommon.org/category/research-and-scholarship
 				</saml:AttributeValue>
 			</saml:Attribute>
+            <!-- For testing metadata driven config, -->
+            <saml:Attribute Name="http://shibboleth.net/ns/profiles/saml2/sso/browser/encryptAssertions"
+                NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
+                <saml:AttributeValue>true</saml:AttributeValue>
+            </saml:Attribute>
+            <saml:Attribute Name="http://shibboleth.net/ns/profiles/encryptAssertions"
+                NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
+                <saml:AttributeValue>true</saml:AttributeValue>
+            </saml:Attribute>
 		</mdattr:EntityAttributes>
 	</Extensions>
 	<SPSSODescriptor

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


More information about the commits mailing list