Better name for principal class.
authorwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Fri, 29 Apr 2005 19:37:00 +0000 (19:37 +0000)
committerwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Fri, 29 Apr 2005 19:37:00 +0000 (19:37 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@1434 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

src/edu/internet2/middleware/shibboleth/common/AuthNPrincipal.java [deleted file]
src/edu/internet2/middleware/shibboleth/common/LocalPrincipal.java [new file with mode: 0644]
src/edu/internet2/middleware/shibboleth/idp/provider/E_AuthSSOHandler.java
src/edu/internet2/middleware/shibboleth/idp/provider/ShibbolethV1SSOHandler.java
src/edu/internet2/middleware/shibboleth/utils/ClientCertTrustFilter.java
src/edu/internet2/middleware/shibboleth/utils/ResolverTest.java
tests/edu/internet2/middleware/shibboleth/aa/arp/ArpTests.java
tests/edu/internet2/middleware/shibboleth/aa/attrresolv/ResolverTests.java

diff --git a/src/edu/internet2/middleware/shibboleth/common/AuthNPrincipal.java b/src/edu/internet2/middleware/shibboleth/common/AuthNPrincipal.java
deleted file mode 100755 (executable)
index 9b288e1..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-/* 
- * 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.common;
-
-import java.io.Serializable;
-import java.security.Principal;
-
-/**
- * Shibboleth <code>Principal</code> that represents an Authenticated individual.
- * 
- * @author Walter Hoehn (wassa@columbia.edu)
- */
-//TODO this name probably becomes less intuitive as name identifiers
-// don't necessarily come from the HS, change it
-public class AuthNPrincipal implements Principal, Serializable {
-
-       static final long serialVersionUID = 1L;
-       private String principalName;
-
-       /**
-        * Constructor for AuthNPrincipal.
-        */
-
-       public AuthNPrincipal(String principalName) {
-               this.principalName = principalName;
-       }
-
-       /**
-        * @see java.security.Principal#getName()
-        */
-
-       public String getName() {
-               return principalName;
-       }
-
-       /**
-        * @see java.lang.Object#equals(Object)
-        */
-       public boolean equals(Object obj) {
-               if (!(obj instanceof AuthNPrincipal)) {
-                       return false;
-               }
-               return ((AuthNPrincipal) obj).getName().equals(getName());
-       }
-
-       /**
-        * @see java.lang.Object#hashCode()
-        */
-       public int hashCode() {
-               return "AuthNPrincipal".hashCode() + principalName.hashCode();
-       }
-
-}
diff --git a/src/edu/internet2/middleware/shibboleth/common/LocalPrincipal.java b/src/edu/internet2/middleware/shibboleth/common/LocalPrincipal.java
new file mode 100644 (file)
index 0000000..9110918
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+ * 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.common;
+
+import java.io.Serializable;
+import java.security.Principal;
+
+/**
+ * Shibboleth basic <code>Principal</code> ipmlementation for internal use.
+ * 
+ * @author Walter Hoehn (wassa@columbia.edu)
+ */
+
+public class LocalPrincipal implements Principal, Serializable {
+
+       static final long serialVersionUID = 1L;
+       private String principalName;
+
+       /**
+        * Constructor for LocalPrincipal.
+        */
+
+       public LocalPrincipal(String principalName) {
+
+               this.principalName = principalName;
+       }
+
+       /**
+        * @see java.security.Principal#getName()
+        */
+
+       public String getName() {
+
+               return principalName;
+       }
+
+       /**
+        * @see java.lang.Object#equals(Object)
+        */
+       public boolean equals(Object obj) {
+
+               if (!(obj instanceof LocalPrincipal)) { return false; }
+               return ((LocalPrincipal) obj).getName().equals(getName());
+       }
+
+       /**
+        * @see java.lang.Object#hashCode()
+        */
+       public int hashCode() {
+
+               return "LocalPrincipal".hashCode() + principalName.hashCode();
+       }
+
+}
index 4d5f1c4..e332109 100644 (file)
@@ -54,7 +54,7 @@ import org.opensaml.artifact.Artifact;
 import org.w3c.dom.Element;
 
 import edu.internet2.middleware.shibboleth.aa.AAException;
-import edu.internet2.middleware.shibboleth.common.AuthNPrincipal;
+import edu.internet2.middleware.shibboleth.common.LocalPrincipal;
 import edu.internet2.middleware.shibboleth.common.NameIdentifierMappingException;
 import edu.internet2.middleware.shibboleth.common.RelyingParty;
 import edu.internet2.middleware.shibboleth.common.ShibbolethConfigurationException;
@@ -160,7 +160,7 @@ public class E_AuthSSOHandler extends SSOHandler implements IdPProtocolHandler {
                        log.error("Unable to authenticate remote user.");
                        throw new SAMLException(SAMLException.RESPONDER, "General error processing request.");
                }
-               AuthNPrincipal principal = new AuthNPrincipal(username);
+               LocalPrincipal principal = new LocalPrincipal(username);
 
                // Select the appropriate Relying Party configuration for the request
                String remoteProviderId = request.getParameter("aaid");
index 4f034a4..ad78b7a 100644 (file)
@@ -64,7 +64,7 @@ import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
 import edu.internet2.middleware.shibboleth.aa.AAException;
-import edu.internet2.middleware.shibboleth.common.AuthNPrincipal;
+import edu.internet2.middleware.shibboleth.common.LocalPrincipal;
 import edu.internet2.middleware.shibboleth.common.NameIdentifierMappingException;
 import edu.internet2.middleware.shibboleth.common.RelyingParty;
 import edu.internet2.middleware.shibboleth.common.ShibbolethConfigurationException;
@@ -119,7 +119,7 @@ public class ShibbolethV1SSOHandler extends SSOHandler implements IdPProtocolHan
                                        .getRemoteUser() : request.getHeader(support.getIdPConfig().getAuthHeaderName());
                        if ((username == null) || (username.equals(""))) { throw new InvalidClientDataException(
                                        "Unable to authenticate remote user"); }
-                       AuthNPrincipal principal = new AuthNPrincipal(username);
+                       LocalPrincipal principal = new LocalPrincipal(username);
 
                        // Select the appropriate Relying Party configuration for the request
                        RelyingParty relyingParty = null;
@@ -215,7 +215,7 @@ public class ShibbolethV1SSOHandler extends SSOHandler implements IdPProtocolHan
        }
 
        private void respondWithArtifact(HttpServletRequest request, HttpServletResponse response,
-                       IdPProtocolSupport support, AuthNPrincipal principal, RelyingParty relyingParty,
+                       IdPProtocolSupport support, LocalPrincipal principal, RelyingParty relyingParty,
                        EntityDescriptor descriptor, String acceptanceURL, SAMLNameIdentifier nameId, String authenticationMethod,
                        SAMLSubject authNSubject, List assertions) throws SAMLException, IOException, UnsupportedEncodingException {
 
@@ -271,7 +271,7 @@ public class ShibbolethV1SSOHandler extends SSOHandler implements IdPProtocolHan
        }
 
        private void respondWithPOST(HttpServletRequest request, HttpServletResponse response, IdPProtocolSupport support,
-                       AuthNPrincipal principal, RelyingParty relyingParty, EntityDescriptor descriptor, String acceptanceURL,
+                       LocalPrincipal principal, RelyingParty relyingParty, EntityDescriptor descriptor, String acceptanceURL,
                        SAMLNameIdentifier nameId, String authenticationMethod, SAMLSubject authNSubject, List assertions)
                        throws SAMLException, IOException, ServletException {
 
@@ -322,7 +322,7 @@ public class ShibbolethV1SSOHandler extends SSOHandler implements IdPProtocolHan
                }
        }
 
