[java-shib-attribute] branch main updated: Fix package sealing issue, and disable a hanging test.
Scott Cantor
cantor.2 at osu.edu
Thu Jun 30 15:34:37 UTC 2022
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=b7c39424a26ceab612b677620cd431690bebbaa1
The following commit(s) were added to refs/heads/main by this push:
new b7c39424a Fix package sealing issue, and disable a hanging test.
b7c39424a is described below
commit b7c39424a26ceab612b677620cd431690bebbaa1
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Thu Jun 30 11:34:32 2022 -0400
Fix package sealing issue, and disable a hanging test.
---
shib-attribute-api/.classpath | 1 +
shib-attribute-api/.project | 13 +
.../.settings/org.eclipse.jdt.core.prefs | 30 ++-
.../.settings/org.eclipse.wst.common.component | 6 +
.../org.eclipse.wst.common.project.facet.core.xml | 5 +
.../logic/MappedEntityAttributesPredicate.java | 299 ---------------------
.../idp/attribute/logic/package-info.java | 22 --
.../filter/spring/AttributeFilterFailFastTest.java | 5 +
.../spring}/AttributeMappingNodeProcessorTest.java | 3 +-
9 files changed, 56 insertions(+), 328 deletions(-)
diff --git a/shib-attribute-api/.classpath b/shib-attribute-api/.classpath
index 77be441ed..8c2ac107c 100644
--- a/shib-attribute-api/.classpath
+++ b/shib-attribute-api/.classpath
@@ -32,6 +32,7 @@
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
+ <attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
diff --git a/shib-attribute-api/.project b/shib-attribute-api/.project
index 23c1690d1..c0210eab0 100644
--- a/shib-attribute-api/.project
+++ b/shib-attribute-api/.project
@@ -5,6 +5,11 @@
<projects>
</projects>
<buildSpec>
+ <buildCommand>
+ <name>org.eclipse.wst.common.project.facet.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
@@ -20,11 +25,19 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.validation.validationbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
+ <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
+ <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.springframework.ide.eclipse.core.springnature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>net.sf.eclipsecs.core.CheckstyleNature</nature>
+ <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
</natures>
</projectDescription>
diff --git a/shib-attribute-api/.settings/org.eclipse.jdt.core.prefs b/shib-attribute-api/.settings/org.eclipse.jdt.core.prefs
index 7dda60bd3..5bf3eaf85 100644
--- a/shib-attribute-api/.settings/org.eclipse.jdt.core.prefs
+++ b/shib-attribute-api/.settings/org.eclipse.jdt.core.prefs
@@ -135,6 +135,7 @@ org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=17
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
@@ -142,16 +143,19 @@ org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_c
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_assignment=16
-org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16
org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=16
org.eclipse.jdt.core.formatter.alignment_for_enum_constants=16
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16
org.eclipse.jdt.core.formatter.alignment_for_method_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=16
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
@@ -214,10 +218,8 @@ org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true
org.eclipse.jdt.core.formatter.indentation.size=4
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
@@ -237,11 +239,12 @@ org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_additive_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
@@ -271,6 +274,8 @@ org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=inser
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
@@ -294,12 +299,16 @@ org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_relational_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert
org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
@@ -345,6 +354,8 @@ org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do n
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
@@ -380,8 +391,11 @@ org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not inser
org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_relational_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_shift_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=insert
org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
@@ -407,7 +421,11 @@ org.eclipse.jdt.core.formatter.tabulation.char=space
org.eclipse.jdt.core.formatter.tabulation.size=4
org.eclipse.jdt.core.formatter.use_on_off_tags=false
org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
-org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true
org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
org.eclipse.jdt.core.incompatibleJDKLevel=ignore
org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/shib-attribute-api/.settings/org.eclipse.wst.common.component b/shib-attribute-api/.settings/org.eclipse.wst.common.component
new file mode 100644
index 000000000..25c9d164e
--- /dev/null
+++ b/shib-attribute-api/.settings/org.eclipse.wst.common.component
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
+ <wb-module deploy-name="shib-attribute-api">
+ <wb-resource deploy-path="/" source-path="/src/main/java"/>
+ <wb-resource deploy-path="/" source-path="/src/main/resources"/>
+ </wb-module>
+</project-modules>
diff --git a/shib-attribute-api/.settings/org.eclipse.wst.common.project.facet.core.xml b/shib-attribute-api/.settings/org.eclipse.wst.common.project.facet.core.xml
new file mode 100644
index 000000000..9ba61b70c
--- /dev/null
+++ b/shib-attribute-api/.settings/org.eclipse.wst.common.project.facet.core.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faceted-project>
+ <installed facet="java" version="17"/>
+ <installed facet="jst.utility" version="1.0"/>
+</faceted-project>
diff --git a/shib-attribute-api/src/main/java/net/shibboleth/idp/attribute/logic/MappedEntityAttributesPredicate.java b/shib-attribute-api/src/main/java/net/shibboleth/idp/attribute/logic/MappedEntityAttributesPredicate.java
deleted file mode 100644
index b45c36d6d..000000000
--- a/shib-attribute-api/src/main/java/net/shibboleth/idp/attribute/logic/MappedEntityAttributesPredicate.java
+++ /dev/null
@@ -1,299 +0,0 @@
-/*
- * Licensed to the University Corporation for Advanced Internet Development,
- * Inc. (UCAID) under one or more contributor license agreements. See the
- * NOTICE file distributed with this work for additional information regarding
- * copyright ownership. The UCAID licenses this file to You under the Apache
- * License, Version 2.0 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package net.shibboleth.idp.attribute.logic;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.regex.Pattern;
-
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
-import org.opensaml.core.xml.XMLObject;
-import org.opensaml.saml.common.profile.logic.EntityAttributesPredicate;
-import org.opensaml.saml.common.profile.logic.EntityAttributesPredicate.Candidate;
-import org.opensaml.saml.saml2.metadata.EntitiesDescriptor;
-import org.opensaml.saml.saml2.metadata.EntityDescriptor;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Multimap;
-
-import net.shibboleth.idp.attribute.AttributesMapContainer;
-import net.shibboleth.idp.attribute.EmptyAttributeValue;
-import net.shibboleth.idp.attribute.EmptyAttributeValue.EmptyType;
-import net.shibboleth.idp.attribute.IdPAttribute;
-import net.shibboleth.idp.attribute.IdPAttributeValue;
-import net.shibboleth.idp.attribute.ScopedStringAttributeValue;
-import net.shibboleth.idp.attribute.StringAttributeValue;
-import net.shibboleth.utilities.java.support.annotation.ParameterName;
-import net.shibboleth.utilities.java.support.annotation.constraint.NonnullElements;
-import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
-import net.shibboleth.utilities.java.support.logic.Constraint;
-import net.shibboleth.utilities.java.support.logic.Predicate;
-import net.shibboleth.utilities.java.support.primitive.StringSupport;
-
-/**
- * Extended version of EntityAttributes-driven predicate that uses an optimization to check
- * for mapped attributes in an {@link AttributesMapContainer} structure.
- */
-public class MappedEntityAttributesPredicate extends EntityAttributesPredicate {
-
- /** Class logger. */
- @Nonnull private final Logger log = LoggerFactory.getLogger(MappedEntityAttributesPredicate.class);
-
- /** Delimiter to build string form of scoped values. */
- @Nonnull @NotEmpty private String scopeDelimiter = "@";
-
- /**
- * Constructor.
- *
- * @param candidates the {@link Candidate} criteria to check for
- */
- public MappedEntityAttributesPredicate(
- @Nonnull @NonnullElements @ParameterName(name="candidates") final Collection<Candidate> candidates) {
- super(candidates);
-
- Constraint.isTrue(Iterables.all(candidates, c -> c.getNameFormat() == null),
- "Use of nameFormat property is impermissible with MappedEntityAttributesPredicate");
- }
-
- /**
- * Constructor.
- *
- * @param candidates the {@link Candidate} criteria to check for
- * @param trim true iff the values found in the metadata should be trimmed before comparison
- */
- public MappedEntityAttributesPredicate(
- @Nonnull @NonnullElements @ParameterName(name="candidates") final Collection<Candidate> candidates,
- @ParameterName(name="trim") final boolean trim) {
- super(candidates, trim);
-
- Constraint.isTrue(Iterables.all(candidates, c -> c.getNameFormat() == null),
- "Use of nameFormat property is impermissible with MappedEntityAttributesPredicate");
- }
-
- /**
- * Constructor.
- *
- * @param candidates the {@link Candidate} criteria to check for
- * @param trim true iff the values found in the metadata should be trimmed before comparison
- * @param all true iff all the criteria must match to be a successful test
- */
- public MappedEntityAttributesPredicate(
- @Nonnull @NonnullElements @ParameterName(name="candidates") final Collection<Candidate> candidates,
- @ParameterName(name="trim") final boolean trim,
- @ParameterName(name="all") final boolean all) {
- super(candidates, trim, all);
-
- Constraint.isTrue(Iterables.all(candidates, c -> c.getNameFormat() == null),
- "Use of nameFormat property is impermissible with MappedEntityAttributesPredicate");
- }
-
- /**
- * Set delimiter for constructing scoped values for comparison.
- *
- * <p>Defaults to '@'.</p>
- *
- * @param delimiter delimiter to use
- */
- public void setScopeDelimiter(@Nonnull @NotEmpty final String delimiter) {
- scopeDelimiter = Constraint.isNotNull(StringSupport.trimOrNull(delimiter),
- "Scope delimiter cannot be null or empty");
- }
-
- /** {@inheritDoc} */
- @Override
- public boolean test(@Nullable final EntityDescriptor input) {
-
- if (getCandidates().isEmpty()) {
- return true;
- } else if (input == null) {
- return false;
- }
-
- final Collection<Candidate> candidates = new ArrayList<>(getCandidates());
-
- if (doTest(input, input.getEntityID(), candidates)) {
-
- // At least one match. Check if sufficient.
- if (!getMatchAll() || candidates.isEmpty()) {
- return true;
- }
- }
-
- XMLObject parent = input.getParent();
- while (parent instanceof EntitiesDescriptor) {
- if (doTest(parent, ((EntitiesDescriptor) parent).getName(), candidates)) {
-
- // At least one match. Check if sufficient.
- if (!getMatchAll() || candidates.isEmpty()) {
- return true;
- }
- }
- parent = parent.getParent();
- }
-
- return false;
- }
-
- /**
- * Evaluate the input object's attached object metadata against the supplied candidates.
- *
- * <p>Any candidates that match will be removed from the input collection.</p>
- *
- * @param input input object
- * @param name label for logging
- * @param candidates candidates to check
- *
- * @return true iff the attached object metadata matched at least one input candidate
- */
- private boolean doTest(@Nullable final XMLObject input, @Nullable final String name,
- @Nonnull @NonnullElements final Collection<Candidate> candidates) {
- final List<AttributesMapContainer> containerList =
- input.getObjectMetadata().get(AttributesMapContainer.class);
- if (null == containerList || containerList.isEmpty() || containerList.get(0).get() == null ||
- containerList.get(0).get().isEmpty()) {
- log.trace("No mapped Entity Attributes for {}", name);
- return false;
- }
-
- final Multimap<String,? extends IdPAttribute> entityAttributes = containerList.get(0).get();
-
- log.trace("Checking for match against {} Entity Attributes for {}", entityAttributes.size(),
- name);
-
- // Remove each candidate that matches. Tag values are OR'd for matching purposes.
- // Return true iff at least one candidate matches.
- return candidates.removeIf(new EntityAttributesMatcher(entityAttributes));
- }
-
- /**
- * Determines whether an {@link Candidate} criterion is satisfied by the mapped
- * attributes in an entity's metadata.
- */
- private class EntityAttributesMatcher implements Predicate<Candidate> {
-
- /** Population to evaluate for a match. */
- @Nonnull private final Multimap<String,? extends IdPAttribute> attributes;
-
- /**
- * Constructor.
- *
- * @param attrs population to evaluate for a match
- */
- public EntityAttributesMatcher(@Nonnull @NonnullElements final Multimap<String,? extends IdPAttribute> attrs) {
- attributes = Constraint.isNotNull(attrs, "Extension attributes cannot be null");
- }
-
-// Checkstyle: CyclomaticComplexity OFF
- /** {@inheritDoc} */
- public boolean test(@Nonnull final Candidate input) {
-
- if (input.getNameFormat() != null) {
- return false;
- }
-
- final List<String> tagvals = input.getValues();
- final List<Pattern> tagexps = input.getRegexps();
-
- // Track whether we've found every match we need (possibly with arrays of 0 size).
- final boolean[] valflags = new boolean[tagvals.size()];
- final boolean[] expflags = new boolean[tagexps.size()];
-
- // Check each attribute/tag in the populated set.
- for (final IdPAttribute a : attributes.get(input.getName())) {
-
- // Check each tag value's simple content for a value match.
- for (int tagindex = 0; tagindex < tagvals.size(); ++tagindex) {
- final String tagvalstr = tagvals.get(tagindex);
-
- for (final IdPAttributeValue cval : a.getValues()) {
- final String cvalstr = attributeValueToString(cval);
- if (tagvalstr != null && cvalstr != null) {
- if (tagvalstr.equals(cvalstr)) {
- log.trace("Matched mapped Entity Attribute ({}) value {}", a.getId(), tagvalstr);
- valflags[tagindex] = true;
- break;
- } else if (getTrimTags()) {
- if (tagvalstr.equals(cvalstr.trim())) {
- log.trace("Matched mapped Entity Attribute ({}) value {}", a.getId(), tagvalstr);
- valflags[tagindex] = true;
- break;
- }
- }
- }
- }
- }
-
- // Check each tag regular expression for a match.
- for (int tagindex = 0; tagindex < tagexps.size(); ++tagindex) {
-
- for (final IdPAttributeValue cval : a.getValues()) {
- final String cvalstr = attributeValueToString(cval);
- if (tagexps.get(tagindex) != null && cvalstr != null) {
- if (tagexps.get(tagindex).matcher(cvalstr).matches()) {
- log.trace("Matched mapped Entity Attribute ({}) value {}", a.getId(), cvalstr);
- expflags[tagindex] = true;
- break;
- }
- }
- }
- }
- }
-
- for (final boolean flag : valflags) {
- if (!flag) {
- return false;
- }
- }
-
- for (final boolean flag : expflags) {
- if (!flag) {
- return false;
- }
- }
-
- return true;
- }
-// Checkstyle: CyclomaticComplexity ON
-
- /**
- * Convert an IdPAttributeValue to a String if the type is recognized.
- *
- * @param value object to convert
- * @return the converted value, or null
- */
- @Nullable private String attributeValueToString(@Nonnull final IdPAttributeValue value) {
-
- if (value instanceof ScopedStringAttributeValue) {
- return ((ScopedStringAttributeValue) value).getValue() + scopeDelimiter +
- ((ScopedStringAttributeValue) value).getScope();
- } else if (value instanceof StringAttributeValue) {
- return ((StringAttributeValue) value).getValue();
- } else if (value instanceof EmptyAttributeValue) {
- final EmptyType empty = ((EmptyAttributeValue) value).getValue();
- return EmptyType.ZERO_LENGTH_VALUE.equals(empty) ? "" : null;
- }
- return null;
- }
- }
-
-}
diff --git a/shib-attribute-api/src/main/java/net/shibboleth/idp/attribute/logic/package-info.java b/shib-attribute-api/src/main/java/net/shibboleth/idp/attribute/logic/package-info.java
deleted file mode 100644
index 54b51b20d..000000000
--- a/shib-attribute-api/src/main/java/net/shibboleth/idp/attribute/logic/package-info.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Licensed to the University Corporation for Advanced Internet Development,
- * Inc. (UCAID) under one or more contributor license agreements. See the
- * NOTICE file distributed with this work for additional information regarding
- * copyright ownership. The UCAID licenses this file to You under the Apache
- * License, Version 2.0 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * Predicates related to {@link IdPAttribute} objects.
- */
-
-package net.shibboleth.idp.attribute.logic;
\ No newline at end of file
diff --git a/shib-attribute-filter-spring/src/test/java/net/shibboleth/idp/attribute/filter/spring/AttributeFilterFailFastTest.java b/shib-attribute-filter-spring/src/test/java/net/shibboleth/idp/attribute/filter/spring/AttributeFilterFailFastTest.java
index 0cadcd7cd..e1b7517bc 100644
--- a/shib-attribute-filter-spring/src/test/java/net/shibboleth/idp/attribute/filter/spring/AttributeFilterFailFastTest.java
+++ b/shib-attribute-filter-spring/src/test/java/net/shibboleth/idp/attribute/filter/spring/AttributeFilterFailFastTest.java
@@ -22,6 +22,7 @@ import static org.testng.Assert.assertNull;
import java.io.IOException;
+import org.testng.annotations.Ignore;
import org.testng.annotations.Test;
import net.shibboleth.idp.attribute.filter.AttributeFilter;
@@ -29,6 +30,10 @@ import net.shibboleth.spring.testing.AbstractFailFastTest;
import net.shibboleth.utilities.java.support.service.ReloadableService;
import net.shibboleth.utilities.java.support.service.ServiceableComponent;
+/**
+ * Most of these tests work, but they don't shut down cleanly and hang the test process.
+ */
+ at Ignore
@SuppressWarnings({"unchecked", "javadoc"})
public class AttributeFilterFailFastTest extends AbstractFailFastTest {
diff --git a/shib-attribute-resolver-spring/src/test/java/net/shibboleth/idp/saml/attribute/impl/AttributeMappingNodeProcessorTest.java b/shib-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/AttributeMappingNodeProcessorTest.java
similarity index 98%
rename from shib-attribute-resolver-spring/src/test/java/net/shibboleth/idp/saml/attribute/impl/AttributeMappingNodeProcessorTest.java
rename to shib-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/AttributeMappingNodeProcessorTest.java
index 294982884..c1941d223 100644
--- a/shib-attribute-resolver-spring/src/test/java/net/shibboleth/idp/saml/attribute/impl/AttributeMappingNodeProcessorTest.java
+++ b/shib-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/AttributeMappingNodeProcessorTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package net.shibboleth.idp.saml.attribute.impl;
+package net.shibboleth.idp.attribute.resolver.spring;
import static org.testng.Assert.*;
@@ -43,6 +43,7 @@ import net.shibboleth.idp.attribute.IdPAttribute;
import net.shibboleth.idp.attribute.IdPRequestedAttribute;
import net.shibboleth.idp.attribute.StringAttributeValue;
import net.shibboleth.idp.attribute.transcoding.AttributeTranscoderRegistry;
+import net.shibboleth.idp.saml.attribute.impl.AttributeMappingNodeProcessor;
import net.shibboleth.utilities.java.support.service.ReloadableService;
/**
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list