geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r555771 - in /geronimo/server/trunk/modules: geronimo-deployment/src/main/java/org/apache/geronimo/deployment/xmlbeans/ geronimo-kernel/src/main/java/org/apache/geronimo/kernel/ geronimo-security-builder/ geronimo-security-builder/src/main/...
Date Thu, 12 Jul 2007 21:22:52 GMT
Author: djencks
Date: Thu Jul 12 14:22:48 2007
New Revision: 555771

URL: http://svn.apache.org/viewvc?view=rev&rev=555771
Log:
GERONIMO-3311 tweak the login-config schema, do some xml munging, and presto, no more server-side
attribute

Added:
    geronimo/server/trunk/modules/geronimo-security-builder/src/main/schema/geronimo-login-config-2.0.xsd
      - copied, changed from r555400, geronimo/server/trunk/modules/geronimo-security-builder/src/main/schema/geronimo-login-config-1.2.xsd
    geronimo/server/trunk/modules/geronimo-security-builder/src/test/
    geronimo/server/trunk/modules/geronimo-security-builder/src/test/java/
    geronimo/server/trunk/modules/geronimo-security-builder/src/test/java/org/
    geronimo/server/trunk/modules/geronimo-security-builder/src/test/java/org/apache/
    geronimo/server/trunk/modules/geronimo-security-builder/src/test/java/org/apache/geronimo/
    geronimo/server/trunk/modules/geronimo-security-builder/src/test/java/org/apache/geronimo/security/
    geronimo/server/trunk/modules/geronimo-security-builder/src/test/java/org/apache/geronimo/security/deployment/
Removed:
    geronimo/server/trunk/modules/geronimo-security-builder/src/main/schema/geronimo-login-config-1.2.xsd
Modified:
    geronimo/server/trunk/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/xmlbeans/XmlBeansUtil.java
    geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/Jsr77Naming.java
    geronimo/server/trunk/modules/geronimo-security-builder/pom.xml
    geronimo/server/trunk/modules/geronimo-security-builder/src/main/java/org/apache/geronimo/security/deployment/LoginConfigBuilder.java
    geronimo/server/trunk/modules/geronimo-security-builder/src/main/schema/xmlconfig.xml

Modified: geronimo/server/trunk/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/xmlbeans/XmlBeansUtil.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/xmlbeans/XmlBeansUtil.java?view=diff&rev=555771&r1=555770&r2=555771
==============================================================================
--- geronimo/server/trunk/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/xmlbeans/XmlBeansUtil.java
(original)
+++ geronimo/server/trunk/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/xmlbeans/XmlBeansUtil.java
Thu Jul 12 14:22:48 2007
@@ -57,8 +57,9 @@
         NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/j2ee/connector", "http://geronimo.apache.org/xml/ns/j2ee/connector-1.2");
         NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/j2ee/connector-1.1", "http://geronimo.apache.org/xml/ns/j2ee/connector-1.2");
         NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/deployment/javabean", "http://geronimo.apache.org/xml/ns/deployment/javabean-1.0");
-        NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/loginconfig", "http://geronimo.apache.org/xml/ns/loginconfig-1.2");
-        NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/loginconfig-1.1", "http://geronimo.apache.org/xml/ns/loginconfig-1.2");
+        NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/loginconfig", "http://geronimo.apache.org/xml/ns/loginconfig-2.0");
+        NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/loginconfig-1.1", "http://geronimo.apache.org/xml/ns/loginconfig-2.0");
+        NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/loginconfig-1.2", "http://geronimo.apache.org/xml/ns/loginconfig-2.0");
         NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/naming", "http://geronimo.apache.org/xml/ns/naming-1.2");
         NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/naming-1.1", "http://geronimo.apache.org/xml/ns/naming-1.2");
         NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/security", "http://geronimo.apache.org/xml/ns/security-1.2");

Modified: geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/Jsr77Naming.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/Jsr77Naming.java?view=diff&rev=555771&r1=555770&r2=555771
==============================================================================
--- geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/Jsr77Naming.java
(original)
+++ geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/Jsr77Naming.java
Thu Jul 12 14:22:48 2007
@@ -76,6 +76,9 @@
 
         String parentType = (String) nameMap.remove(J2EE_TYPE);
         String parentName = (String) nameMap.remove(J2EE_NAME);
