[java-identity-provider COMMIT] in /branches/3.2: ./ idp-attribute-resolver-api/src/main/java/net/shibboleth/idp/attr...
noreply at shibboleth.net
noreply at shibboleth.net
Fri Dec 18 17:35:09 EST 2015
Author: scantor
Date: Fri Dec 18 17:35:09 2015
New Revision: 8049
URL: http://svn.shibboleth.net/view/java-identity-provider?rev=8049&view=rev
Log:
IDP-877 Better handling of band configuration
https://issues.shibboleth.net/jira/browse/IDP-877
If the user specified a dependency which is a dataconnector, but no sourceAttributeID we issue an error message and return no values (resulting in the attribute being resolved empty and thus thrown away.
The error is warned on in the parser, but this change stops the resolver throwing an uncaught exception and the end user into an error page.
Modified:
branches/3.2/ (props changed)
branches/3.2/idp-attribute-resolver-api/src/main/java/net/shibboleth/idp/attribute/resolver/PluginDependencySupport.java
branches/3.2/idp-attribute-resolver-api/src/test/java/net/shibboleth/idp/attribute/resolver/PluginDependencySupportTest.java
branches/3.2/idp-schema/src/main/resources/schema/shibboleth-attribute-resolver.xsd
Modified: branches/3.2/idp-attribute-resolver-api/src/main/java/net/shibboleth/idp/attribute/resolver/PluginDependencySupport.java
URL: http://svn.shibboleth.net/view/java-identity-provider/branches/3.2/idp-attribute-resolver-api/src/main/java/net/shibboleth/idp/attribute/resolver/PluginDependencySupport.java?rev=8049&r1=8048&r2=8049&view=diff
==============================================================================
--- branches/3.2/idp-attribute-resolver-api/src/main/java/net/shibboleth/idp/attribute/resolver/PluginDependencySupport.java (original)
+++ branches/3.2/idp-attribute-resolver-api/src/main/java/net/shibboleth/idp/attribute/resolver/PluginDependencySupport.java Fri Dec 18 17:35:09 2015
@@ -19,6 +19,7 @@
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -58,9 +59,10 @@
*
* @param workContext current attribute resolver work context
* @param dependencies set of dependencies
- * @deprecated use
- * {@link PluginDependencySupport#getMergedAttributeValues(AttributeResolverWorkContext, Collection, String)}
- * @return the merged value set
+ * @deprecated use {@link PluginDependencySupport#getMergedAttributeValues(
+ * AttributeResolverWorkContext, Collection, String)}
+ * @return the merged value set. Returns an empty set if we were given a DataConnector as a dependency, but not
+ * attribute name
*/
@Deprecated @Nonnull @NonnullElements public static List<IdPAttributeValue<?>> getMergedAttributeValues(
@Nonnull final AttributeResolverWorkContext workContext,
@@ -84,8 +86,10 @@
ResolvedDataConnector dataConnector =
workContext.getResolvedDataConnectors().get(dependency.getDependencyPluginId());
if (dataConnector != null) {
- Constraint.isTrue(dependency.getDependencyAttributeId() != null, "Data connector dependencies "
- + "must specify a dependant attribute ID");
+ if (dependency.getDependencyAttributeId() == null) {
+ LOG.error("Data connector dependencies must specify a dependent attribute ID");
+ return Collections.EMPTY_LIST;
+ }
if (null != dataConnector.getResolvedAttributes()) {
final IdPAttribute resolvedAttribute =
@@ -112,7 +116,8 @@
* @param workContext current attribute resolver work context
* @param dependencies set of dependencies
* @param attributeDefinitionId the attributeID that these values will be associated with.
- * @return the merged value set
+ * @return the merged value set. Returns an empty set if we were given a DataConnector as a dependency, but not
+ * attribute name
*/
@Nonnull @NonnullElements public static List<IdPAttributeValue<?>> getMergedAttributeValues(
@Nonnull final AttributeResolverWorkContext workContext,
@@ -133,8 +138,8 @@
final String dependencyAttributeId = dependency.getDependencyAttributeId();
if (attributeDefinition != null) {
if (null == dependencyAttributeId) {
- LOG.warn("Plugin '{}' was defined without a sourceAttributeID, but attribute '{}', specified " + ""
- + "as a <Dependency> will be used.", attributeDefinitionId, pluginId);
+ LOG.warn("Plugin '{}' was defined without a sourceAttributeID, but attribute '{}', specified "
+ + "" + "as a <Dependency> will be used.", attributeDefinitionId, pluginId);
} else if (!dependencyAttributeId.equals(pluginId)) {
LOG.warn("Plugin '{}' was defined with a sourceAttributeID '{}',"
+ " but the attribute definition '{}', specified as a <Dependency> will be used as well.",
@@ -149,8 +154,12 @@
ResolvedDataConnector dataConnector =
[... 76 lines stripped ...]
More information about the commits
mailing list