-       private SAMLAssertion generateAttributeAssertion(IdPProtocolSupport support, AuthNPrincipal principal,
+       private SAMLAssertion generateAttributeAssertion(IdPProtocolSupport support, LocalPrincipal principal,
                        RelyingParty relyingParty, SAMLSubject authNSubject) throws SAMLException {
 
                try {
index 422bfd4..fad0870 100644 (file)
@@ -45,7 +45,7 @@ import javax.servlet.http.HttpServletResponse;
 import org.apache.log4j.Logger;
 import org.apache.log4j.MDC;
 
-import edu.internet2.middleware.shibboleth.common.AuthNPrincipal;
+import edu.internet2.middleware.shibboleth.common.LocalPrincipal;
 
 /**
  * Simple Servlet Filter that populates the ServletRequest with data from a client certificate. Relies on external
@@ -127,7 +127,7 @@ public class ClientCertTrustFilter implements Filter {
                        return;
                }
                log.debug("Extracted principal name (" + principalName + ") from Subject.");
-               chain.doFilter(new ClientCertTrustWrapper(httpRequest, new AuthNPrincipal(principalName)), response);
+               chain.doFilter(new ClientCertTrustWrapper(httpRequest, new LocalPrincipal(principalName)), response);
        }
 
        /**
index 2dccecb..b15d5f2 100644 (file)
@@ -76,7 +76,7 @@ import edu.internet2.middleware.shibboleth.aa.arp.ArpException;
 import edu.internet2.middleware.shibboleth.aa.arp.ArpProcessingException;
 import edu.internet2.middleware.shibboleth.aa.attrresolv.AttributeResolver;
 import edu.internet2.middleware.shibboleth.aa.attrresolv.AttributeResolverException;
-import edu.internet2.middleware.shibboleth.common.AuthNPrincipal;
+import edu.internet2.middleware.shibboleth.common.LocalPrincipal;
 import edu.internet2.middleware.shibboleth.common.OriginConfig;
 import edu.internet2.middleware.shibboleth.common.ShibbolethConfigurationException;
 import edu.internet2.middleware.shibboleth.idp.IdPConfig;
@@ -114,7 +114,7 @@ public class ResolverTest
 
        private static void resolveAttributes(AAAttributeSet attributeSet)
        {
-               Principal principal = new AuthNPrincipal(user);
+               Principal principal = new LocalPrincipal(user);
 
                resolver.resolveAttributes(principal, requester, attributeSet);
 
index f10b959..d083c15 100755 (executable)
@@ -76,7 +76,7 @@ import org.xml.sax.InputSource;
 
 import edu.internet2.middleware.shibboleth.aa.AAAttribute;
 import edu.internet2.middleware.shibboleth.aa.AAAttributeSet;
-import edu.internet2.middleware.shibboleth.common.AuthNPrincipal;
+import edu.internet2.middleware.shibboleth.common.LocalPrincipal;
 import edu.internet2.middleware.shibboleth.idp.IdPConfig;
 import edu.internet2.middleware.shibboleth.xml.Parser;
 
@@ -465,7 +465,7 @@ public class ArpTests extends TestCase {
                        fail("Error adding User ARP to Memory Repository.");
                }
 
-               Arp userArp2 = new Arp(new AuthNPrincipal("TestPrincipal"));
+               Arp userArp2 = new Arp(new LocalPrincipal("TestPrincipal"));
                userArp2.setDescription("Test User Arp 2.");
                try {
                        repository.update(userArp2);
@@ -525,7 +525,7 @@ public class ArpTests extends TestCase {
                                directXML.toString().replaceAll(">[\t\r\n ]+<", "><").equals(
                                        processedXML.toString().replaceAll(">[\t\r\n ]+<", "><")));
 
-                       Arp userArp = repository.getUserPolicy(new AuthNPrincipal("test"));
+                       Arp userArp = repository.getUserPolicy(new LocalPrincipal("test"));
 
                        inStream = new FileInputStream("data/arp.user.test.xml");
                        parser.parse(new InputSource(inStream));
@@ -538,7 +538,7 @@ public class ArpTests extends TestCase {
                                directXML.toString().replaceAll(">[\t\r\n ]+<", "><").equals(
                                        processedXML.toString().replaceAll(">[\t\r\n ]+<", "><")));
 
-                       Arp[] allArps = repository.getAllPolicies(new AuthNPrincipal("test"));
+                       Arp[] allArps = repository.getAllPolicies(new LocalPrincipal("test"));
 
                        assertTrue("File-based ARP Repository did not return the correct number of ARPs.", (allArps.length == 2));
 
@@ -558,7 +558,7 @@ public class ArpTests extends TestCase {
                }
 
                try {
-                       Principal principal1 = new AuthNPrincipal("TestPrincipal");
+                       Principal principal1 = new LocalPrincipal("TestPrincipal");
                        URL url1 = new URL("http://www.example.edu/");
                        URI[] list1 = { new URI("urn:mace:dir:attribute-def:eduPersonAffiliation")};
                        URI[] list2 =
@@ -703,7 +703,7 @@ public class ArpTests extends TestCase {
                                + "                     </Rule>"
                                + "     </AttributeReleasePolicy>";
 
-               Principal principal1 = new AuthNPrincipal("TestPrincipal");
+               Principal principal1 = new LocalPrincipal("TestPrincipal");
                URL url1 = new URL("http://www.example.edu/");
                AAAttributeSet inputSet =
                        new AAAttributeSet(
@@ -751,7 +751,7 @@ public class ArpTests extends TestCase {
                                + "                     </Rule>"
                                + "     </AttributeReleasePolicy>";
 
-               Principal principal1 = new AuthNPrincipal("TestPrincipal");
+               Principal principal1 = new LocalPrincipal("TestPrincipal");
                URL url1 = new URL("http://www.example.edu/");
                AAAttributeSet inputSet =
                        new AAAttributeSet(
@@ -806,7 +806,7 @@ public class ArpTests extends TestCase {
                                + "                     </Rule>"
                                + "     </AttributeReleasePolicy>";
 
-               Principal principal1 = new AuthNPrincipal("TestPrincipal");
+               Principal principal1 = new LocalPrincipal("TestPrincipal");
                URL url1 = new URL("http://www.example.edu/");
                AAAttributeSet inputSet =
                        new AAAttributeSet(
@@ -854,7 +854,7 @@ public class ArpTests extends TestCase {
                                + "                     </Rule>"
                                + "     </AttributeReleasePolicy>";
 
-               Principal principal1 = new AuthNPrincipal("TestPrincipal");
+               Principal principal1 = new LocalPrincipal("TestPrincipal");
                URL url1 = new URL("http://www.example.edu/");
                AAAttributeSet inputSet =
                        new AAAttributeSet(
@@ -904,7 +904,7 @@ public class ArpTests extends TestCase {
                                + "                     </Rule>"
                                + "     </AttributeReleasePolicy>";
 
-               Principal principal1 = new AuthNPrincipal("TestPrincipal");
+               Principal principal1 = new LocalPrincipal("TestPrincipal");
                URL url1 = new URL("http://www.example.edu/");
                AAAttributeSet inputSet =
                        new AAAttributeSet(
@@ -957,7 +957,7 @@ public class ArpTests extends TestCase {
                                + "                     </Rule>"
                                + "     </AttributeReleasePolicy>";
 
-               Principal principal1 = new AuthNPrincipal("TestPrincipal");
+               Principal principal1 = new LocalPrincipal("TestPrincipal");
                URL url1 = new URL("http://www.example.edu/");
                AAAttributeSet inputSet =
                        new AAAttributeSet(
@@ -1005,7 +1005,7 @@ public class ArpTests extends TestCase {
                                + "                     </Rule>"
                                + "     </AttributeReleasePolicy>";
 
-               Principal principal1 = new AuthNPrincipal("TestPrincipal");
+               Principal principal1 = new LocalPrincipal("TestPrincipal");
                URL url1 = new URL("http://www.example.edu/");
                AAAttributeSet inputSet =
                        new AAAttributeSet(
@@ -1055,7 +1055,7 @@ public class ArpTests extends TestCase {
                                + "                     </Rule>"
                                + "     </AttributeReleasePolicy>";
 
-               Principal principal1 = new AuthNPrincipal("TestPrincipal");
+               Principal principal1 = new LocalPrincipal("TestPrincipal");
                URL url1 = new URL("http://www.example.edu/");
                AAAttributeSet inputSet =
                        new AAAttributeSet(
@@ -1102,7 +1102,7 @@ public class ArpTests extends TestCase {
                                + "                     </Rule>"
                                + "     </AttributeReleasePolicy>";
 
-               Principal principal1 = new AuthNPrincipal("TestPrincipal");
+               Principal principal1 = new LocalPrincipal("TestPrincipal");
                URL url1 = new URL("http://www.example.edu/");
                AAAttributeSet inputSet =
                        new AAAttributeSet(
@@ -1147,7 +1147,7 @@ public class ArpTests extends TestCase {
                                + "                     </Rule>"
                                + "     </AttributeReleasePolicy>";
 
-               Principal principal1 = new AuthNPrincipal("TestPrincipal");
+               Principal principal1 = new LocalPrincipal("TestPrincipal");
                URL url1 = new URL("http://www.example.edu/");
                AAAttributeSet inputSet =
                        new AAAttributeSet(
@@ -1190,7 +1190,7 @@ public class ArpTests extends TestCase {
                                + "                     </Rule>"
                                + "     </AttributeReleasePolicy>";
 
-               Principal principal1 = new AuthNPrincipal("TestPrincipal");
+               Principal principal1 = new LocalPrincipal("TestPrincipal");
                URL url1 = new URL("http://www.example.edu/");
                AAAttributeSet inputSet =
                        new AAAttributeSet(
@@ -1233,7 +1233,7 @@ public class ArpTests extends TestCase {
                                + "                     </Rule>"
                                + "     </AttributeReleasePolicy>";
 
-               Principal principal1 = new AuthNPrincipal("TestPrincipal");
+               Principal principal1 = new LocalPrincipal("TestPrincipal");
                URL url1 = new URL("http://www.example.edu/");
                AAAttributeSet inputSet =
                        new AAAttributeSet(
@@ -1281,7 +1281,7 @@ public class ArpTests extends TestCase {
                                + "                     </Rule>"
                                + "     </AttributeReleasePolicy>";
 
-               Principal principal1 = new AuthNPrincipal("TestPrincipal");
+               Principal principal1 = new LocalPrincipal("TestPrincipal");
                URL url1 = new URL("https://foo.com/");
                AAAttributeSet inputSet =
                        new AAAttributeSet(
@@ -1329,7 +1329,7 @@ public class ArpTests extends TestCase {
                                + "                     </Rule>"
                                + "     </AttributeReleasePolicy>";
 
-               Principal principal1 = new AuthNPrincipal("TestPrincipal");
+               Principal principal1 = new LocalPrincipal("TestPrincipal");
                URL url1 = new URL("http://www.example.edu/");
                AAAttributeSet inputSet =
                        new AAAttributeSet(
@@ -1372,7 +1372,7 @@ public class ArpTests extends TestCase {
                                + "                     </Rule>"
                                + "     </AttributeReleasePolicy>";
 
-               Principal principal1 = new AuthNPrincipal("TestPrincipal");
+               Principal principal1 = new LocalPrincipal("TestPrincipal");
                URL url1 = new URL("http://www.example.edu/index.html");
                AAAttributeSet inputSet =
                        new AAAttributeSet(
@@ -1420,7 +1420,7 @@ public class ArpTests extends TestCase {
                                + "                     </Rule>"
                                + "     </AttributeReleasePolicy>";
 
-               Principal principal1 = new AuthNPrincipal("TestPrincipal");
+               Principal principal1 = new LocalPrincipal("TestPrincipal");
                URL url1 = new URL("https://www.example.edu/index.html");
                AAAttributeSet inputSet =
                        new AAAttributeSet(
@@ -1480,7 +1480,7 @@ public class ArpTests extends TestCase {
                                + "                     </Rule>"
                                + "     </AttributeReleasePolicy>";
 
-               Principal principal1 = new AuthNPrincipal("TestPrincipal");
+               Principal principal1 = new LocalPrincipal("TestPrincipal");
                URL url1 = new URL("https://www.example.edu/index.html");
                AAAttributeSet inputSet =
                        new AAAttributeSet(
@@ -1541,7 +1541,7 @@ public class ArpTests extends TestCase {
                                + "                     </Rule>"
                                + "     </AttributeReleasePolicy>";
 
-               Principal principal1 = new AuthNPrincipal("TestPrincipal");
+               Principal principal1 = new LocalPrincipal("TestPrincipal");
                URL url1 = new URL("http://www.example.edu/");
                AAAttributeSet inputSet =
                        new AAAttributeSet(
@@ -1599,7 +1599,7 @@ public class ArpTests extends TestCase {
                                + "                     </Rule>"
                                + "     </AttributeReleasePolicy>";
 
-               Principal principal1 = new AuthNPrincipal("TestPrincipal");
+               Principal principal1 = new LocalPrincipal("TestPrincipal");
                URL url1 = new URL("http://www.example.edu/");
                AAAttributeSet inputSet =
                        new AAAttributeSet(
@@ -1705,7 +1705,7 @@ public class ArpTests extends TestCase {
                                + "                     </Rule>"
                                + "     </AttributeReleasePolicy>";
 
-               Principal principal1 = new AuthNPrincipal("TestPrincipal");
+               Principal principal1 = new LocalPrincipal("TestPrincipal");
                URL url1 = new URL("http://www.example.edu/test/index.html");
 
                AAAttributeSet inputSet =
@@ -1842,7 +1842,7 @@ public class ArpTests extends TestCase {
                                + "                     </Rule>"
                                + "     </AttributeReleasePolicy>";
 
-               Principal principal1 = new AuthNPrincipal("TestPrincipal");
+               Principal principal1 = new LocalPrincipal("TestPrincipal");
                URL url1 = new URL("http://www.external.com/");
 
                AAAttributeSet inputSet =
@@ -1918,7 +1918,7 @@ public class ArpTests extends TestCase {
                                + "                     </Rule>"
                                + "     </AttributeReleasePolicy>";
 
-               Principal principal1 = new AuthNPrincipal("Test2Principal");
+               Principal principal1 = new LocalPrincipal("Test2Principal");
                URL url1 = new URL("http://www.example.edu/index.html");
                AAAttributeSet inputSet =
                        new AAAttributeSet(
@@ -1966,7 +1966,7 @@ public class ArpTests extends TestCase {
                                + "                     </Rule>"
                                + "     </AttributeReleasePolicy>";
 
-               Principal principal1 = new AuthNPrincipal("Test2Principal");
+               Principal principal1 = new LocalPrincipal("Test2Principal");
                URL url1 = new URL("http://www.example.edu/index.html");
                AAAttributeSet inputSet =
                        new AAAttributeSet(
@@ -2017,7 +2017,7 @@ public class ArpTests extends TestCase {
                                + "                     </Rule>"
                                + "     </AttributeReleasePolicy>";
 
-               Principal principal1 = new AuthNPrincipal("Test2Principal");
+               Principal principal1 = new LocalPrincipal("Test2Principal");
                URL url1 = new URL("http://www.example.edu/index.html");
                AAAttributeSet inputSet =
                        new AAAttributeSet(
index e01d591..6dc5919 100644 (file)
@@ -63,7 +63,7 @@ import org.opensaml.SAMLException;
 import edu.internet2.middleware.shibboleth.aa.AAAttribute;
 import edu.internet2.middleware.shibboleth.aa.AAAttributeSet;
 import edu.internet2.middleware.shibboleth.aa.attrresolv.provider.ScopedStringValueHandler;
-import edu.internet2.middleware.shibboleth.common.AuthNPrincipal;
+import edu.internet2.middleware.shibboleth.common.LocalPrincipal;
 
 /**
  * Validation suite for the <code>AttributeResolver</code>.
@@ -113,7 +113,7 @@ public class ResolverTests extends TestCase {
                                                        new Object[] { "urn:mace:example.edu:exampleEntitlement" })
                                                });
 
-                       ar.resolveAttributes(new AuthNPrincipal("mytestuser"), "shar.example.edu", inputAttributes);
+                       ar.resolveAttributes(new LocalPrincipal("mytestuser"), "shar.example.edu", inputAttributes);
 
                        assertEquals("Attribute Resolver returned unexpected attribute set.", inputAttributes, outputAttributes);
 
@@ -152,7 +152,7 @@ public class ResolverTests extends TestCase {
                                        new ScopedStringValueHandler("example.edu"))
                                });
 
-                       ar.resolveAttributes(new AuthNPrincipal("mytestuser"), "shar.example.edu", inputAttributes);
+                       ar.resolveAttributes(new LocalPrincipal("mytestuser"), "shar.example.edu", inputAttributes);
                        assertEquals("Attribute Resolver returned unexpected attribute set.", inputAttributes, outputAttributes);
 
                } catch (AttributeResolverException e) {
@@ -229,7 +229,7 @@ public class ResolverTests extends TestCase {
                                new AAAttributeSet(new AAAttribute[] { new AAAttribute("myAffiliation", new Object[] { "member" })
                        });
 
-                       ar.resolveAttributes(new AuthNPrincipal("mytestuser"), "shar.example.edu", inputAttributes);
+                       ar.resolveAttributes(new LocalPrincipal("mytestuser"), "shar.example.edu", inputAttributes);
                        assertEquals("Attribute Resolver returned unexpected attribute set.", inputAttributes, outputAttributes);
 
                } catch (AttributeResolverException e) {
@@ -267,7 +267,7 @@ public class ResolverTests extends TestCase {
                                                        new Object[] { "urn:mace:example.edu:exampleEntitlement" })
                                                });
 
-                       ar.resolveAttributes(new AuthNPrincipal("mytestuser"), "shar.example.edu", inputAttributes);
+                       ar.resolveAttributes(new LocalPrincipal("mytestuser"), "shar.example.edu", inputAttributes);
 
                        assertEquals("Attribute Resolver returned unexpected attribute set.", inputAttributes, outputAttributes);
 
@@ -299,7 +299,7 @@ public class ResolverTests extends TestCase {
                                                        new ScopedStringValueHandler("example.edu"))
                                                });
 
-                       ar.resolveAttributes(new AuthNPrincipal("mytestuser"), "shar.example.edu", inputAttributes);
+                       ar.resolveAttributes(new LocalPrincipal("mytestuser"), "shar.example.edu", inputAttributes);
 
                        assertEquals("Attribute Resolver returned unexpected attribute set.", inputAttributes, outputAttributes);
 
@@ -324,7 +324,7 @@ public class ResolverTests extends TestCase {
 
                        AAAttributeSet outputAttributes = new AAAttributeSet();
 
-                       ar.resolveAttributes(new AuthNPrincipal("mytestuser"), "shar.example.edu", inputAttributes);
+                       ar.resolveAttributes(new LocalPrincipal("mytestuser"), "shar.example.edu", inputAttributes);
 
                        assertEquals("Attribute Resolver returned unexpected attribute set.", inputAttributes, outputAttributes);
 
@@ -349,7 +349,7 @@ public class ResolverTests extends TestCase {
 
                        AAAttributeSet outputAttributes = new AAAttributeSet();
 
-                       ar.resolveAttributes(new AuthNPrincipal("mytestuser"), "shar.example.edu", inputAttributes);
+                       ar.resolveAttributes(new LocalPrincipal("mytestuser"), "shar.example.edu", inputAttributes);
 
                        assertEquals("Attribute Resolver returned unexpected attribute set.", inputAttributes, outputAttributes);
                } catch (ClassCastException e) {
@@ -386,7 +386,7 @@ public class ResolverTests extends TestCase {
                                                new AAAttribute("urn:mace:shibboleth:test:eduPersonAffiliation", new Object[] { "member" })
                                        });
 
-                       ar.resolveAttributes(new AuthNPrincipal("mytestuser"), "shar.example.edu", inputAttributes);
+                       ar.resolveAttributes(new LocalPrincipal("mytestuser"), "shar.example.edu", inputAttributes);
 
                        assertEquals("Attribute Resolver returned unexpected attribute set.", inputAttributes, outputAttributes);