-/*
- * The Shibboleth License, Version 1.
- * Copyright (c) 2002
- * University Corporation for Advanced Internet Development, Inc.
- * All rights reserved
- *
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution, if any, must include
- * the following acknowledgment: "This product includes software developed by
- * the University Corporation for Advanced Internet Development
- * <http://www.ucaid.edu>Internet2 Project. Alternately, this acknowledegement
- * may appear in the software itself, if and wherever such third-party
- * acknowledgments normally appear.
- *
- * Neither the name of Shibboleth nor the names of its contributors, nor
- * Internet2, nor the University Corporation for Advanced Internet Development,
- * Inc., nor UCAID may be used to endorse or promote products derived from this
- * software without specific prior written permission. For written permission,
- * please contact shibboleth@shibboleth.org
- *
- * Products derived from this software may not be called Shibboleth, Internet2,
- * UCAID, or the University Corporation for Advanced Internet Development, nor
- * may Shibboleth appear in their name, without prior written permission of the
- * University Corporation for Advanced Internet Development.
- *
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND WITH ALL FAULTS. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE DISCLAIMED AND THE ENTIRE RISK
- * OF SATISFACTORY QUALITY, PERFORMANCE, ACCURACY, AND EFFORT IS WITH LICENSEE.
- * IN NO EVENT SHALL THE COPYRIGHT OWNER, CONTRIBUTORS OR THE UNIVERSITY
- * CORPORATION FOR ADVANCED INTERNET DEVELOPMENT, INC. BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+/*
+ * The Shibboleth License, Version 1. Copyright (c) 2002 University Corporation for Advanced Internet Development, Inc.
+ * All rights reserved Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution, if any, must include the following acknowledgment: "This product includes software
+ * developed by the University Corporation for Advanced Internet Development <http://www.ucaid.edu>Internet2 Project.
+ * Alternately, this acknowledegement may appear in the software itself, if and wherever such third-party
+ * acknowledgments normally appear. Neither the name of Shibboleth nor the names of its contributors, nor Internet2, nor
+ * the University Corporation for Advanced Internet Development, Inc., nor UCAID may be used to endorse or promote
+ * products derived from this software without specific prior written permission. For written permission, please contact
+ * shibboleth@shibboleth.org Products derived from this software may not be called Shibboleth, Internet2, UCAID, or the
+ * University Corporation for Advanced Internet Development, nor may Shibboleth appear in their name, without prior
+ * written permission of the University Corporation for Advanced Internet Development. THIS SOFTWARE IS PROVIDED BY THE
+ * COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND WITH ALL FAULTS. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE
+ * DISCLAIMED AND THE ENTIRE RISK OF SATISFACTORY QUALITY, PERFORMANCE, ACCURACY, AND EFFORT IS WITH LICENSEE. IN NO
+ * EVENT SHALL THE COPYRIGHT OWNER, CONTRIBUTORS OR THE UNIVERSITY CORPORATION FOR ADVANCED INTERNET DEVELOPMENT, INC.
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package edu.internet2.middleware.shibboleth.aa.attrresolv;
import java.security.Principal;
/**
- * Defines an Attribute Definition PlugIn for the AA Attribute Resolver. Such plugins can
- * be realized at runtime by the resolver and subsequently resolved in conjunction with other
- * dependant plugins.
+ * Defines an Attribute Definition PlugIn for the AA Attribute Resolver. Such plugins can be realized at runtime by the
+ * resolver and subsequently resolved in conjunction with other dependant plugins.
*
* @author Walter Hoehn (wassa@columbia.edu)
*/
/**
* Resolves the values of an attribute.
*
- * @param attribute The attribute to be resolved
- * @param principal The principal for which the attribute should be resolved
- * @param requester The name of the entity making the resolution request
- * @param depends Resolution dependencies
+ * @param attribute
+ * The attribute to be resolved
+ * @param principal
+ * The principal for which the attribute should be resolved
+ * @param requester
+ * The name of the entity making the resolution request
+ * @param responder
+ * The name of the entity responding to the resolution request
+ * @param depends
+ * Resolution dependencies
* @throws ResolutionPlugInException
*/
- public void resolve(ResolverAttribute attribute, Principal principal, String requester, Dependencies depends)
- throws ResolutionPlugInException;
+ public void resolve(ResolverAttribute attribute, Principal principal, String requester, String responder,
+ Dependencies depends) throws ResolutionPlugInException;
}
/*
* The Shibboleth License, Version 1. Copyright (c) 2002 University Corporation for Advanced Internet Development, Inc.
- * All rights reserved
- *
- *
- * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
- * following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this list of conditions and the following
- * disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the distribution, if any, must include the
- * following acknowledgment: "This product includes software developed by the University Corporation for Advanced
- * Internet Development <http://www.ucaid.edu> Internet2 Project. Alternately, this acknowledegement may appear in the
- * software itself, if and wherever such third-party acknowledgments normally appear.
- *
- * Neither the name of Shibboleth nor the names of its contributors, nor Internet2, nor the University Corporation for
- * Advanced Internet Development, Inc., nor UCAID may be used to endorse or promote products derived from this software
- * without specific prior written permission. For written permission, please contact shibboleth@shibboleth.org
- *
- * Products derived from this software may not be called Shibboleth, Internet2, UCAID, or the University Corporation
- * for Advanced Internet Development, nor may Shibboleth appear in their name, without prior written permission of the
- * University Corporation for Advanced Internet Development.
- *
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND WITH ALL FAULTS. ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE DISCLAIMED AND THE ENTIRE RISK OF SATISFACTORY QUALITY, PERFORMANCE,
- * ACCURACY, AND EFFORT IS WITH LICENSEE. IN NO EVENT SHALL THE COPYRIGHT OWNER, CONTRIBUTORS OR THE UNIVERSITY
- * CORPORATION FOR ADVANCED INTERNET DEVELOPMENT, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * All rights reserved Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution, if any, must include the following acknowledgment: "This product includes software
+ * developed by the University Corporation for Advanced Internet Development <http://www.ucaid.edu> Internet2 Project.
+ * Alternately, this acknowledegement may appear in the software itself, if and wherever such third-party
+ * acknowledgments normally appear. Neither the name of Shibboleth nor the names of its contributors, nor Internet2, nor
+ * the University Corporation for Advanced Internet Development, Inc., nor UCAID may be used to endorse or promote
+ * products derived from this software without specific prior written permission. For written permission, please contact
+ * shibboleth@shibboleth.org Products derived from this software may not be called Shibboleth, Internet2, UCAID, or the
+ * University Corporation for Advanced Internet Development, nor may Shibboleth appear in their name, without prior
+ * written permission of the University Corporation for Advanced Internet Development. THIS SOFTWARE IS PROVIDED BY THE
+ * COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND WITH ALL FAULTS. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE
+ * DISCLAIMED AND THE ENTIRE RISK OF SATISFACTORY QUALITY, PERFORMANCE, ACCURACY, AND EFFORT IS WITH LICENSEE. IN NO
+ * EVENT SHALL THE COPYRIGHT OWNER, CONTRIBUTORS OR THE UNIVERSITY CORPORATION FOR ADVANCED INTERNET DEVELOPMENT, INC.
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package edu.internet2.middleware.shibboleth.aa.attrresolv;
* graph of pluggable attribute definitions and data connectors.
*
* @author Walter Hoehn (wassa@columbia.edu)
- *
*/
public class AttributeResolver {
public static final String resolverNamespace = "urn:mace:shibboleth:resolver:1.0";
public AttributeResolver(IdPConfig configuration) throws AttributeResolverException {
-
+
if (configuration == null || configuration.getResolverConfigLocation() == null) {
log.error("No Attribute Resolver configuration file specified.");
throw new AttributeResolverException("No Attribute Resolver configuration file specified.");
}
-
+
loadConfig(configuration.getResolverConfigLocation());
}
-
+
public AttributeResolver(String configFileLocation) throws AttributeResolverException {
+
loadConfig(configFileLocation);
}
private void loadConfig(String configFile) throws AttributeResolverException {
+
try {
ShibResource config = new ShibResource(configFile, this.getClass());
Parser.DOMParser parser = new Parser.DOMParser(true);
throw new AttributeResolverException("Cannot load Attribute Resolver.");
}
- NodeList plugInNodes =
- document.getElementsByTagNameNS(resolverNamespace, "AttributeResolver").item(0).getChildNodes();
+ NodeList plugInNodes = document.getElementsByTagNameNS(resolverNamespace, "AttributeResolver").item(0)
+ .getChildNodes();
if (plugInNodes.getLength() <= 0) {
log.error("Configuration inclues no PlugIn definitions.");
throw new AttributeResolverException("Cannot load Attribute Resolver.");
private void verifyPlugIn(ResolutionPlugIn plugIn, Set verifyChain, Set inconsistent) {
- //Short-circuit if we have already found this PlugIn to be inconsistent
- if (inconsistent.contains(plugIn.getId())) {
- return;
- }
+ // Short-circuit if we have already found this PlugIn to be inconsistent
+ if (inconsistent.contains(plugIn.getId())) { return; }
- //Make sure that we don't have a circular dependency
+ // Make sure that we don't have a circular dependency
if (verifyChain.contains(plugIn.getId())) {
- log.error(
- "The PlugIn (" + plugIn.getId() + ") is inconsistent. It is involved in a circular dependency chain.");
+ log.error("The PlugIn (" + plugIn.getId()
+ + ") is inconsistent. It is involved in a circular dependency chain.");
inconsistent.add(plugIn.getId());
return;
}
- //Recursively go through all DataConnector dependencies and make sure all are registered and consistent.
+ // Recursively go through all DataConnector dependencies and make sure all are registered and consistent.
List depends = new ArrayList();
depends.addAll(Arrays.asList(plugIn.getDataConnectorDependencyIds()));
Iterator dependsIt = depends.iterator();
while (dependsIt.hasNext()) {
String key = (String) dependsIt.next();
if (!plugIns.containsKey(key)) {
- log.error(
- "The PlugIn ("
- + plugIn.getId()
- + ") is inconsistent. It depends on a PlugIn ("
- + key
+ log.error("The PlugIn (" + plugIn.getId() + ") is inconsistent. It depends on a PlugIn (" + key
+ ") that is not registered.");
inconsistent.add(plugIn.getId());
return;
ResolutionPlugIn dependent = lookupPlugIn(key);
if (!(dependent instanceof DataConnectorPlugIn)) {
- log.error(
- "The PlugIn ("
- + plugIn.getId()
- + ") is inconsistent. It depends on a PlugIn ("
- + key
+ log.error("The PlugIn (" + plugIn.getId() + ") is inconsistent. It depends on a PlugIn (" + key
+ ") that is mislabeled as an DataConnectorPlugIn.");
inconsistent.add(plugIn.getId());
return;
verifyPlugIn(dependent, verifyChain, inconsistent);
if (inconsistent.contains(key)) {
- log.error(
- "The PlugIn ("
- + plugIn.getId()
- + ") is inconsistent. It depends on a PlugIn ("
- + key
+ log.error("The PlugIn (" + plugIn.getId() + ") is inconsistent. It depends on a PlugIn (" + key
+ ") that is inconsistent.");
inconsistent.add(plugIn.getId());
return;
}
verifyChain.remove(plugIn.getId());
- //Recursively go through all AttributeDefinition dependencies and make sure all are registered and consistent.
+ // Recursively go through all AttributeDefinition dependencies and make sure all are registered and consistent.
depends.clear();
depends.addAll(Arrays.asList(plugIn.getAttributeDefinitionDependencyIds()));
dependsIt = depends.iterator();
String key = (String) dependsIt.next();
if (!plugIns.containsKey(key)) {
- log.error(
- "The PlugIn ("
- + plugIn.getId()
- + ") is inconsistent. It depends on a PlugIn ("
- + key
+ log.error("The PlugIn (" + plugIn.getId() + ") is inconsistent. It depends on a PlugIn (" + key
+ ") that is not registered.");
inconsistent.add(plugIn.getId());
return;
ResolutionPlugIn dependent = lookupPlugIn(key);
if (!(dependent instanceof AttributeDefinitionPlugIn)) {
- log.error(
- "The PlugIn ("
- + plugIn.getId()
- + ") is inconsistent. It depends on a PlugIn ("
- + key
+ log.error("The PlugIn (" + plugIn.getId() + ") is inconsistent. It depends on a PlugIn (" + key
+ ") that is mislabeled as an AttributeDefinitionPlugIn.");
inconsistent.add(plugIn.getId());
return;
verifyPlugIn(dependent, verifyChain, inconsistent);
if (inconsistent.contains(key)) {
- log.error(
- "The PlugIn ("
- + plugIn.getId()
- + ") is inconsistent. It depends on a PlugIn ("
- + key
+ log.error("The PlugIn (" + plugIn.getId() + ") is inconsistent. It depends on a PlugIn (" + key
+ ") that is inconsistent.");
inconsistent.add(plugIn.getId());
return;
}
verifyChain.remove(plugIn.getId());
- //Check the failover dependency, if there is one.
+ // Check the failover dependency, if there is one.
if (plugIn instanceof DataConnectorPlugIn) {
String key = ((DataConnectorPlugIn) plugIn).getFailoverDependencyId();
if (key != null) {
if (!plugIns.containsKey(key)) {
- log.error(
- "The PlugIn ("
- + plugIn.getId()
- + ") is inconsistent. It depends on a PlugIn ("
- + key
+ log.error("The PlugIn (" + plugIn.getId() + ") is inconsistent. It depends on a PlugIn (" + key
+ ") that is not registered.");
inconsistent.add(plugIn.getId());
return;
ResolutionPlugIn dependent = lookupPlugIn(key);
if (!(dependent instanceof DataConnectorPlugIn)) {
- log.error(
- "The PlugIn ("
- + plugIn.getId()
- + ") is inconsistent. It depends on a fail-over PlugIn ("
- + key
+ log.error("The PlugIn (" + plugIn.getId()
+ + ") is inconsistent. It depends on a fail-over PlugIn (" + key
+ ") that is not a DataConnectorPlugIn.");
inconsistent.add(plugIn.getId());
return;
verifyPlugIn(dependent, verifyChain, inconsistent);
if (inconsistent.contains(key)) {
- log.error(
- "The PlugIn ("
- + plugIn.getId()
- + ") is inconsistent. It depends on a PlugIn ("
- + key
+ log.error("The PlugIn (" + plugIn.getId() + ") is inconsistent. It depends on a PlugIn (" + key
+ ") that is inconsistent.");
inconsistent.add(plugIn.getId());
return;
}
private ResolutionPlugIn lookupPlugIn(String id) {
+
return (ResolutionPlugIn) plugIns.get(id);
}
* the <code>Principal</code> for which the attributes should be resolved
* @param requester
* the name of the requesting entity
+ * @param responding
+ * the name of the entity responding to the request
* @param attributes
* the set of attributes to be resolved
*/
- public void resolveAttributes(Principal principal, String requester, ResolverAttributeSet attributes) {
+ public void resolveAttributes(Principal principal, String requester, String responder,
+ ResolverAttributeSet attributes) {
HashMap requestCache = new HashMap();
ResolverAttributeIterator iterator = attributes.resolverAttributeIterator();
} else {
log.info("Resolving attribute: (" + attribute.getName() + ")");
if (attribute.resolved()) {
- log.debug(
- "Attribute ("
- + attribute.getName()
+ log.debug("Attribute (" + attribute.getName()
+ ") already resolved for this request. No need for further resolution.");
} else {
- resolveAttribute(attribute, principal, requester, requestCache, attributes);
+ resolveAttribute(attribute, principal, requester, responder, requestCache, attributes);
}
if (!attribute.hasValues()) {
return (String[]) found.toArray(new String[0]);
}
- private Attributes resolveConnector(
- String connector,
- Principal principal,
- String requester,
- Map requestCache,
- ResolverAttributeSet requestedAttributes)
- throws ResolutionPlugInException {
+ private Attributes resolveConnector(String connector, Principal principal, String requester, String responder,
+ Map requestCache, ResolverAttributeSet requestedAttributes) throws ResolutionPlugInException {
DataConnectorPlugIn currentDefinition = (DataConnectorPlugIn) lookupPlugIn(connector);
- //Check to see if we have already resolved the connector during this request
+ // Check to see if we have already resolved the connector during this request
if (requestCache.containsKey(currentDefinition.getId())) {
- log.debug(
- "Connector ("
- + currentDefinition.getId()
+ log.debug("Connector (" + currentDefinition.getId()
+ ") already resolved for this request, using cached version");
return (Attributes) requestCache.get(currentDefinition.getId());
}
- //Check to see if we have a cached resolution for this connector
+ // Check to see if we have a cached resolution for this connector
if (currentDefinition.getTTL() > 0) {
Attributes cachedAttributes = resolverCache.getResolvedConnector(principal, currentDefinition.getId());
if (cachedAttributes != null) {
- log.debug(
- "Connector ("
- + currentDefinition.getId()
+ log.debug("Connector (" + currentDefinition.getId()
+ ") resolution cached from a previous request, using cached version");
return cachedAttributes;
}
}
- //Resolve all attribute dependencies
+ // Resolve all attribute dependencies
String[] attributeDependencies = currentDefinition.getAttributeDefinitionDependencyIds();
Dependencies depends = new Dependencies();
for (int i = 0; attributeDependencies.length > i; i++) {
- log.debug(
- "Connector ("
- + currentDefinition.getId()
- + ") depends on attribute ("
- + attributeDependencies[i]
+ log.debug("Connector (" + currentDefinition.getId() + ") depends on attribute (" + attributeDependencies[i]
+ ").");
ResolverAttribute dependant = requestedAttributes.getByName(attributeDependencies[i]);
if (dependant == null) {
dependant = new DependentOnlyResolutionAttribute(attributeDependencies[i]);
}
- resolveAttribute(dependant, principal, requester, requestCache, requestedAttributes);
+ resolveAttribute(dependant, principal, requester, responder, requestCache, requestedAttributes);
depends.addAttributeResolution(attributeDependencies[i], dependant);
}
- //Resolve all connector dependencies
+ // Resolve all connector dependencies
String[] connectorDependencies = currentDefinition.getDataConnectorDependencyIds();
for (int i = 0; connectorDependencies.length > i; i++) {
- log.debug(
- "Connector ("
- + currentDefinition.getId()
- + ") depends on connector ("
- + connectorDependencies[i]
+ log.debug("Connector (" + currentDefinition.getId() + ") depends on connector (" + connectorDependencies[i]
+ ").");
- depends.addConnectorResolution(
- connectorDependencies[i],
- resolveConnector(connectorDependencies[i], principal, requester, requestCache, requestedAttributes));
+ depends.addConnectorResolution(connectorDependencies[i], resolveConnector(connectorDependencies[i],
+ principal, requester, responder, requestCache, requestedAttributes));
}
- //Resolve the connector
+ // Resolve the connector
Attributes resolvedAttributes = null;
try {
- resolvedAttributes = currentDefinition.resolve(principal, requester, depends);
+ resolvedAttributes = currentDefinition.resolve(principal, requester, responder, depends);
- //Add attribute resolution to cache
+ // Add attribute resolution to cache
if (currentDefinition.getTTL() > 0) {
- resolverCache.cacheConnectorResolution(
- principal,
- currentDefinition.getId(),
- currentDefinition.getTTL(),
- resolvedAttributes);
+ resolverCache.cacheConnectorResolution(principal, currentDefinition.getId(),
+ currentDefinition.getTTL(), resolvedAttributes);
}
} catch (ResolutionPlugInException e) {
// Something went wrong, so check for a fail-over...
if (currentDefinition.getFailoverDependencyId() != null) {
log.warn("Connector (" + currentDefinition.getId() + ") failed, invoking failover dependency");
- resolvedAttributes =
- resolveConnector(
- currentDefinition.getFailoverDependencyId(),
- principal,
- requester,
- requestCache,
- requestedAttributes);
+ resolvedAttributes = resolveConnector(currentDefinition.getFailoverDependencyId(), principal,
+ requester, responder, requestCache, requestedAttributes);
} else if (currentDefinition.getPropagateErrors()) {
throw e;
} else {
- log.warn(
- "Connector ("
- + currentDefinition.getId()
- + ") returning empty attribute set instead of propagating error: "
- + e);
+ log.warn("Connector (" + currentDefinition.getId()
+ + ") returning empty attribute set instead of propagating error: " + e);
resolvedAttributes = new BasicAttributes();
}
}
- //Cache for this request
+ // Cache for this request
requestCache.put(currentDefinition.getId(), resolvedAttributes);
return resolvedAttributes;
}
- private void resolveAttribute(
- ResolverAttribute attribute,
- Principal principal,
- String requester,
- Map requestCache,
- ResolverAttributeSet requestedAttributes)
- throws ResolutionPlugInException {
+ private void resolveAttribute(ResolverAttribute attribute, Principal principal, String requester, String responder,
+ Map requestCache, ResolverAttributeSet requestedAttributes) throws ResolutionPlugInException {
AttributeDefinitionPlugIn currentDefinition = (AttributeDefinitionPlugIn) lookupPlugIn(attribute.getName());
- //Check to see if we have already resolved the attribute during this request
+ // Check to see if we have already resolved the attribute during this request
// (this checks dependency-only attributes and attributes resolved with no values
if (requestCache.containsKey(currentDefinition.getId())) {
- log.debug(
- "Attribute ("
- + currentDefinition.getId()
+ log.debug("Attribute (" + currentDefinition.getId()
+ ") already resolved for this request, using cached version");
attribute.resolveFromCached((ResolverAttribute) requestCache.get(currentDefinition.getId()));
return;
}
- //Check to see if we have already resolved the attribute during this request
+ // Check to see if we have already resolved the attribute during this request
// (this checks attributes that were submitted to the AR for resolution)
ResolverAttribute requestedAttribute = requestedAttributes.getByName(currentDefinition.getId());
if (requestedAttribute != null) {
}
}
- //Check to see if we have a cached resolution for this attribute
+ // Check to see if we have a cached resolution for this attribute
if (currentDefinition.getTTL() > 0) {
- ResolverAttribute cachedAttribute =
- resolverCache.getResolvedAttribute(principal, currentDefinition.getId());
+ ResolverAttribute cachedAttribute = resolverCache
+ .getResolvedAttribute(principal, currentDefinition.getId());
if (cachedAttribute != null) {
- log.debug(
- "Attribute ("
- + currentDefinition.getId()
+ log.debug("Attribute (" + currentDefinition.getId()
+ ") resolution cached from a previous request, using cached version");
attribute.resolveFromCached(cachedAttribute);
return;
}
}
- //Resolve all attribute dependencies
+ // Resolve all attribute dependencies
Dependencies depends = new Dependencies();
String[] attributeDependencies = currentDefinition.getAttributeDefinitionDependencyIds();
boolean dependancyOnly = false;
for (int i = 0; attributeDependencies.length > i; i++) {
- log.debug(
- "Attribute (" + attribute.getName() + ") depends on attribute (" + attributeDependencies[i] + ").");
+ log.debug("Attribute (" + attribute.getName() + ") depends on attribute (" + attributeDependencies[i]
+ + ").");
ResolverAttribute dependant = requestedAttributes.getByName(attributeDependencies[i]);
if (dependant == null) {
dependancyOnly = true;
dependant = new DependentOnlyResolutionAttribute(attributeDependencies[i]);
}
- resolveAttribute(dependant, principal, requester, requestCache, requestedAttributes);
+ resolveAttribute(dependant, principal, requester, responder, requestCache, requestedAttributes);
depends.addAttributeResolution(attributeDependencies[i], dependant);
}
- //Resolve all connector dependencies
+ // Resolve all connector dependencies
String[] connectorDependencies = currentDefinition.getDataConnectorDependencyIds();
for (int i = 0; connectorDependencies.length > i; i++) {
- log.debug(
- "Attribute (" + attribute.getName() + ") depends on connector (" + connectorDependencies[i] + ").");
- depends.addConnectorResolution(
- connectorDependencies[i],
- resolveConnector(connectorDependencies[i], principal, requester, requestCache, requestedAttributes));
+ log.debug("Attribute (" + attribute.getName() + ") depends on connector (" + connectorDependencies[i]
+ + ").");
+ depends.addConnectorResolution(connectorDependencies[i], resolveConnector(connectorDependencies[i],
+ principal, requester, responder, requestCache, requestedAttributes));
}
- //Resolve the attribute
+ // Resolve the attribute
try {
- currentDefinition.resolve(attribute, principal, requester, depends);
+ currentDefinition.resolve(attribute, principal, requester, responder, depends);
- //Add attribute resolution to cache
+ // Add attribute resolution to cache
if (currentDefinition.getTTL() > 0) {
- resolverCache.cacheAttributeResolution(
- principal,
- attribute.getName(),
- currentDefinition.getTTL(),
- attribute);
+ resolverCache.cacheAttributeResolution(principal, attribute.getName(), currentDefinition.getTTL(),
+ attribute);
}
} catch (ResolutionPlugInException e) {
if (currentDefinition.getPropagateErrors()) {
throw e;
} else {
- log.warn(
- "Attribute ("
- + currentDefinition.getId()
- + ") returning no values instead of propagating error: "
- + e);
+ log.warn("Attribute (" + currentDefinition.getId()
+ + ") returning no values instead of propagating error: " + e);
}
}
- //If necessary, cache for this request
+ // If necessary, cache for this request
if (dependancyOnly || !attribute.hasValues()) {
requestCache.put(currentDefinition.getId(), attribute);
}
}
private class DuplicatePlugInException extends Exception {
+
public DuplicatePlugInException(String message) {
+
super(message);
}
}
class DependentOnlyResolutionAttribute implements ResolverAttribute {
+
String name;
ArrayList values = new ArrayList();
boolean resolved = false;
DependentOnlyResolutionAttribute(String name) {
+
this.name = name;
}
public String getName() {
+
return name;
}
public boolean resolved() {
+
return resolved;
}
public void setResolved() {
+
resolved = true;
}
public void resolveFromCached(ResolverAttribute attribute) {
+
}
public void setLifetime(long lifetime) {
+
}
public long getLifetime() {
+
return 0;
}
public void addValue(Object value) {
+
values.add(value);
}
public Iterator getValues() {
+
return values.iterator();
}
public boolean hasValues() {
- if (values.isEmpty()) {
- return false;
- }
+
+ if (values.isEmpty()) { return false; }
return true;
}
public void registerValueHandler(ValueHandler handler) {
+
}
public ValueHandler getRegisteredValueHandler() {
+
return null;
}
}
* Cleanup resources that won't be released when this object is garbage-collected
*/
public void destroy() {
+
resolverCache.destroy();
}
}
-/*
- * The Shibboleth License, Version 1.
- * Copyright (c) 2002
- * University Corporation for Advanced Internet Development, Inc.
- * All rights reserved
- *
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution, if any, must include
- * the following acknowledgment: "This product includes software developed by
- * the University Corporation for Advanced Internet Development
- * <http://www.ucaid.edu>Internet2 Project. Alternately, this acknowledegement
- * may appear in the software itself, if and wherever such third-party
- * acknowledgments normally appear.
- *
- * Neither the name of Shibboleth nor the names of its contributors, nor
- * Internet2, nor the University Corporation for Advanced Internet Development,
- * Inc., nor UCAID may be used to endorse or promote products derived from this
- * software without specific prior written permission. For written permission,
- * please contact shibboleth@shibboleth.org
- *
- * Products derived from this software may not be called Shibboleth, Internet2,
- * UCAID, or the University Corporation for Advanced Internet Development, nor
- * may Shibboleth appear in their name, without prior written permission of the
- * University Corporation for Advanced Internet Development.
- *
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND WITH ALL FAULTS. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE DISCLAIMED AND THE ENTIRE RISK
- * OF SATISFACTORY QUALITY, PERFORMANCE, ACCURACY, AND EFFORT IS WITH LICENSEE.
- * IN NO EVENT SHALL THE COPYRIGHT OWNER, CONTRIBUTORS OR THE UNIVERSITY
- * CORPORATION FOR ADVANCED INTERNET DEVELOPMENT, INC. BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+/*
+ * The Shibboleth License, Version 1. Copyright (c) 2002 University Corporation for Advanced Internet Development, Inc.
+ * All rights reserved Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution, if any, must include the following acknowledgment: "This product includes software
+ * developed by the University Corporation for Advanced Internet Development <http://www.ucaid.edu>Internet2 Project.
+ * Alternately, this acknowledegement may appear in the software itself, if and wherever such third-party
+ * acknowledgments normally appear. Neither the name of Shibboleth nor the names of its contributors, nor Internet2, nor
+ * the University Corporation for Advanced Internet Development, Inc., nor UCAID may be used to endorse or promote
+ * products derived from this software without specific prior written permission. For written permission, please contact
+ * shibboleth@shibboleth.org Products derived from this software may not be called Shibboleth, Internet2, UCAID, or the
+ * University Corporation for Advanced Internet Development, nor may Shibboleth appear in their name, without prior
+ * written permission of the University Corporation for Advanced Internet Development. THIS SOFTWARE IS PROVIDED BY THE
+ * COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND WITH ALL FAULTS. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE
+ * DISCLAIMED AND THE ENTIRE RISK OF SATISFACTORY QUALITY, PERFORMANCE, ACCURACY, AND EFFORT IS WITH LICENSEE. IN NO
+ * EVENT SHALL THE COPYRIGHT OWNER, CONTRIBUTORS OR THE UNIVERSITY CORPORATION FOR ADVANCED INTERNET DEVELOPMENT, INC.
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-
+
package edu.internet2.middleware.shibboleth.aa.attrresolv;
import java.security.Principal;
import javax.naming.directory.Attributes;
/**
- * Defines a Data Connector PlugIn for the AA Attribute Resolver. Such plugins represent
- * connection points to external data sources from which attribute data is gathered.
+ * Defines a Data Connector PlugIn for the AA Attribute Resolver. Such plugins represent connection points to external
+ * data sources from which attribute data is gathered.
*
* @author Walter Hoehn (wassa@columbia.edu)
*/
public interface DataConnectorPlugIn extends ResolutionPlugIn {
-
- /**
- * Returns the name of a data connector to resolve if this one fails.
- *
- * @return String an Id
- */
- public String getFailoverDependencyId();
- /**
- * Resolves the values of a data connector.
- *
- * @param principal The principal for which the connector should be resolved
- * @param requester The name of the entity making the resolution request
- * @param depends Resolution dependencies
- * @throws ResolutionPlugInException
- */
- public Attributes resolve(Principal principal, String requester, Dependencies depends) throws ResolutionPlugInException;
+ /**
+ * Returns the name of a data connector to resolve if this one fails.
+ *
+ * @return String an Id
+ */
+ public String getFailoverDependencyId();
-}
+ /**
+ * Resolves the values of a data connector.
+ *
+ * @param principal
+ * The principal for which the connector should be resolved
+ * @param requester
+ * The name of the entity making the resolution request *
+ * @param responder
+ * The name of the entity responding to the resolution request
+ * @param depends
+ * Resolution dependencies
+ * @throws ResolutionPlugInException
+ */
+ public Attributes resolve(Principal principal, String requester, String responder, Dependencies depends)
+ throws ResolutionPlugInException;
+}
* @author <a href="mailto:vgoenka@sungardsct.com">Vishal Goenka </a>
*/
+/**
+ * @author Walter Hoehn
+ */
public class CompositeAttributeDefinition extends SimpleBaseAttributeDefinition implements AttributeDefinitionPlugIn {
private static Logger log = Logger.getLogger(CompositeAttributeDefinition.class.getName());
}
/**
- * @see edu.internet2.middleware.shibboleth.aa.attrresolv.AttributeDefinitionPlugIn#resolve(
- * edu.internet2.middleware.shibboleth.aa.attrresolv.ArpAttribute, java.security.Principal, java.lang.String,
+ * @see edu.internet2.middleware.shibboleth.aa.attrresolv.AttributeDefinitionPlugIn#resolve(edu.internet2.middleware.shibboleth.aa.attrresolv.ResolverAttribute,
+ * java.security.Principal, java.lang.String, java.lang.String,
* edu.internet2.middleware.shibboleth.aa.attrresolv.Dependencies)
*/
- public void resolve(ResolverAttribute attribute, Principal principal, String requester, Dependencies depends)
- throws ResolutionPlugInException {
+ public void resolve(ResolverAttribute attribute, Principal principal, String requester, String responder,
+ Dependencies depends) throws ResolutionPlugInException {
// Collect attribute values from dependencies
BasicAttributes attributes = new BasicAttributes();
-/*
- * The Shibboleth License, Version 1.
- * Copyright (c) 2002
- * University Corporation for Advanced Internet Development, Inc.
- * All rights reserved
- *
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution, if any, must include
- * the following acknowledgment: "This product includes software developed by
- * the University Corporation for Advanced Internet Development
- * <http://www.ucaid.edu>Internet2 Project. Alternately, this acknowledegement
- * may appear in the software itself, if and wherever such third-party
- * acknowledgments normally appear.
- *
- * Neither the name of Shibboleth nor the names of its contributors, nor
- * Internet2, nor the University Corporation for Advanced Internet Development,
- * Inc., nor UCAID may be used to endorse or promote products derived from this
- * software without specific prior written permission. For written permission,
- * please contact shibboleth@shibboleth.org
- *
- * Products derived from this software may not be called Shibboleth, Internet2,
- * UCAID, or the University Corporation for Advanced Internet Development, nor
- * may Shibboleth appear in their name, without prior written permission of the
- * University Corporation for Advanced Internet Development.
- *
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND WITH ALL FAULTS. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE DISCLAIMED AND THE ENTIRE RISK
- * OF SATISFACTORY QUALITY, PERFORMANCE, ACCURACY, AND EFFORT IS WITH LICENSEE.
- * IN NO EVENT SHALL THE COPYRIGHT OWNER, CONTRIBUTORS OR THE UNIVERSITY
- * CORPORATION FOR ADVANCED INTERNET DEVELOPMENT, INC. BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+/*
+ * The Shibboleth License, Version 1. Copyright (c) 2002 University Corporation for Advanced Internet Development, Inc.
+ * All rights reserved Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution, if any, must include the following acknowledgment: "This product includes software
+ * developed by the University Corporation for Advanced Internet Development <http://www.ucaid.edu>Internet2 Project.
+ * Alternately, this acknowledegement may appear in the software itself, if and wherever such third-party
+ * acknowledgments normally appear. Neither the name of Shibboleth nor the names of its contributors, nor Internet2, nor
+ * the University Corporation for Advanced Internet Development, Inc., nor UCAID may be used to endorse or promote
+ * products derived from this software without specific prior written permission. For written permission, please contact
+ * shibboleth@shibboleth.org Products derived from this software may not be called Shibboleth, Internet2, UCAID, or the
+ * University Corporation for Advanced Internet Development, nor may Shibboleth appear in their name, without prior
+ * written permission of the University Corporation for Advanced Internet Development. THIS SOFTWARE IS PROVIDED BY THE
+ * COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND WITH ALL FAULTS. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE
+ * DISCLAIMED AND THE ENTIRE RISK OF SATISFACTORY QUALITY, PERFORMANCE, ACCURACY, AND EFFORT IS WITH LICENSEE. IN NO
+ * EVENT SHALL THE COPYRIGHT OWNER, CONTRIBUTORS OR THE UNIVERSITY CORPORATION FOR ADVANCED INTERNET DEVELOPMENT, INC.
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package edu.internet2.middleware.shibboleth.aa.attrresolv.provider;
import edu.internet2.middleware.shibboleth.aa.attrresolv.ResolverAttribute;
/**
- *
* Wrapper class for custom <code>AttributeDefinitionPlugIn</code> implementations.
*
* @author Walter Hoehn (wassa@columbia.edu)
- *
*/
public class CustomAttributeDefinition implements ResolutionPlugIn, AttributeDefinitionPlugIn {
private static Logger log = Logger.getLogger(CustomAttributeDefinition.class.getName());
private AttributeDefinitionPlugIn custom;
- /** The time, in seconds, for which attribute created from this definition should be valid. */
- protected long lifeTime = -1;
-
+ /** The time, in seconds, for which attribute created from this definition should be valid. */
+ protected long lifeTime = -1;
+
public CustomAttributeDefinition(Element e) throws ResolutionPlugInException {
+
if (!e.getTagName().equals("CustomAttributeDefinition")) {
log.error("Incorrect attribute definition configuration: expected <CustomAttributeDefinition> .");
throw new ResolutionPlugInException("Failed to initialize Attribute Definition PlugIn.");
throw new ResolutionPlugInException("Failed to initialize Attribute Definition PlugIn.");
} else {
try {
- Class[] params = { Class.forName("org.w3c.dom.Element"), };
- Object[] passElement = { e };
- custom =
- (AttributeDefinitionPlugIn) Class.forName(className).getConstructor(params).newInstance(
+ Class[] params = {Class.forName("org.w3c.dom.Element"),};
+ Object[] passElement = {e};
+ custom = (AttributeDefinitionPlugIn) Class.forName(className).getConstructor(params).newInstance(
passElement);
} catch (Exception loaderException) {
- log.error(
- "Failed to load Custom Attribute Definition PlugIn implementation class: "
+ log.error("Failed to load Custom Attribute Definition PlugIn implementation class: "
+ loaderException.getMessage());
throw new ResolutionPlugInException("Failed to initialize Attribute Definition PlugIn.");
}
}
- String lifeTimeSpec = e.getAttribute("lifeTime");
- if (lifeTimeSpec != null && !lifeTimeSpec.equals("")) {
- try {
- lifeTime = Long.valueOf(lifeTimeSpec).longValue();
- log.debug("Explicit lifetime set for attribute (" + getId() + "). Lifetime: (" + lifeTime + ").");
- } catch (NumberFormatException nfe) {
- log.error("Bad value for attribute (lifeTime) for Attribute Definition (" + getId() + ").");
- }
- }
- }
+ String lifeTimeSpec = e.getAttribute("lifeTime");
+ if (lifeTimeSpec != null && !lifeTimeSpec.equals("")) {
+ try {
+ lifeTime = Long.valueOf(lifeTimeSpec).longValue();
+ log.debug("Explicit lifetime set for attribute (" + getId() + "). Lifetime: (" + lifeTime + ").");
+ } catch (NumberFormatException nfe) {
+ log.error("Bad value for attribute (lifeTime) for Attribute Definition (" + getId() + ").");
+ }
+ }
+ }
/**
- * @see edu.internet2.middleware.shibboleth.aa.attrresolv.AttributeDefinitionPlugIn#resolve(edu.internet2.middleware.shibboleth.aa.attrresolv.ArpAttribute, java.security.Principal, java.lang.String, edu.internet2.middleware.shibboleth.aa.attrresolv.Dependencies)
+ * @see edu.internet2.middleware.shibboleth.aa.attrresolv.AttributeDefinitionPlugIn#resolve(edu.internet2.middleware.shibboleth.aa.attrresolv.ResolverAttribute,
+ * java.security.Principal, java.lang.String, java.lang.String,
+ * edu.internet2.middleware.shibboleth.aa.attrresolv.Dependencies)
*/
- public void resolve(ResolverAttribute attribute, Principal principal, String requester, Dependencies depends)
- throws ResolutionPlugInException {
- custom.resolve(attribute, principal, requester, depends);
- if (lifeTime != -1) {
- attribute.setLifetime(lifeTime);
- }
+ public void resolve(ResolverAttribute attribute, Principal principal, String requester, String responder,
+ Dependencies depends) throws ResolutionPlugInException {
+
+ custom.resolve(attribute, principal, requester, responder, depends);
+ if (lifeTime != -1) {
+ attribute.setLifetime(lifeTime);
+ }
}
/**
* @see edu.internet2.middleware.shibboleth.aa.attrresolv.BaseResolutionPlugIn#getId()
*/
public String getId() {
+
return custom.getId();
}
* @see edu.internet2.middleware.shibboleth.aa.attrresolv.provider.BaseResolutionPlugIn#getTTL()
*/
public long getTTL() {
+
return custom.getTTL();
}
* @see edu.internet2.middleware.shibboleth.aa.attrresolv.AttributeDefinitionPlugIn#getAttributeDefinitionDependencyIds()
*/
public String[] getAttributeDefinitionDependencyIds() {
+
return custom.getAttributeDefinitionDependencyIds();
}
* @see edu.internet2.middleware.shibboleth.aa.attrresolv.AttributeDefinitionPlugIn#getDataConnectorDependencyIds()
*/
public String[] getDataConnectorDependencyIds() {
+
return custom.getDataConnectorDependencyIds();
}
- /**
- * @see edu.internet2.middleware.shibboleth.aa.attrresolv.ResolutionPlugIn#getPropagateErrors()
- */
- public boolean getPropagateErrors() {
- return custom.getPropagateErrors();
- }
+ /**
+ * @see edu.internet2.middleware.shibboleth.aa.attrresolv.ResolutionPlugIn#getPropagateErrors()
+ */
+ public boolean getPropagateErrors() {
+
+ return custom.getPropagateErrors();
+ }
}
-/*
- * The Shibboleth License, Version 1.
- * Copyright (c) 2002
- * University Corporation for Advanced Internet Development, Inc.
- * All rights reserved
- *
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution, if any, must include
- * the following acknowledgment: "This product includes software developed by
- * the University Corporation for Advanced Internet Development
- * <http://www.ucaid.edu>Internet2 Project. Alternately, this acknowledegement
- * may appear in the software itself, if and wherever such third-party
- * acknowledgments normally appear.
- *
- * Neither the name of Shibboleth nor the names of its contributors, nor
- * Internet2, nor the University Corporation for Advanced Internet Development,
- * Inc., nor UCAID may be used to endorse or promote products derived from this
- * software without specific prior written permission. For written permission,
- * please contact shibboleth@shibboleth.org
- *
- * Products derived from this software may not be called Shibboleth, Internet2,
- * UCAID, or the University Corporation for Advanced Internet Development, nor
- * may Shibboleth appear in their name, without prior written permission of the
- * University Corporation for Advanced Internet Development.
- *
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND WITH ALL FAULTS. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE DISCLAIMED AND THE ENTIRE RISK
- * OF SATISFACTORY QUALITY, PERFORMANCE, ACCURACY, AND EFFORT IS WITH LICENSEE.
- * IN NO EVENT SHALL THE COPYRIGHT OWNER, CONTRIBUTORS OR THE UNIVERSITY
- * CORPORATION FOR ADVANCED INTERNET DEVELOPMENT, INC. BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+/*
+ * The Shibboleth License, Version 1. Copyright (c) 2002 University Corporation for Advanced Internet Development, Inc.
+ * All rights reserved Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution, if any, must include the following acknowledgment: "This product includes software
+ * developed by the University Corporation for Advanced Internet Development <http://www.ucaid.edu>Internet2 Project.
+ * Alternately, this acknowledegement may appear in the software itself, if and wherever such third-party
+ * acknowledgments normally appear. Neither the name of Shibboleth nor the names of its contributors, nor Internet2, nor
+ * the University Corporation for Advanced Internet Development, Inc., nor UCAID may be used to endorse or promote
+ * products derived from this software without specific prior written permission. For written permission, please contact
+ * shibboleth@shibboleth.org Products derived from this software may not be called Shibboleth, Internet2, UCAID, or the
+ * University Corporation for Advanced Internet Development, nor may Shibboleth appear in their name, without prior
+ * written permission of the University Corporation for Advanced Internet Development. THIS SOFTWARE IS PROVIDED BY THE
+ * COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND WITH ALL FAULTS. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE
+ * DISCLAIMED AND THE ENTIRE RISK OF SATISFACTORY QUALITY, PERFORMANCE, ACCURACY, AND EFFORT IS WITH LICENSEE. IN NO
+ * EVENT SHALL THE COPYRIGHT OWNER, CONTRIBUTORS OR THE UNIVERSITY CORPORATION FOR ADVANCED INTERNET DEVELOPMENT, INC.
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package edu.internet2.middleware.shibboleth.aa.attrresolv.provider;
import edu.internet2.middleware.shibboleth.aa.attrresolv.ResolutionPlugInException;
/**
- *
* Wrapper class for custom <code>DataConnectorPlugIn</code> implementations.
*
* @author Walter Hoehn (wassa@columbia.edu)
- *
*/
public class CustomDataConnector implements DataConnectorPlugIn {
private DataConnectorPlugIn custom;
public CustomDataConnector(Element e) throws ResolutionPlugInException {
+
if (!e.getTagName().equals("CustomDataConnector")) {
log.error("Incorrect connector configuration: expected <CustomDataConnector> .");
throw new ResolutionPlugInException("Failed to initialize Connector PlugIn.");
throw new ResolutionPlugInException("Failed to initialize Connector PlugIn.");
} else {
try {
- Class[] params = { Class.forName("org.w3c.dom.Element"), };
- Object[] passElement = { e };
+ Class[] params = {Class.forName("org.w3c.dom.Element"),};
+ Object[] passElement = {e};
custom = (DataConnectorPlugIn) Class.forName(className).getConstructor(params).newInstance(passElement);
} catch (Exception loaderException) {
- //Try to be a little smart about logging errors
- //For some reason the message is not set on ClassNotFoundException
+ // Try to be a little smart about logging errors
+ // For some reason the message is not set on ClassNotFoundException
log.error("Failed to load Custom Connector PlugIn implementation class: "
- + ((loaderException.getCause() != null) ? loaderException.getCause().getMessage() : loaderException.toString()));
+ + ((loaderException.getCause() != null)
+ ? loaderException.getCause().getMessage()
+ : loaderException.toString()));
throw new ResolutionPlugInException("Failed to initialize Connector PlugIn.");
}
}
}
/**
- * @see edu.internet2.middleware.shibboleth.aa.attrresolv.DataConnectorPlugIn#resolve(Principal)
+ * @see edu.internet2.middleware.shibboleth.aa.attrresolv.DataConnectorPlugIn#resolve(java.security.Principal,
+ * java.lang.String, java.lang.String, edu.internet2.middleware.shibboleth.aa.attrresolv.Dependencies)
*/
- public Attributes resolve(Principal principal, String requester, Dependencies depends) throws ResolutionPlugInException {
- return custom.resolve(principal, requester, depends);
+ public Attributes resolve(Principal principal, String requester, String responder, Dependencies depends)
+ throws ResolutionPlugInException {
+
+ return custom.resolve(principal, requester, responder, depends);
}
/**
* @see edu.internet2.middleware.shibboleth.aa.attrresolv.BaseResolutionPlugIn#getId()
*/
public String getId() {
+
return custom.getId();
}
* @see edu.internet2.middleware.shibboleth.aa.attrresolv.provider.BaseResolutionPlugIn#getTTL()
*/
public long getTTL() {
+
return custom.getTTL();
}
- /**
- * @see edu.internet2.middleware.shibboleth.aa.attrresolv.ResolutionPlugIn#getAttributeDefinitionDependencyIds()
- */
- public String[] getAttributeDefinitionDependencyIds() {
- return custom.getAttributeDefinitionDependencyIds();
- }
-
- /**
- * @see edu.internet2.middleware.shibboleth.aa.attrresolv.ResolutionPlugIn#getDataConnectorDependencyIds()
- */
- public String[] getDataConnectorDependencyIds() {
- return custom.getDataConnectorDependencyIds();
- }
-
- /**
- * @see edu.internet2.middleware.shibboleth.aa.attrresolv.DataConnectorPlugIn#getFailoverDependencyId()
- */
- public String getFailoverDependencyId() {
- return custom.getFailoverDependencyId();
- }
-
- /**
- * @see edu.internet2.middleware.shibboleth.aa.attrresolv.ResolutionPlugIn#getPropagateErrors()
- */
- public boolean getPropagateErrors() {
- return custom.getPropagateErrors();
- }
+ /**
+ * @see edu.internet2.middleware.shibboleth.aa.attrresolv.ResolutionPlugIn#getAttributeDefinitionDependencyIds()
+ */
+ public String[] getAttributeDefinitionDependencyIds() {
+
+ return custom.getAttributeDefinitionDependencyIds();
+ }
+
+ /**
+ * @see edu.internet2.middleware.shibboleth.aa.attrresolv.ResolutionPlugIn#getDataConnectorDependencyIds()
+ */
+ public String[] getDataConnectorDependencyIds() {
+
+ return custom.getDataConnectorDependencyIds();
+ }
+
+ /**
+ * @see edu.internet2.middleware.shibboleth.aa.attrresolv.DataConnectorPlugIn#getFailoverDependencyId()
+ */
+ public String getFailoverDependencyId() {
+
+ return custom.getFailoverDependencyId();
+ }
+
+ /**
+ * @see edu.internet2.middleware.shibboleth.aa.attrresolv.ResolutionPlugIn#getPropagateErrors()
+ */
+ public boolean getPropagateErrors() {
+
+ return custom.getPropagateErrors();
+ }
}
}
/**
- * @see edu.internet2.middleware.shibboleth.aa.attrresolv.AttributeDefinitionPlugIn#resolve(
- * edu.internet2.middleware.shibboleth.aa.attrresolv.ArpAttribute, java.security.Principal, java.lang.String,
+ * @see edu.internet2.middleware.shibboleth.aa.attrresolv.AttributeDefinitionPlugIn#resolve(edu.internet2.middleware.shibboleth.aa.attrresolv.ResolverAttribute,
+ * java.security.Principal, java.lang.String, java.lang.String,
* edu.internet2.middleware.shibboleth.aa.attrresolv.Dependencies)
*/
- public void resolve(ResolverAttribute attribute, Principal principal, String requester, Dependencies depends)
- throws ResolutionPlugInException {
+ public void resolve(ResolverAttribute attribute, Principal principal, String requester, String responder,
+ Dependencies depends) throws ResolutionPlugInException {
// Resolve all dependencies to arrive at the source values (unformatted)
Collection results = resolveDependencies(attribute, principal, requester, depends);
}
}
- public Attributes resolve(Principal principal, String requester, Dependencies depends)
+ /**
+ * @see edu.internet2.middleware.shibboleth.aa.attrresolv.DataConnectorPlugIn#resolve(java.security.Principal,
+ * java.lang.String, java.lang.String, edu.internet2.middleware.shibboleth.aa.attrresolv.Dependencies)
+ */
+ public Attributes resolve(Principal principal, String requester, String responder, Dependencies depends)
throws ResolutionPlugInException {
log.debug("Resolving connector: (" + getId() + ")");
try {
preparedStatement = conn.prepareStatement(searchVal);
preparedStatement.clearParameters();
- statementCreator.create(preparedStatement, principal, requester, depends);
+ statementCreator.create(preparedStatement, principal, requester, responder, depends);
rs = preparedStatement.executeQuery();
if (!rs.next()) {
if (minResultSet == 0) return new BasicAttributes();
private static Logger log = Logger.getLogger(DefaultStatementCreator.class.getName());
- public void create(PreparedStatement preparedStatement, Principal principal, String requester, Dependencies depends)
- throws JDBCStatementCreatorException {
+ public void create(PreparedStatement preparedStatement, Principal principal, String requester, String responder,
+ Dependencies depends) throws JDBCStatementCreatorException {
log.debug("Creating prepared statement. Substituting principal: (" + principal.getName() + ")");
// Tried using ParameterMetaData to determine param count, but it fails, so...
log.debug("Parameters configured: " + parameters.size());
}
- public void create(PreparedStatement preparedStatement, Principal principal, String requester, Dependencies depends)
- throws JDBCStatementCreatorException {
+ public void create(PreparedStatement preparedStatement, Principal principal, String requester, String responder,
+ Dependencies depends) throws JDBCStatementCreatorException {
try {
log.debug("Creating prepared statement. Substituting values from dependencies.");
-/*
- * The Shibboleth License, Version 1.
- * Copyright (c) 2002
- * University Corporation for Advanced Internet Development, Inc.
- * All rights reserved
- *
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution, if any, must include
- * the following acknowledgment: "This product includes software developed by
- * the University Corporation for Advanced Internet Development
- * <http://www.ucaid.edu>Internet2 Project. Alternately, this acknowledegement
- * may appear in the software itself, if and wherever such third-party
- * acknowledgments normally appear.
- *
- * Neither the name of Shibboleth nor the names of its contributors, nor
- * Internet2, nor the University Corporation for Advanced Internet Development,
- * Inc., nor UCAID may be used to endorse or promote products derived from this
- * software without specific prior written permission. For written permission,
- * please contact shibboleth@shibboleth.org
- *
- * Products derived from this software may not be called Shibboleth, Internet2,
- * UCAID, or the University Corporation for Advanced Internet Development, nor
- * may Shibboleth appear in their name, without prior written permission of the
- * University Corporation for Advanced Internet Development.
- *
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND WITH ALL FAULTS. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE DISCLAIMED AND THE ENTIRE RISK
- * OF SATISFACTORY QUALITY, PERFORMANCE, ACCURACY, AND EFFORT IS WITH LICENSEE.
- * IN NO EVENT SHALL THE COPYRIGHT OWNER, CONTRIBUTORS OR THE UNIVERSITY
- * CORPORATION FOR ADVANCED INTERNET DEVELOPMENT, INC. BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+/*
+ * The Shibboleth License, Version 1. Copyright (c) 2002 University Corporation for Advanced Internet Development, Inc.
+ * All rights reserved Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution, if any, must include the following acknowledgment: "This product includes software
+ * developed by the University Corporation for Advanced Internet Development <http://www.ucaid.edu>Internet2 Project.
+ * Alternately, this acknowledegement may appear in the software itself, if and wherever such third-party
+ * acknowledgments normally appear. Neither the name of Shibboleth nor the names of its contributors, nor Internet2, nor
+ * the University Corporation for Advanced Internet Development, Inc., nor UCAID may be used to endorse or promote
+ * products derived from this software without specific prior written permission. For written permission, please contact
+ * shibboleth@shibboleth.org Products derived from this software may not be called Shibboleth, Internet2, UCAID, or the
+ * University Corporation for Advanced Internet Development, nor may Shibboleth appear in their name, without prior
+ * written permission of the University Corporation for Advanced Internet Development. THIS SOFTWARE IS PROVIDED BY THE
+ * COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND WITH ALL FAULTS. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE
+ * DISCLAIMED AND THE ENTIRE RISK OF SATISFACTORY QUALITY, PERFORMANCE, ACCURACY, AND EFFORT IS WITH LICENSEE. IN NO
+ * EVENT SHALL THE COPYRIGHT OWNER, CONTRIBUTORS OR THE UNIVERSITY CORPORATION FOR ADVANCED INTERNET DEVELOPMENT, INC.
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package edu.internet2.middleware.shibboleth.aa.attrresolv.provider;
import edu.internet2.middleware.shibboleth.aa.attrresolv.Dependencies;
/**
- * Definition for the JDBC Statement Creator. Implementations are responsible for
- * setting all parameters on the specified prepared statement.
+ * Definition for the JDBC Statement Creator. Implementations are responsible for setting all parameters on the
+ * specified prepared statement.
*
* @author Walter Hoehn (wassa@columbia.edu)
*/
public interface JDBCStatementCreator {
- void create(PreparedStatement preparedStatement, Principal principal, String requester, Dependencies depends) throws JDBCStatementCreatorException;
+ void create(PreparedStatement preparedStatement, Principal principal, String requester, String responder,
+ Dependencies depends) throws JDBCStatementCreatorException;
}
}
/**
- * See {@link DataConnectorPlugIn#resolve(Principal, String, Dependencies)}
+ * @see edu.internet2.middleware.shibboleth.aa.attrresolv.DataConnectorPlugIn#resolve(java.security.Principal,
+ * java.lang.String, java.lang.String, edu.internet2.middleware.shibboleth.aa.attrresolv.Dependencies)
*/
- public Attributes resolve(Principal principal, String requester, Dependencies depends)
+ public Attributes resolve(Principal principal, String requester, String responder, Dependencies depends)
throws ResolutionPlugInException {
InitialDirContext context = null;
* <pre>
*
*
- * <ValueMap value="affiliate" keyset="guest, prospect[a-z ]*, friends" />
- * <ValueMap value="alum" keyset="alum, alumni" />
- * <ValueMap value="employee" keyset="employee" />
- * <ValueMap value="faculty" keyset="faculty" />
- * <ValueMap value="member" keyset="student, faculty, admin[a-z ]*, [a-z ]*admin, employee" />
- * <ValueMap value="staff" keyset="admin[a-z ]*, [a-z ]*admin" />
- * <ValueMap value="student" keyset="student" />
+ *
+ *
+ *
+ *
+ * <ValueMap value="affiliate" keyset="guest, prospect[a-z ]*, friends" />
+ * <ValueMap value="alum" keyset="alum, alumni" />
+ * <ValueMap value="employee" keyset="employee" />
+ * <ValueMap value="faculty" keyset="faculty" />
+ * <ValueMap value="member" keyset="student, faculty, admin[a-z ]*, [a-z ]*admin, employee" />
+ * <ValueMap value="staff" keyset="admin[a-z ]*, [a-z ]*admin" />
+ * <ValueMap value="student" keyset="student" />
+ *
+ *
+ *
+ *
*
*
* </pre>
}
/**
- * @see edu.internet2.middleware.shibboleth.aa.attrresolv.AttributeDefinitionPlugIn#resolve(
- * edu.internet2.middleware.shibboleth.aa.attrresolv.ArpAttribute, java.security.Principal, java.lang.String,
+ * @see edu.internet2.middleware.shibboleth.aa.attrresolv.AttributeDefinitionPlugIn#resolve(edu.internet2.middleware.shibboleth.aa.attrresolv.ResolverAttribute,
+ * java.security.Principal, java.lang.String, java.lang.String,
* edu.internet2.middleware.shibboleth.aa.attrresolv.Dependencies)
*/
- public void resolve(ResolverAttribute attribute, Principal principal, String requester, Dependencies depends)
- throws ResolutionPlugInException {
+ public void resolve(ResolverAttribute attribute, Principal principal, String requester, String responder,
+ Dependencies depends) throws ResolutionPlugInException {
// Resolve all dependencies to arrive at the source values (unformatted)
Collection results = resolveDependencies(attribute, principal, requester, depends);
* @see edu.internet2.middleware.shibboleth.aa.attrresolv.AttributeDefinitionPlugIn#resolve(edu.internet2.middleware.shibboleth.aa.attrresolv.ArpAttribute,
* java.security.Principal, java.lang.String, edu.internet2.middleware.shibboleth.aa.attrresolv.Dependencies)
*/
- public void resolve(ResolverAttribute attribute, Principal principal, String requester, Dependencies depends)
- throws ResolutionPlugInException {
+ public void resolve(ResolverAttribute attribute, Principal principal, String requester, String responder,
+ Dependencies depends) throws ResolutionPlugInException {
log.debug("Resolving attribute: (" + getId() + ")");
}
/**
- * @see edu.internet2.middleware.shibboleth.aa.attrresolv.AttributeDefinitionPlugIn#resolve(
- * edu.internet2.middleware.shibboleth.aa.attrresolv.ArpAttribute, java.security.Principal, java.lang.String,
+ * @see edu.internet2.middleware.shibboleth.aa.attrresolv.AttributeDefinitionPlugIn#resolve(edu.internet2.middleware.shibboleth.aa.attrresolv.ResolverAttribute,
+ * java.security.Principal, java.lang.String, java.lang.String,
* edu.internet2.middleware.shibboleth.aa.attrresolv.Dependencies)
*/
- public void resolve(ResolverAttribute attribute, Principal principal, String requester, Dependencies depends)
- throws ResolutionPlugInException {
+ public void resolve(ResolverAttribute attribute, Principal principal, String requester, String responder,
+ Dependencies depends) throws ResolutionPlugInException {
// Resolve all dependencies to arrive at the source values (unformatted)
Collection results = resolveDependencies(attribute, principal, requester, depends);
-/*
- * The Shibboleth License, Version 1.
- * Copyright (c) 2002
- * University Corporation for Advanced Internet Development, Inc.
- * All rights reserved
- *
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution, if any, must include
- * the following acknowledgment: "This product includes software developed by
- * the University Corporation for Advanced Internet Development
- * <http://www.ucaid.edu>Internet2 Project. Alternately, this acknowledegement
- * may appear in the software itself, if and wherever such third-party
- * acknowledgments normally appear.
- *
- * Neither the name of Shibboleth nor the names of its contributors, nor
- * Internet2, nor the University Corporation for Advanced Internet Development,
- * Inc., nor UCAID may be used to endorse or promote products derived from this
- * software without specific prior written permission. For written permission,
- * please contact shibboleth@shibboleth.org
- *
- * Products derived from this software may not be called Shibboleth, Internet2,
- * UCAID, or the University Corporation for Advanced Internet Development, nor
- * may Shibboleth appear in their name, without prior written permission of the
- * University Corporation for Advanced Internet Development.
- *
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND WITH ALL FAULTS. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE DISCLAIMED AND THE ENTIRE RISK
- * OF SATISFACTORY QUALITY, PERFORMANCE, ACCURACY, AND EFFORT IS WITH LICENSEE.
- * IN NO EVENT SHALL THE COPYRIGHT OWNER, CONTRIBUTORS OR THE UNIVERSITY
- * CORPORATION FOR ADVANCED INTERNET DEVELOPMENT, INC. BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+/*
+ * The Shibboleth License, Version 1. Copyright (c) 2002 University Corporation for Advanced Internet Development, Inc.
+ * All rights reserved Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution, if any, must include the following acknowledgment: "This product includes software
+ * developed by the University Corporation for Advanced Internet Development <http://www.ucaid.edu>Internet2 Project.
+ * Alternately, this acknowledegement may appear in the software itself, if and wherever such third-party
+ * acknowledgments normally appear. Neither the name of Shibboleth nor the names of its contributors, nor Internet2, nor
+ * the University Corporation for Advanced Internet Development, Inc., nor UCAID may be used to endorse or promote
+ * products derived from this software without specific prior written permission. For written permission, please contact
+ * shibboleth@shibboleth.org Products derived from this software may not be called Shibboleth, Internet2, UCAID, or the
+ * University Corporation for Advanced Internet Development, nor may Shibboleth appear in their name, without prior
+ * written permission of the University Corporation for Advanced Internet Development. THIS SOFTWARE IS PROVIDED BY THE
+ * COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND WITH ALL FAULTS. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE
+ * DISCLAIMED AND THE ENTIRE RISK OF SATISFACTORY QUALITY, PERFORMANCE, ACCURACY, AND EFFORT IS WITH LICENSEE. IN NO
+ * EVENT SHALL THE COPYRIGHT OWNER, CONTRIBUTORS OR THE UNIVERSITY CORPORATION FOR ADVANCED INTERNET DEVELOPMENT, INC.
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package edu.internet2.middleware.shibboleth.aa.attrresolv.provider;
import edu.internet2.middleware.shibboleth.aa.attrresolv.ResolutionPlugInException;
/**
- * Sample <code>DataConnectorPlugIn</code> implementation. Echos principal name
- * in EPPN.
+ * Sample <code>DataConnectorPlugIn</code> implementation. Echos principal name in EPPN.
*
* @author Walter Hoehn
- *
*/
public class SampleConnector extends BaseResolutionPlugIn implements DataConnectorPlugIn {
private static Logger log = Logger.getLogger(SampleConnector.class.getName());
public SampleConnector(Element e) throws ResolutionPlugInException {
+
super(e);
}
/**
- * @see edu.internet2.middleware.shibboleth.aa.attrresolv.DataConnectorPlugIn#resolve(Principal)
+ * @see edu.internet2.middleware.shibboleth.aa.attrresolv.DataConnectorPlugIn#resolve(java.security.Principal,
+ * java.lang.String, java.lang.String, edu.internet2.middleware.shibboleth.aa.attrresolv.Dependencies)
*/
- public Attributes resolve(Principal principal, String requester, Dependencies depends) {
+ public Attributes resolve(Principal principal, String requester, String responder, Dependencies depends) {
log.debug("Resolving connector: (" + getId() + ")");
log.debug(getId() + " resolving for principal: (" + principal.getName() + ")");
return attributes;
}
- /**
- * @see edu.internet2.middleware.shibboleth.aa.attrresolv.DataConnectorPlugIn#getFailoverDependencyId()
- */
- public String getFailoverDependencyId() {
- return null;
- }
+ /**
+ * @see edu.internet2.middleware.shibboleth.aa.attrresolv.DataConnectorPlugIn#getFailoverDependencyId()
+ */
+ public String getFailoverDependencyId() {
+
+ return null;
+ }
}
}
/**
- * @see edu.internet2.middleware.shibboleth.aa.attrresolv.AttributeDefinitionPlugIn#resolve(edu.internet2.middleware.shibboleth.aa.attrresolv.ArpAttribute,
- * java.security.Principal, java.lang.String, edu.internet2.middleware.shibboleth.aa.attrresolv.Dependencies)
+ * @see edu.internet2.middleware.shibboleth.aa.attrresolv.AttributeDefinitionPlugIn#resolve(edu.internet2.middleware.shibboleth.aa.attrresolv.ResolverAttribute,
+ * java.security.Principal, java.lang.String, java.lang.String,
+ * edu.internet2.middleware.shibboleth.aa.attrresolv.Dependencies)
*/
- public void resolve(ResolverAttribute attribute, Principal principal, String requester, Dependencies depends)
- throws ResolutionPlugInException {
+ public void resolve(ResolverAttribute attribute, Principal principal, String requester, String responder,
+ Dependencies depends) throws ResolutionPlugInException {
log.debug("Resolving attribute: (" + getId() + ")");
Set results = new LinkedHashSet();
attributeSet.add(attribute);
}
- return resolveAttributes(principal, requester, resource, attributeSet);
+ return resolveAttributes(principal, requester, relyingParty.getIdentityProvider().getProviderId(),
+ resource, attributeSet);
} catch (SAMLException e) {
log.error("An error occurred while creating attributes for principal (" + principal.getName() + ") :"
}
}
- private SAMLAttribute[] resolveAttributes(Principal principal, String requester, URL resource,
+ private SAMLAttribute[] resolveAttributes(Principal principal, String requester, String responder, URL resource,
AAAttributeSet attributeSet) throws ArpProcessingException {
- resolver.resolveAttributes(principal, requester, attributeSet);
+ resolver.resolveAttributes(principal, requester, responder, attributeSet);
arpEngine.filterAttributes(attributeSet, principal, requester, resource);
return attributeSet.getAttributes();
}
private static String resolverxml = null;
private static String idpXml = null;
private static String requester = null;
+ private static String responder = null;
private static String user = null;
private static String resource = null;
private static URL resourceUrl = null;
Principal principal = new LocalPrincipal(user);
- resolver.resolveAttributes(principal, requester, attributeSet);
+ resolver.resolveAttributes(principal, requester, responder, attributeSet);
try {
if (arpEngine != null) {
CmdLineParser.Option idpXmlOption = parser.addStringOption('\u0000', "idpXml");
CmdLineParser.Option userOption = parser.addStringOption('u', "user");
CmdLineParser.Option requesterOption = parser.addStringOption('r', "requester");
+ CmdLineParser.Option responderOption = parser.addStringOption('i', "responder");
CmdLineParser.Option resolverxmlOption = parser.addStringOption('\u0000', "resolverxml");
CmdLineParser.Option fileOption = parser.addStringOption('f', "file"); // deprecated
CmdLineParser.Option resourceOption = parser.addStringOption('\u0000', "resource");
user = (String) parser.getOptionValue(userOption);
requester = (String) parser.getOptionValue(requesterOption);
+ responder = (String) parser.getOptionValue(responderOption);
resource = (String) parser.getOptionValue(resourceOption);
configureLogging(debug);
out.println("Options:");
out.println(" -h, --help Print usage information");
out.println(" -d, --debug Run in debug mode");
- out.println(" --idpXml=FILEURL URL of the IdP configuration file. Attributes");
- out.println(" will be filtered according to the Attribute Release");
- out.println(" Policy (ARP) specified in the configuration file");
+ out.println(" --idpXml=FILEURL URL of the IdP configuration file. Attributes");
+ out.println(" will be filtered according to the Attribute Release");
+ out.println(" Policy (ARP) specified in the configuration file");
out.println(" --resolverxml=FILEURL URL of the resolver configuration file. No ARP");
- out.println(" filtering will be done");
+ out.println(" filtering will be done");
out.println(" --user=USER User for whom attributes should be resolved");
- out.println(" --requester=REQUESTER Name of the requester (SHAR). Emulates");
- out.println(" unauthenticated requester if not specified");
+ out.println(" --requester=REQUESTER Name of the requester (SP). Emulates");
+ out.println(" unauthenticated requester if not specified");
+ out.println(" --responder=RESPONDER Name of the responder (IdP).");
out.println(" --resource=URL URL of the resource. Only attributes available");
- out.println(" to any resource will be returned if not specified");
+ out.println(" to any resource will be returned if not specified");
}
}
/**
* @see edu.internet2.middleware.shibboleth.aa.attrresolv.DataConnectorPlugIn#resolve(Principal)
*/
- public Attributes resolve(Principal principal, String requester, Dependencies depends) {
+ public Attributes resolve(Principal principal, String requester, String responder, Dependencies depends) {
log.debug("Resolving connector: (" + getId() + ")");
log.debug(getId() + " resolving for principal: (" + principal.getName() + ")");
"urn:mace:dir:attribute-def:eduPersonEntitlement",
new Object[]{"urn:mace:example.edu:exampleEntitlement"})});
- ar.resolveAttributes(new LocalPrincipal("mytestuser"), "shar.example.edu", inputAttributes);
+ ar.resolveAttributes(new LocalPrincipal("mytestuser"), "shar.example.edu", null, inputAttributes);
assertEquals("Attribute Resolver returned unexpected attribute set.", inputAttributes, outputAttributes);
new AAAttribute("foo", new Object[]{"bar@example.com"}, new ScopedStringValueHandler(
"example.edu"))});
- ar.resolveAttributes(new LocalPrincipal("mytestuser"), "shar.example.edu", inputAttributes);
+ ar.resolveAttributes(new LocalPrincipal("mytestuser"), "shar.example.edu", null, inputAttributes);
assertEquals("Attribute Resolver returned unexpected attribute set.", inputAttributes, outputAttributes);
} catch (AttributeResolverException e) {
AAAttributeSet outputAttributes = new AAAttributeSet(new AAAttribute[]{new AAAttribute("myAffiliation",
new Object[]{"member"})});
- ar.resolveAttributes(new LocalPrincipal("mytestuser"), "shar.example.edu", inputAttributes);
+ ar.resolveAttributes(new LocalPrincipal("mytestuser"), "shar.example.edu", null, inputAttributes);
assertEquals("Attribute Resolver returned unexpected attribute set.", inputAttributes, outputAttributes);
} catch (AttributeResolverException e) {
new AAAttribute("urn:mace:dir:attribute-def:eduPersonEntitlement",
new Object[]{"urn:mace:example.edu:exampleEntitlement"})});
- ar.resolveAttributes(new LocalPrincipal("mytestuser"), "shar.example.edu", inputAttributes);
+ ar.resolveAttributes(new LocalPrincipal("mytestuser"), "shar.example.edu", null, inputAttributes);
assertEquals("Attribute Resolver returned unexpected attribute set.", inputAttributes, outputAttributes);
"urn:mace:dir:attribute-def:eduPersonScopedAffiliation", new Object[]{"member@example.edu"},
new ScopedStringValueHandler("example.edu"))});
- ar.resolveAttributes(new LocalPrincipal("mytestuser"), "shar.example.edu", inputAttributes);
+ ar.resolveAttributes(new LocalPrincipal("mytestuser"), "shar.example.edu", null, inputAttributes);
assertEquals("Attribute Resolver returned unexpected attribute set.", inputAttributes, outputAttributes);
AAAttributeSet outputAttributes = new AAAttributeSet();
- ar.resolveAttributes(new LocalPrincipal("mytestuser"), "shar.example.edu", inputAttributes);
+ ar.resolveAttributes(new LocalPrincipal("mytestuser"), "shar.example.edu", null, inputAttributes);
assertEquals("Attribute Resolver returned unexpected attribute set.", inputAttributes, outputAttributes);
AAAttributeSet outputAttributes = new AAAttributeSet();
- ar.resolveAttributes(new LocalPrincipal("mytestuser"), "shar.example.edu", inputAttributes);
+ ar.resolveAttributes(new LocalPrincipal("mytestuser"), "shar.example.edu", null, inputAttributes);
assertEquals("Attribute Resolver returned unexpected attribute set.", inputAttributes, outputAttributes);
} catch (ClassCastException e) {
new AAAttribute("urn:mace:dir:attribute-def:eduPersonAffiliation", new Object[]{"member"}),
new AAAttribute("urn:mace:shibboleth:test:eduPersonAffiliation", new Object[]{"member"})});
- ar.resolveAttributes(new LocalPrincipal("mytestuser"), "shar.example.edu", inputAttributes);
+ ar.resolveAttributes(new LocalPrincipal("mytestuser"), "shar.example.edu", null, inputAttributes);
assertEquals("Attribute Resolver returned unexpected attribute set.", inputAttributes, outputAttributes);
// Read only the attribute names from the output file. The values are set by the resolver
ResolverAttributeSet attrsToBeResolved = attrFile.getResolverAttributes(false);
- ar.resolveAttributes(new LocalPrincipal(principal), requester, attrsToBeResolved);
+ ar.resolveAttributes(new LocalPrincipal(principal), requester, null, attrsToBeResolved);
// Read the attribute names and values from the output file
ResolverAttributeSet expectedAttributes = attrFile.getResolverAttributes(true);
-/*
- * The Shibboleth License, Version 1.
- * Copyright (c) 2002
- * University Corporation for Advanced Internet Development, Inc.
- * All rights reserved
- *
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution, if any, must include
- * the following acknowledgment: "This product includes software developed by
- * the University Corporation for Advanced Internet Development
- * <http://www.ucaid.edu>Internet2 Project. Alternately, this acknowledegement
- * may appear in the software itself, if and wherever such third-party
- * acknowledgments normally appear.
- *
- * Neither the name of Shibboleth nor the names of its contributors, nor
- * Internet2, nor the University Corporation for Advanced Internet Development,
- * Inc., nor UCAID may be used to endorse or promote products derived from this
- * software without specific prior written permission. For written permission,
- * please contact shibboleth@shibboleth.org
- *
- * Products derived from this software may not be called Shibboleth, Internet2,
- * UCAID, or the University Corporation for Advanced Internet Development, nor
- * may Shibboleth appear in their name, without prior written permission of the
- * University Corporation for Advanced Internet Development.
- *
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND WITH ALL FAULTS. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE DISCLAIMED AND THE ENTIRE RISK
- * OF SATISFACTORY QUALITY, PERFORMANCE, ACCURACY, AND EFFORT IS WITH LICENSEE.
- * IN NO EVENT SHALL THE COPYRIGHT OWNER, CONTRIBUTORS OR THE UNIVERSITY
- * CORPORATION FOR ADVANCED INTERNET DEVELOPMENT, INC. BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+/*
+ * The Shibboleth License, Version 1. Copyright (c) 2002 University Corporation for Advanced Internet Development, Inc.
+ * All rights reserved Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution, if any, must include the following acknowledgment: "This product includes software
+ * developed by the University Corporation for Advanced Internet Development <http://www.ucaid.edu>Internet2 Project.
+ * Alternately, this acknowledegement may appear in the software itself, if and wherever such third-party
+ * acknowledgments normally appear. Neither the name of Shibboleth nor the names of its contributors, nor Internet2, nor
+ * the University Corporation for Advanced Internet Development, Inc., nor UCAID may be used to endorse or promote
+ * products derived from this software without specific prior written permission. For written permission, please contact
+ * shibboleth@shibboleth.org Products derived from this software may not be called Shibboleth, Internet2, UCAID, or the
+ * University Corporation for Advanced Internet Development, nor may Shibboleth appear in their name, without prior
+ * written permission of the University Corporation for Advanced Internet Development. THIS SOFTWARE IS PROVIDED BY THE
+ * COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND WITH ALL FAULTS. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE
+ * DISCLAIMED AND THE ENTIRE RISK OF SATISFACTORY QUALITY, PERFORMANCE, ACCURACY, AND EFFORT IS WITH LICENSEE. IN NO
+ * EVENT SHALL THE COPYRIGHT OWNER, CONTRIBUTORS OR THE UNIVERSITY CORPORATION FOR ADVANCED INTERNET DEVELOPMENT, INC.
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package edu.internet2.middleware.shibboleth.aa.attrresolv;
* <code>DataConnectorPlugIn</code> implementation for use in unit testing.
*
* @author Walter Hoehn
- *
*/
public class ScopeTestConnector extends BaseDataConnector implements DataConnectorPlugIn {
private static Logger log = Logger.getLogger(ScopeTestConnector.class.getName());
public ScopeTestConnector(Element e) throws ResolutionPlugInException {
+
super(e);
}
/**
- * @see edu.internet2.middleware.shibboleth.aa.attrresolv.DataConnectorPlugIn#resolve(Principal)
+ * @see edu.internet2.middleware.shibboleth.aa.attrresolv.DataConnectorPlugIn#resolve(java.security.Principal,
+ * java.lang.String, java.lang.String, edu.internet2.middleware.shibboleth.aa.attrresolv.Dependencies)
*/
- public Attributes resolve(Principal principal, String requester, Dependencies depends) {
+ public Attributes resolve(Principal principal, String requester, String responder, Dependencies depends) {
log.debug("Resolving connector: (" + getId() + ")");
log.debug(getId() + " resolving for principal: (" + principal.getName() + ")");