Rename AssertionConsumer
authorgilbert <gilbert@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Wed, 1 Jun 2005 18:35:06 +0000 (18:35 +0000)
committergilbert <gilbert@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Wed, 1 Jun 2005 18:35:06 +0000 (18:35 +0000)
Change builtin class names in SP configuration type= plugin attributes
Wrap ShibbolethTrust so it impliments the pluggable interface

git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@1598 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

src/edu/internet2/middleware/shibboleth/serviceprovider/AssertionConsumerServlet.java [moved from src/edu/internet2/middleware/shibboleth/serviceprovider/AuthenticationAssertionConsumerServlet.java with 98% similarity]
src/edu/internet2/middleware/shibboleth/serviceprovider/FilterSupportImpl.java
src/edu/internet2/middleware/shibboleth/serviceprovider/ServiceProviderConfig.java
src/edu/internet2/middleware/shibboleth/serviceprovider/ShibbolethTrustPluggable.java [new file with mode: 0644]

@@ -85,7 +85,7 @@ import edu.internet2.middleware.shibboleth.serviceprovider.ServiceProviderConfig
  * 
  * @author Howard Gilbert
  */
-public class AuthenticationAssertionConsumerServlet extends HttpServlet {
+public class AssertionConsumerServlet extends HttpServlet {
 
        private static Logger log = null;
        
@@ -136,7 +136,7 @@ public class AuthenticationAssertionConsumerServlet extends HttpServlet {
                Logger.getRootLogger().setLevel((Level) Level.INFO);
                rootAppender.setLayout(new PatternLayout("%d{ISO8601} %-5p %-41X{serviceId} - %m%n"));
 */
-               log = Logger.getLogger(AuthenticationAssertionConsumerServlet.class.getName());
+               log = Logger.getLogger(AssertionConsumerServlet.class.getName());
                
                ServletContextInitializer.initServiceProvider(servletContext);
                AuthenticationFilter.setFilterSupport(new FilterSupportImpl());
@@ -173,7 +173,7 @@ public class AuthenticationAssertionConsumerServlet extends HttpServlet {
             String applicationId = config.mapRequest(target);
             ApplicationInfo appinfo = config.getApplication(applicationId);
             Sessions appSessionValues = appinfo.getApplicationConfig().getSessions();
-            String shireURL = appSessionValues.getShireURL();
+            String shireURL = request.getRequestURL().toString();
             String providerId = appinfo.getApplicationConfig().getProviderId();
             
            
index b87bb41..89c0066 100644 (file)
@@ -70,7 +70,7 @@ public class FilterSupportImpl implements FilterSupport {
     }
     
     /**
-     * Get the URL of the local AuthenticationAssertionConsumerServlet.
+     * Get the URL of the local AssertionConsumerServlet.
      * 
      * @param applicationId
      * @return URL string
@@ -163,7 +163,7 @@ public class FilterSupportImpl implements FilterSupport {
             String emptySessionId) {
         String sessionid;
         try {
-            sessionid = AuthenticationAssertionConsumerServlet.createSessionFromPost(
+            sessionid = AssertionConsumerServlet.createSessionFromPost(
                     ipaddr, request, applicationId, shireURL, providerId,emptySessionId);
         } catch (SAMLException e) {
             return null;
index 25fc827..797707d 100644 (file)
@@ -173,6 +173,7 @@ import x0.maceShibbolethTargetConfig1.ShibbolethTargetConfigDocument;
 import x0.maceShibbolethTargetConfig1.ApplicationDocument.Application;
 import x0.maceShibbolethTargetConfig1.ApplicationsDocument.Applications;
 import x0.maceShibbolethTargetConfig1.HostDocument.Host;
+import x0.maceShibbolethTargetConfig1.HostDocument.Host.Scheme.Enum;
 import x0.maceShibbolethTargetConfig1.PathDocument.Path;
 import edu.internet2.middleware.shibboleth.aap.AAP;
 import edu.internet2.middleware.shibboleth.aap.AttributeRule;
@@ -282,15 +283,13 @@ public class ServiceProviderConfig {
         */
 
        private static final String XMLTRUSTPROVIDERTYPE = 
-               "edu.internet2.middleware.shibboleth.common.provider.XMLTrust";
+               "edu.internet2.middleware.shibboleth.common.provider.ShibbolethTrust";
        private static final String XMLAAPPROVIDERTYPE = 
-               "edu.internet2.middleware.shibboleth.serviceprovider.XMLAAP";
+               "edu.internet2.middleware.shibboleth.aap.provider.XMLAAP";
        private static final String XMLFEDERATIONPROVIDERTYPE = 
-               "edu.internet2.middleware.shibboleth.common.provider.XMLMetadata";
-       private static final String XMLREVOCATIONPROVIDERTYPE =
-           "edu.internet2.middleware.shibboleth.common.provider.XMLRevocation";
+               "edu.internet2.middleware.shibboleth.metadata.provider.XMLMetadata";
        private static final String XMLREQUESTMAPPROVIDERTYPE = 
-           "edu.internet2.middleware.shibboleth.serviceprovider.XMLRequestMap";
+           "edu.internet2.middleware.shibboleth.sp.provider.NativeRequestMapProvider";
        private static final String XMLCREDENTIALSPROVIDERTYPE = 
            "edu.internet2.middleware.shibboleth.common.Credentials";
        
@@ -356,30 +355,23 @@ public class ServiceProviderConfig {
         String urlhostname = url.getHost();
         String urlpath = url.getPath();
         int urlport = url.getPort();
-        if (urlport==0) {
-            if (urlscheme.equals("http"))
-                urlport=80;
-            else if (urlscheme.equals("https"))
-                urlport=443;
-        }
         
         // find Host entry for this virtual server
         Host[] hostArray = requestMap.getHostArray();
         for (int ihost=0;ihost<hostArray.length;ihost++) {
             Host host = hostArray[ihost];
-            String hostScheme = host.getScheme().toString();
+            Enum scheme = host.getScheme();
             String hostName = host.getName();
             String hostApplicationId = host.getApplicationId();
             long hostport = host.getPort();
-            if (hostport==0) {
-                if (hostScheme.equals("http"))
-                    hostport=80;
-                else if (hostScheme.equals("https"))
-                    hostport=443;
-            }
             
-            if (!urlscheme.equals(hostScheme) ||
-                !urlhostname.equals(hostName)||
+            if (scheme != null &&
+                !urlscheme.equals(scheme.toString()))
+                continue;
+            if (!urlhostname.equals(hostName))
+                continue;
+            if (hostport!=0 &&
+                urlport!=0 &&    
                 urlport!=hostport)
                 continue;
             
@@ -785,7 +777,7 @@ public class ServiceProviderConfig {
                PluggableType[] pluggable = appinfo.getApplicationConfig().getTrustProviderArray();
                for (int i = 0;i<pluggable.length;i++) {
                    String uri = processPluggable(pluggable[i],
-                           ShibbolethTrust.class,
+                           ShibbolethTrustPluggable.class,
                            Trust.class,
                            XMLTRUSTPROVIDERTYPE,
                            certificateValidators);
@@ -802,6 +794,12 @@ public class ServiceProviderConfig {
        
        private boolean processPluggableRequestMapProvider(){
            LocalConfigurationType shire = config.getSHIRE();
+        if (shire==null)
+            shire = config.getLocal();
+        if (shire==null) {
+            log.error("No Local element.");
+            return true;
+        }
            PluggableType mapProvider = shire.getRequestMapProvider();
            
            String pluggabletype = mapProvider.getType();
diff --git a/src/edu/internet2/middleware/shibboleth/serviceprovider/ShibbolethTrustPluggable.java b/src/edu/internet2/middleware/shibboleth/serviceprovider/ShibbolethTrustPluggable.java
new file mode 100644 (file)
index 0000000..2aa7648
--- /dev/null
@@ -0,0 +1,20 @@
+package edu.internet2.middleware.shibboleth.serviceprovider;
+
+import org.apache.xmlbeans.XmlException;
+import org.w3c.dom.Node;
+
+import edu.internet2.middleware.shibboleth.common.ShibbolethConfigurationException;
+import edu.internet2.middleware.shibboleth.common.provider.ShibbolethTrust;
+
+public class ShibbolethTrustPluggable extends ShibbolethTrust implements
+        PluggableConfigurationComponent {
+
+    public void initialize(Node dom) throws XmlException,
+            ShibbolethConfigurationException {
+    }
+
+    public String getSchemaPathname() {
+       return null;
+    }
+
+}