Initial configuration code for profile handlers
authorlajoie <lajoie@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Sun, 20 May 2007 15:23:39 +0000 (15:23 +0000)
committerlajoie <lajoie@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Sun, 20 May 2007 15:23:39 +0000 (15:23 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@2202 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

resources/classpath/schema/shibboleth-2.0-idp-profile.xsd
resources/conf/protocol.xml
src/edu/internet2/middleware/shibboleth/idp/config/profile/AbstractSAML1ProfileHandlerBeanDefinitionParser.java [new file with mode: 0644]
src/edu/internet2/middleware/shibboleth/idp/config/profile/AbstractSAML2ProfileHandlerBeanDefinitionParser.java [new file with mode: 0644]
src/edu/internet2/middleware/shibboleth/idp/config/profile/AbstractSAMLProfileHandlerBeanDefinitionParser.java [new file with mode: 0644]
src/edu/internet2/middleware/shibboleth/idp/config/profile/IdPProfileHandlerNamespaceHandler.java [new file with mode: 0644]
src/edu/internet2/middleware/shibboleth/idp/config/profile/SAML2AttributeQueryProfileHandlerBeanDefinitionParser.java [new file with mode: 0644]
src/edu/internet2/middleware/shibboleth/idp/config/profile/SAML2SSOProfileHandlerBeanDefinitionParser.java [new file with mode: 0644]

index 533a69d..737c503 100644 (file)
             <documentation>Base type for Shibboleth IdP profile handlers.</documentation>
         </annotation>
         <complexContent>
-            <extension base="ph:ProfileHandlerType">
-                <attribute name="relyingPartyManagerId" type="string"
-                    default="shibboleth.RelyingPartyConfigurationManager">
-                    <annotation>
-                        <documentation>
-                            The component ID of the relying party configuration manager to use with the profile handler.
-
-                            This setting should not be changed from its default unless the deployer fully understands
-                            the inter-relationship between IdP components.
-                        </documentation>
-                    </annotation>
-                </attribute>
-                <attribute name="sessionManagerId" type="string" default="shibboleth.SessionManager">
-                    <annotation>
-                        <documentation>
-                            The component ID of the session manager to use with the profile handler.
-
-                            This setting should not be changed from its default unless the deployer fully understands
-                            the inter-relationship between IdP components.
-                        </documentation>
-                    </annotation>
-                </attribute>
-                <attribute name="securityPolicyFactoryId" type="string" default="shibboleth.SecurityPolicyFactory">
-                    <annotation>
-                        <documentation>
-                            The component ID of the security policy factory to use with the profile handler.
-
-                            This setting should not be changed from its default unless the deployer fully understands
-                            the inter-relationship between IdP components.
-                        </documentation>
-                    </annotation>
-                </attribute>
-                <attribute name="trustEngineId" type="string" default="shibboleth.TrustEngine">
-                    <annotation>
-                        <documentation>
-                            The component ID of the trust engine to use with the profile handler.
-
-                            This setting should not be changed from its default unless the deployer fully understands
-                            the inter-relationship between IdP components.
-                        </documentation>
-                    </annotation>
-                </attribute>
-            </extension>
+            <extension base="ph:ProfileHandlerType" />
         </complexContent>
     </complexType>
 
index 32cc1f8..0f4858d 100644 (file)
@@ -7,8 +7,6 @@
                                      urn:mace:shibboleth:2.0:idp:profiles classpath:/schema/shibboleth-2.0-idp-profile.xsd">
 
     <ErrorHandler xsi:type="JSPErrorHandler" jspPagePath="/error.jsp" />
-    
-    <!-- ErrorHandler xsi:type="VelocityErrorHandler" jspPagePath="error.jsp" /-->
 
     <ProfileHandler xsi:type="idpProfile:SAML2SSO">
         <RequestPath>/shibboleth/IdP/saml2/HTTP/SSO</RequestPath>
diff --git a/src/edu/internet2/middleware/shibboleth/idp/config/profile/AbstractSAML1ProfileHandlerBeanDefinitionParser.java b/src/edu/internet2/middleware/shibboleth/idp/config/profile/AbstractSAML1ProfileHandlerBeanDefinitionParser.java
new file mode 100644 (file)
index 0000000..6b67bec
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Copyright [2007] [University Corporation for Advanced Internet Development, Inc.]
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package edu.internet2.middleware.shibboleth.idp.config.profile;
+
+import org.springframework.beans.factory.support.BeanDefinitionBuilder;
+import org.w3c.dom.Element;
+
+/**
+ * Base class for SAML 1 profile handler configuration parsers.
+ */
+public abstract class AbstractSAML1ProfileHandlerBeanDefinitionParser extends
+        AbstractSAMLProfileHandlerBeanDefinitionParser {
+
+    /** {@inheritDoc} */
+    protected void doParse(Element config, BeanDefinitionBuilder builder) {
+        super.doParse(config, builder);
+    }
+}
\ No newline at end of file
diff --git a/src/edu/internet2/middleware/shibboleth/idp/config/profile/AbstractSAML2ProfileHandlerBeanDefinitionParser.java b/src/edu/internet2/middleware/shibboleth/idp/config/profile/AbstractSAML2ProfileHandlerBeanDefinitionParser.java
new file mode 100644 (file)
index 0000000..12f14ce
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Copyright [2007] [University Corporation for Advanced Internet Development, Inc.]
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package edu.internet2.middleware.shibboleth.idp.config.profile;
+
+import org.springframework.beans.factory.support.BeanDefinitionBuilder;
+import org.w3c.dom.Element;
+
+/**
+ * Base class for SAML 2 profile handler configuration parsers.
+ */
+public abstract class AbstractSAML2ProfileHandlerBeanDefinitionParser extends
+        AbstractSAMLProfileHandlerBeanDefinitionParser {
+
+    /** {@inheritDoc} */
+    protected void doParse(Element config, BeanDefinitionBuilder builder) {
+        super.doParse(config, builder);
+    }
+}
\ No newline at end of file
diff --git a/src/edu/internet2/middleware/shibboleth/idp/config/profile/AbstractSAMLProfileHandlerBeanDefinitionParser.java b/src/edu/internet2/middleware/shibboleth/idp/config/profile/AbstractSAMLProfileHandlerBeanDefinitionParser.java
new file mode 100644 (file)
index 0000000..9fdeec8
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Copyright [2007] [University Corporation for Advanced Internet Development, Inc.]
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package edu.internet2.middleware.shibboleth.idp.config.profile;
+
+import org.springframework.beans.factory.support.BeanDefinitionBuilder;
+import org.w3c.dom.Element;
+
+import edu.internet2.middleware.shibboleth.common.config.profile.AbstractProfileHandlerBeanDefinitionParser;
+
+/**
+ * Base class for SAML profile handler configuration parsers.
+ */
+public abstract class AbstractSAMLProfileHandlerBeanDefinitionParser extends
+        AbstractProfileHandlerBeanDefinitionParser {
+
+    /** {@inheritDoc} */
+    protected void doParse(Element config, BeanDefinitionBuilder builder) {
+        super.doParse(config, builder);
+
+        builder.addPropertyReference("messageDecoderFactory", config.getAttributeNS(null, "messageDecoderFactoryId"));
+
+        builder.addPropertyReference("messageEncoderFactory", config.getAttributeNS(null, "messageEncoderFactoryId"));
+    }
+}
\ No newline at end of file
diff --git a/src/edu/internet2/middleware/shibboleth/idp/config/profile/IdPProfileHandlerNamespaceHandler.java b/src/edu/internet2/middleware/shibboleth/idp/config/profile/IdPProfileHandlerNamespaceHandler.java
new file mode 100644 (file)
index 0000000..6dcc6ff
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Copyright [2007] [University Corporation for Advanced Internet Development, Inc.]
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package edu.internet2.middleware.shibboleth.idp.config.profile;
+
+import edu.internet2.middleware.shibboleth.common.config.BaseSpringNamespaceHandler;
+
+/**
+ * Spring namespace handler for IdP profile handlers.
+ */
+public class IdPProfileHandlerNamespaceHandler extends BaseSpringNamespaceHandler {
+
+    /** IdP profile handler namespace URI. */
+    public static final String NAMESPACE = "urn:mace:shibboleth:2.0:idp:profiles";
+
+    /** {@inheritDoc} */
+    public void init() {
+        registerBeanDefinitionParser(SAML2AttributeQueryProfileHandlerBeanDefinitionParser.SCHEMA_TYPE,
+                new SAML2AttributeQueryProfileHandlerBeanDefinitionParser());
+
+        registerBeanDefinitionParser(SAML2SSOProfileHandlerBeanDefinitionParser.SCHEMA_TYPE,
+                new SAML2SSOProfileHandlerBeanDefinitionParser());
+    }
+}
\ No newline at end of file
diff --git a/src/edu/internet2/middleware/shibboleth/idp/config/profile/SAML2AttributeQueryProfileHandlerBeanDefinitionParser.java b/src/edu/internet2/middleware/shibboleth/idp/config/profile/SAML2AttributeQueryProfileHandlerBeanDefinitionParser.java
new file mode 100644 (file)
index 0000000..90b6acb
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * Copyright [2007] [University Corporation for Advanced Internet Development, Inc.]
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package edu.internet2.middleware.shibboleth.idp.config.profile;
+
+import javax.xml.namespace.QName;
+
+import org.w3c.dom.Element;
+
+import edu.internet2.middleware.shibboleth.idp.profile.saml2.HTTPSOAPAttributeQuery;
+
+/**
+ * Spring bean definition parser for {@link HTTPSOAPAttributeQuery} profile handlers.
+ */
+public class SAML2AttributeQueryProfileHandlerBeanDefinitionParser extends
+        AbstractSAML2ProfileHandlerBeanDefinitionParser {
+
+    /** Schema type. */
+    public static final QName SCHEMA_TYPE = new QName(IdPProfileHandlerNamespaceHandler.NAMESPACE,
+            "SAML2AttributeQuery");
+
+    /** {@inheritDoc} */
+    protected Class getBeanClass(Element arg0) {
+        return HTTPSOAPAttributeQuery.class;
+    }
+}
\ No newline at end of file
diff --git a/src/edu/internet2/middleware/shibboleth/idp/config/profile/SAML2SSOProfileHandlerBeanDefinitionParser.java b/src/edu/internet2/middleware/shibboleth/idp/config/profile/SAML2SSOProfileHandlerBeanDefinitionParser.java
new file mode 100644 (file)
index 0000000..e4ca635
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * Copyright [2007] [University Corporation for Advanced Internet Development, Inc.]
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package edu.internet2.middleware.shibboleth.idp.config.profile;
+
+import javax.xml.namespace.QName;
+
+import org.springframework.beans.factory.support.BeanDefinitionBuilder;
+import org.w3c.dom.Element;
+
+import edu.internet2.middleware.shibboleth.idp.profile.saml2.AuthenticationRequestBrowserPost;
+
+/**
+ * Spring bean definition parser for {@link AuthenticationRequestBrowserPost} profile handlers.
+ */
+public class SAML2SSOProfileHandlerBeanDefinitionParser extends AbstractSAML2ProfileHandlerBeanDefinitionParser {
+
+    /** Schema type. */
+    public static final QName SCHEMA_TYPE = new QName(IdPProfileHandlerNamespaceHandler.NAMESPACE, "SAML2SSO");
+
+    /** {@inheritDoc} */
+    protected Class getBeanClass(Element arg0) {
+        return AuthenticationRequestBrowserPost.class;
+    }
+
+    /** {@inheritDoc} */
+    protected void doParse(Element config, BeanDefinitionBuilder builder) {
+        super.doParse(config, builder);
+
+        builder.addPropertyReference("authenticationManager", config.getAttributeNS(null, "authenticationManagerId"));
+    }
+}
\ No newline at end of file