+        if (parentType == null) {
+            throw new IllegalArgumentException("parent name must have a j2eeType name component");
+        }
         if (INVALID_GENERIC_PARENT_TYPE.equals(parentType)) {
             throw new IllegalArgumentException("You can't create a child of a generic typed
gbean");
         }

Modified: geronimo/server/trunk/modules/geronimo-security-builder/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-security-builder/pom.xml?view=diff&rev=555771&r1=555770&r2=555771
==============================================================================
--- geronimo/server/trunk/modules/geronimo-security-builder/pom.xml (original)
+++ geronimo/server/trunk/modules/geronimo-security-builder/pom.xml Thu Jul 12 14:22:48 2007
@@ -55,7 +55,7 @@
                 <groupId>org.codehaus.mojo</groupId>
                 <artifactId>xmlbeans-maven-plugin</artifactId>
                 <configuration>
-                    <sourceSchemas>geronimo-subject-info-1.0.xsd,geronimo-security-2.0.xsd,geronimo-credential-store-1.0.xsd,geronimo-login-config-1.2.xsd</sourceSchemas>
+                    <sourceSchemas>geronimo-subject-info-1.0.xsd,geronimo-security-2.0.xsd,geronimo-credential-store-1.0.xsd,geronimo-login-config-2.0.xsd</sourceSchemas>
                 </configuration>
             </plugin>
             

Modified: geronimo/server/trunk/modules/geronimo-security-builder/src/main/java/org/apache/geronimo/security/deployment/LoginConfigBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-security-builder/src/main/java/org/apache/geronimo/security/deployment/LoginConfigBuilder.java?view=diff&rev=555771&r1=555770&r2=555771
==============================================================================
--- geronimo/server/trunk/modules/geronimo-security-builder/src/main/java/org/apache/geronimo/security/deployment/LoginConfigBuilder.java
(original)
+++ geronimo/server/trunk/modules/geronimo-security-builder/src/main/java/org/apache/geronimo/security/deployment/LoginConfigBuilder.java
Thu Jul 12 14:22:48 2007
@@ -24,6 +24,8 @@
 import java.util.Map;
 import java.util.Set;
 
+import javax.xml.namespace.QName;
+
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.deployment.DeploymentContext;
 import org.apache.geronimo.deployment.service.SingleGBeanBuilder;
@@ -63,6 +65,8 @@
  */
 public class LoginConfigBuilder implements XmlReferenceBuilder {
     public static final String LOGIN_CONFIG_NAMESPACE = GerLoginConfigDocument.type.getDocumentElementName().getNamespaceURI();
+    private static final QName LOGIN_MODULE_QNAME = new QName(LOGIN_CONFIG_NAMESPACE, "login-module");
+    private static final QName SERVER_SIDE_QNAME = new QName(null, "server-side");
 
     private final Naming naming;
     private final Map xmlAttributeBuilderMap;
@@ -91,18 +95,28 @@
     }
 
     public ReferencePatterns getReferences(XmlObject xmlObject, DeploymentContext context,
AbstractName parentName, ClassLoader classLoader) throws DeploymentException {
+        List<GBeanData> uses = new ArrayList<GBeanData>();
         GerLoginConfigType loginConfig = (GerLoginConfigType) xmlObject.copy().changeType(GerLoginConfigType.type);
-        XmlOptions xmlOptions = new XmlOptions();
-        xmlOptions.setLoadLineNumbers();
-        Collection errors = new ArrayList();
-        xmlOptions.setErrorListener(errors);
-        if (!loginConfig.validate(xmlOptions)) {
-            throw new DeploymentException("Invalid login configuration:\n" + errors + "\nDescriptor:
" + loginConfig.toString());
-        }
         XmlCursor xmlCursor = loginConfig.newCursor();
-        List<GBeanData> uses = new ArrayList<GBeanData>();
-        Set<String> loginModuleNames = new HashSet<String>();
+        xmlCursor.push();
         try {
+            //munge xml
+            if (xmlCursor.toChild(LOGIN_MODULE_QNAME)) {
+                do {
+                    xmlCursor.removeAttribute(SERVER_SIDE_QNAME);
+                } while (xmlCursor.toNextSibling(LOGIN_MODULE_QNAME));
+            }
+            xmlCursor.pop();
+            //validate
+            XmlOptions xmlOptions = new XmlOptions();
+            xmlOptions.setLoadLineNumbers();
+            Collection errors = new ArrayList();
+            xmlOptions.setErrorListener(errors);
+            if (!loginConfig.validate(xmlOptions)) {
+                throw new DeploymentException("Invalid login configuration:\n" + errors +
"\nDescriptor: " + loginConfig.toString());
+            }
+            //find the login modules
+            Set<String> loginModuleNames = new HashSet<String>();
             boolean atStart = true;
             while ((atStart && xmlCursor.toFirstChild()) || (!atStart &&
xmlCursor.toNextSibling())) {
                 atStart = false;
@@ -198,8 +212,7 @@
                 }
                 context.addGBean(data);
             }
-        }
-        catch (GBeanAlreadyExistsException e) {
+        } catch (GBeanAlreadyExistsException e) {
             throw new DeploymentException(e);
         } finally {
             xmlCursor.dispose();
@@ -225,7 +238,7 @@
         GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(LoginConfigBuilder.class,
"XmlReferenceBuilder");
         infoBuilder.addAttribute("kernel", Kernel.class, false, false);
         infoBuilder.addReference("xmlAttributeBuilders", XmlAttributeBuilder.class, "XmlAttributeBuilder");
-        infoBuilder.setConstructor(new String[] {"kernel", "xmlAttributeBuilders"});
+        infoBuilder.setConstructor(new String[]{"kernel", "xmlAttributeBuilders"});
         infoBuilder.addInterface(XmlReferenceBuilder.class);
         GBEAN_INFO = infoBuilder.getBeanInfo();
 

Copied: geronimo/server/trunk/modules/geronimo-security-builder/src/main/schema/geronimo-login-config-2.0.xsd
(from r555400, geronimo/server/trunk/modules/geronimo-security-builder/src/main/schema/geronimo-login-config-1.2.xsd)
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-security-builder/src/main/schema/geronimo-login-config-2.0.xsd?view=diff&rev=555771&p1=geronimo/server/trunk/modules/geronimo-security-builder/src/main/schema/geronimo-login-config-1.2.xsd&r1=555400&p2=geronimo/server/trunk/modules/geronimo-security-builder/src/main/schema/geronimo-login-config-2.0.xsd&r2=555771
==============================================================================
--- geronimo/server/trunk/modules/geronimo-security-builder/src/main/schema/geronimo-login-config-1.2.xsd
(original)
+++ geronimo/server/trunk/modules/geronimo-security-builder/src/main/schema/geronimo-login-config-2.0.xsd
Thu Jul 12 14:22:48 2007
@@ -20,11 +20,11 @@
 
 <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
     xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
-    xmlns:geronimo="http://geronimo.apache.org/xml/ns/loginconfig-1.2"
-    targetNamespace="http://geronimo.apache.org/xml/ns/loginconfig-1.2"
+    xmlns:geronimo="http://geronimo.apache.org/xml/ns/loginconfig-2.0"
+    targetNamespace="http://geronimo.apache.org/xml/ns/loginconfig-2.0"
     xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2"
     elementFormDefault="qualified" attributeFormDefault="unqualified"
-    version="1.0">
+    version="2.0">
 
     <xsd:annotation>
         <xsd:documentation>
@@ -32,13 +32,13 @@
             use for particular security module. Login module configuration is
             specified by the level element as login-config with namespace
             specified as xmlns =
-            "http://geronimo.apache.org/xml/ns/loginconfig-1.2". The default
-            location for this document is
-            http://geronimo.apache.org/schemas-1.2/geronimo-login-config-1.2.xsd
+            "http://geronimo.apache.org/xml/ns/loginconfig-2.0". The default
+            location for this document is somewhere vaguely related to
+            http://geronimo.apache.org/schemas-1.2/geronimo-login-config-2.0.xsd
             The definition of the XML format for storing login-config should
             look like this:
             <![CDATA[
-            <login-config xmlns="http://geronimo.apache.org/xml/ns/loginconfig-1.2">
+            <login-config xmlns="http://geronimo.apache.org/xml/ns/loginconfig-2.0">
                 <login-module control-flag="REQUIRED">
                     <login-domain-name>
                         some-name
@@ -86,8 +86,7 @@
         <xsd:sequence>
             <xsd:choice minOccurs="0" maxOccurs="unbounded">
                 <xsd:element name="login-module-ref"
-                    type="geronimo:login-module-refType" minOccurs="0"
-                    maxOccurs="unbounded">
+                    type="geronimo:login-module-refType">
                     <xsd:annotation>
                         <xsd:documentation>
                             The login-module-ref element defines a reference to
@@ -97,8 +96,7 @@
                     </xsd:annotation>
                 </xsd:element>
                 <xsd:element name="login-module"
-                    type="geronimo:login-moduleType" minOccurs="0"
-                    maxOccurs="unbounded">
+                    type="geronimo:login-moduleType">
                     <xsd:annotation>
                         <xsd:documentation>
                             The login-module element defines a new login module
@@ -243,19 +241,6 @@
                     </xsd:element>
                     <xsd:element name="xml-option" type="sys:xml-attributeType" minOccurs="0"
maxOccurs="unbounded"/>
                 </xsd:sequence>
-                <xsd:attribute name="server-side" type="xsd:boolean"
-                    use="required">
-                    <xsd:annotation>
-                        <xsd:documentation>
-                            An additional server-side attribute to specify that
-                            this login module will do all its processing on
-                            server side. In the case of a client call the
-                            information will be passed to server and all the
-                            processing will be done on server side by login
-                            module.
-                        </xsd:documentation>
-                    </xsd:annotation>
-                </xsd:attribute>
             </xsd:extension>
         </xsd:complexContent>
     </xsd:complexType>

Modified: geronimo/server/trunk/modules/geronimo-security-builder/src/main/schema/xmlconfig.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-security-builder/src/main/schema/xmlconfig.xml?view=diff&rev=555771&r1=555770&r2=555771
==============================================================================
--- geronimo/server/trunk/modules/geronimo-security-builder/src/main/schema/xmlconfig.xml
(original)
+++ geronimo/server/trunk/modules/geronimo-security-builder/src/main/schema/xmlconfig.xml
Thu Jul 12 14:22:48 2007
@@ -31,7 +31,7 @@
         <xb:prefix>Ger</xb:prefix>
     </xb:namespace>
 
-    <xb:namespace uri="http://geronimo.apache.org/xml/ns/loginconfig-1.2">
+    <xb:namespace uri="http://geronimo.apache.org/xml/ns/loginconfig-2.0">
         <xb:package>org.apache.geronimo.xbeans.geronimo.loginconfig</xb:package>
         <xb:prefix>Ger</xb:prefix>
     </xb:namespace>



Mime
View raw message