geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r681163 - in /geronimo/components/jaspi/trunk: geronimo-jaspi-openid/ geronimo-jaspi-openid/src/main/java/org/apache/geronimo/components/jaspi/modules/openid/ geronimo-jaspi-openid/src/test/java/org/apache/geronimo/components/jaspi/modules/...
Date Wed, 30 Jul 2008 18:21:59 GMT
Author: djencks
Date: Wed Jul 30 11:21:58 2008
New Revision: 681163

URL: http://svn.apache.org/viewvc?rev=681163&view=rev
Log:
add some support for using model in little bits, e.g. from geronimo plans

Added:
    geronimo/components/jaspi/trunk/geronimo-jaspi-openid/src/main/java/org/apache/geronimo/components/jaspi/modules/openid/OpenIDProviderPrincipal.java
      - copied, changed from r678946, geronimo/components/jaspi/trunk/geronimo-jaspi-openid/src/main/java/org/apache/geronimo/components/jaspi/modules/openid/IdentifierPrincipal.java
    geronimo/components/jaspi/trunk/geronimo-jaspi-openid/src/test/java/org/apache/geronimo/components/jaspi/modules/openid/OpenIDServerAuthModuleTest.java   (with props)
    geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/ConstantClassLoaderLookup.java   (with props)
    geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/model/JaspiUtil.java   (with props)
    geronimo/components/jaspi/trunk/geronimo-jaspi/src/test/resources/test-client-auth-config.xml   (with props)
    geronimo/components/jaspi/trunk/geronimo-jaspi/src/test/resources/test-client-auth-context.xml   (with props)
    geronimo/components/jaspi/trunk/geronimo-jaspi/src/test/resources/test-client-auth-module.xml   (with props)
    geronimo/components/jaspi/trunk/geronimo-jaspi/src/test/resources/test-config-provider.xml
      - copied, changed from r677988, geronimo/components/jaspi/trunk/geronimo-jaspi/src/test/resources/test-jaspi-2.xml
Modified:
    geronimo/components/jaspi/trunk/geronimo-jaspi-openid/pom.xml
    geronimo/components/jaspi/trunk/geronimo-jaspi-openid/src/main/java/org/apache/geronimo/components/jaspi/modules/openid/OpenIDServerAuthModule.java
    geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/AuthConfigFactoryImpl.java
    geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/model/ClientAuthConfigType.java
    geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/model/ClientAuthContextType.java
    geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/model/ConfigProviderType.java
    geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/model/JaspiXmlUtil.java
    geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/model/KeyedObjectMapAdapter.java
    geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/model/ObjectFactory.java
    geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/model/ServerAuthConfigType.java
    geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/model/ServerAuthContextType.java
    geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/xsd/geronimo-jaspi.xsd
    geronimo/components/jaspi/trunk/geronimo-jaspi/src/test/java/org/apache/geronimo/components/jaspi/AuthConfigFactoryImplTest.java
    geronimo/components/jaspi/trunk/geronimo-jaspi/src/test/java/org/apache/geronimo/components/jaspi/model/JaxbTest.java

Modified: geronimo/components/jaspi/trunk/geronimo-jaspi-openid/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/components/jaspi/trunk/geronimo-jaspi-openid/pom.xml?rev=681163&r1=681162&r2=681163&view=diff
==============================================================================
--- geronimo/components/jaspi/trunk/geronimo-jaspi-openid/pom.xml (original)
+++ geronimo/components/jaspi/trunk/geronimo-jaspi-openid/pom.xml Wed Jul 30 11:21:58 2008
@@ -44,5 +44,18 @@
           <artifactId>geronimo-servlet_3.0_spec</artifactId>
           <version>1.0-EA-SNAPSHOT</version>
       </dependency>
+
+      <dependency>
+          <groupId>org.apache.geronimo.components</groupId>
+          <artifactId>geronimo-jaspi</artifactId>
+          <version>${version}</version>
+          <scope>test</scope>
+      </dependency>
+      <dependency>
+          <groupId>org.testng</groupId>
+          <artifactId>testng</artifactId>
+          <classifier>jdk15</classifier>
+          <scope>test</scope>
+      </dependency>
   </dependencies>
 </project>

Copied: geronimo/components/jaspi/trunk/geronimo-jaspi-openid/src/main/java/org/apache/geronimo/components/jaspi/modules/openid/OpenIDProviderPrincipal.java (from r678946, geronimo/components/jaspi/trunk/geronimo-jaspi-openid/src/main/java/org/apache/geronimo/components/jaspi/modules/openid/IdentifierPrincipal.java)
URL: http://svn.apache.org/viewvc/geronimo/components/jaspi/trunk/geronimo-jaspi-openid/src/main/java/org/apache/geronimo/components/jaspi/modules/openid/OpenIDProviderPrincipal.java?p2=geronimo/components/jaspi/trunk/geronimo-jaspi-openid/src/main/java/org/apache/geronimo/components/jaspi/modules/openid/OpenIDProviderPrincipal.java&p1=geronimo/components/jaspi/trunk/geronimo-jaspi-openid/src/main/java/org/apache/geronimo/components/jaspi/modules/openid/IdentifierPrincipal.java&r1=678946&r2=681163&rev=681163&view=diff
==============================================================================
--- geronimo/components/jaspi/trunk/geronimo-jaspi-openid/src/main/java/org/apache/geronimo/components/jaspi/modules/openid/IdentifierPrincipal.java (original)
+++ geronimo/components/jaspi/trunk/geronimo-jaspi-openid/src/main/java/org/apache/geronimo/components/jaspi/modules/openid/OpenIDProviderPrincipal.java Wed Jul 30 11:21:58 2008
@@ -23,16 +23,16 @@
 import java.security.Principal;
 
 /**
- * @version $Rev:$ $Date:$
+ * @version $Rev$ $Date$
  */
-public class IdentifierPrincipal implements Principal {
+public class OpenIDProviderPrincipal implements Principal {
 
     private final String name;
-    public IdentifierPrincipal(String identifier) {
+    public OpenIDProviderPrincipal(String identifier) {
         name = identifier;
     }
 
     public String getName() {
         return name;
     }
-}
+}
\ No newline at end of file

Modified: geronimo/components/jaspi/trunk/geronimo-jaspi-openid/src/main/java/org/apache/geronimo/components/jaspi/modules/openid/OpenIDServerAuthModule.java
URL: http://svn.apache.org/viewvc/geronimo/components/jaspi/trunk/geronimo-jaspi-openid/src/main/java/org/apache/geronimo/components/jaspi/modules/openid/OpenIDServerAuthModule.java?rev=681163&r1=681162&r2=681163&view=diff
==============================================================================
--- geronimo/components/jaspi/trunk/geronimo-jaspi-openid/src/main/java/org/apache/geronimo/components/jaspi/modules/openid/OpenIDServerAuthModule.java (original)
+++ geronimo/components/jaspi/trunk/geronimo-jaspi-openid/src/main/java/org/apache/geronimo/components/jaspi/modules/openid/OpenIDServerAuthModule.java Wed Jul 30 11:21:58 2008
@@ -23,6 +23,7 @@
 import java.util.Map;
 import java.util.List;
 import java.io.IOException;
+import java.net.URL;
 
 import javax.security.auth.message.module.ServerAuthModule;
 import javax.security.auth.message.MessagePolicy;
@@ -52,7 +53,7 @@
 import org.openid4java.message.ParameterList;
 
 /**
- * @version $Rev:$ $Date:$
+ * @version $Rev$ $Date$
  */
 public class OpenIDServerAuthModule implements ServerAuthModule {
 
@@ -140,6 +141,9 @@
             final IdentifierPrincipal principal = new IdentifierPrincipal(identifier.getIdentifier());
             clientSubject.getPrincipals().add(principal);
             clientSubject.getPrincipals().add(new AuthenticatedPrincipal());
+            DiscoveryInformation discovered = (DiscoveryInformation) session.getAttribute(DISCOVERY_SESSION_KEY);
+            URL opEndpoint = discovered.getOPEndpoint();
+            clientSubject.getPrincipals().add(new OpenIDProviderPrincipal(opEndpoint.toString()));
             CallerPrincipalCallback cpCallback = new CallerPrincipalCallback(clientSubject, principal);
             GroupPrincipalCallback gpCallback = new GroupPrincipalCallback(clientSubject, new String[] {"authenticated"});
             try {

Added: geronimo/components/jaspi/trunk/geronimo-jaspi-openid/src/test/java/org/apache/geronimo/components/jaspi/modules/openid/OpenIDServerAuthModuleTest.java
URL: http://svn.apache.org/viewvc/geronimo/components/jaspi/trunk/geronimo-jaspi-openid/src/test/java/org/apache/geronimo/components/jaspi/modules/openid/OpenIDServerAuthModuleTest.java?rev=681163&view=auto
==============================================================================
--- geronimo/components/jaspi/trunk/geronimo-jaspi-openid/src/test/java/org/apache/geronimo/components/jaspi/modules/openid/OpenIDServerAuthModuleTest.java (added)
+++ geronimo/components/jaspi/trunk/geronimo-jaspi-openid/src/test/java/org/apache/geronimo/components/jaspi/modules/openid/OpenIDServerAuthModuleTest.java Wed Jul 30 11:21:58 2008
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 org.apache.geronimo.components.jaspi.modules.openid;
+
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.message.config.AuthConfigFactory;
+import javax.security.auth.message.config.AuthConfigProvider;
+import javax.security.auth.message.config.ServerAuthConfig;
+import javax.security.auth.message.config.ServerAuthContext;
+import javax.security.auth.message.module.ServerAuthModule;
+
+import org.apache.geronimo.components.jaspi.ConstantClassLoaderLookup;
+import org.apache.geronimo.components.jaspi.model.JaspiUtil;
+import org.apache.geronimo.components.jaspi.model.AuthModuleType;
+import org.testng.annotations.Test;
+
+/**
+ * @version $Rev:$ $Date:$
+ */
+public class OpenIDServerAuthModuleTest {
+
+    @Test
+    public void testServerAuthModule() throws Exception {
+        CallbackHandler callbackHandler = null;
+//        AuthConfigFactoryImpl.staticCallbackHandler = callbackHandler;
+        AuthConfigFactory factory1 = AuthConfigFactory.getFactory();
+        AuthModuleType<ServerAuthModule> authModuleType = new AuthModuleType<ServerAuthModule>();
+        authModuleType.setClassName(OpenIDServerAuthModule.class.getName());
+        AuthConfigProvider authConfigProvider = JaspiUtil.wrapServerAuthModule("Http", "testApp", "id", authModuleType, true, new ConstantClassLoaderLookup(getClass().getClassLoader()), callbackHandler);
+        factory1.registerConfigProvider(authConfigProvider, "Http", "testApp", "description");
+        AuthConfigProvider authConfigProvider2 = factory1.getConfigProvider("Http", "testApp", null);
+        ServerAuthConfig serverAuthConfig = authConfigProvider2.getServerAuthConfig("Http", "testApp", callbackHandler);
+        ServerAuthContext serverAuthContext = serverAuthConfig.getAuthContext("id", null, null);
+        if (serverAuthContext == null) {
+            throw new NullPointerException("no serverAuthContext");
+        }
+    }
+}

Propchange: geronimo/components/jaspi/trunk/geronimo-jaspi-openid/src/test/java/org/apache/geronimo/components/jaspi/modules/openid/OpenIDServerAuthModuleTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/components/jaspi/trunk/geronimo-jaspi-openid/src/test/java/org/apache/geronimo/components/jaspi/modules/openid/OpenIDServerAuthModuleTest.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/components/jaspi/trunk/geronimo-jaspi-openid/src/test/java/org/apache/geronimo/components/jaspi/modules/openid/OpenIDServerAuthModuleTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/AuthConfigFactoryImpl.java
URL: http://svn.apache.org/viewvc/geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/AuthConfigFactoryImpl.java?rev=681163&r1=681162&r2=681163&view=diff
==============================================================================
--- geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/AuthConfigFactoryImpl.java (original)
+++ geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/AuthConfigFactoryImpl.java Wed Jul 30 11:21:58 2008
@@ -47,8 +47,8 @@
  */
 public class AuthConfigFactoryImpl extends AuthConfigFactory {
 
-    private static final File DEFAULT_CONFIG_FILE = new File("config/jaspi.xml");
-    public static File staticConfigFile = DEFAULT_CONFIG_FILE;
+//    private static final File DEFAULT_CONFIG_FILE = new File("config/jaspi.xml");
+    public static File staticConfigFile;// = DEFAULT_CONFIG_FILE;
     public static CallbackHandler staticCallbackHandler;
 
     private static ClassLoader contextClassLoader;
@@ -76,12 +76,7 @@
     }
 
     public AuthConfigFactoryImpl() throws AuthException {
-        this(new ClassLoaderLookup() {
-
-            public ClassLoader getClassLoader(String name) {
-                return contextClassLoader;
-            }
-        }, staticCallbackHandler, staticConfigFile);
+        this(new ConstantClassLoaderLookup(contextClassLoader), staticCallbackHandler, staticConfigFile);
     }
     
     public synchronized String[] detachListener(RegistrationListener listener, String layer, String appContext) throws SecurityException {
@@ -233,6 +228,7 @@
     }
     
     private void loadConfig() throws AuthException {
+        if (configFile != null) {
         try {
             FileReader in = new FileReader(configFile);
             try {
@@ -251,22 +247,25 @@
         } catch (XMLStreamException e) {
             throw (AuthException)new AuthException("Could not read config").initCause(e);
         }
+        }
     }
     
     private void saveConfig() throws AuthException {
-        try {
-            FileWriter out = new FileWriter(configFile);
+        if (configFile != null) {
             try {
-                JaspiXmlUtil.writeJaspi(jaspiType, out);
-            } finally {
-                out.close();
+                FileWriter out = new FileWriter(configFile);
+                try {
+                    JaspiXmlUtil.writeJaspi(jaspiType, out);
+                } finally {
+                    out.close();
+                }
+            } catch (IOException e) {
+                throw (AuthException)new AuthException("Could not write config").initCause(e);
+            } catch (XMLStreamException e) {
+                throw (AuthException)new AuthException("Could not write config").initCause(e);
+            } catch (JAXBException e) {
+                throw (AuthException)new AuthException("Could not write config").initCause(e);
             }
-        } catch (IOException e) {
-            throw (AuthException)new AuthException("Could not write config").initCause(e);
-        } catch (XMLStreamException e) {
-            throw (AuthException)new AuthException("Could not write config").initCause(e);
-        } catch (JAXBException e) {
-            throw (AuthException)new AuthException("Could not write config").initCause(e);
         }
     }
     

Added: geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/ConstantClassLoaderLookup.java
URL: http://svn.apache.org/viewvc/geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/ConstantClassLoaderLookup.java?rev=681163&view=auto
==============================================================================
--- geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/ConstantClassLoaderLookup.java (added)
+++ geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/ConstantClassLoaderLookup.java Wed Jul 30 11:21:58 2008
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 org.apache.geronimo.components.jaspi;
+
+/**
+ * @version $Rev:$ $Date:$
+ */
+public class ConstantClassLoaderLookup implements ClassLoaderLookup {
+
+    private final ClassLoader classLoader;
+
+    public ConstantClassLoaderLookup(ClassLoader classLoader) {
+        this.classLoader = classLoader;
+    }
+
+    public ClassLoader getClassLoader(String name) {
+        return classLoader;
+    }
+    
+}

Propchange: geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/ConstantClassLoaderLookup.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/ConstantClassLoaderLookup.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/ConstantClassLoaderLookup.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/model/ClientAuthConfigType.java
URL: http://svn.apache.org/viewvc/geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/model/ClientAuthConfigType.java?rev=681163&r1=681162&r2=681163&view=diff
==============================================================================
--- geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/model/ClientAuthConfigType.java (original)
+++ geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/model/ClientAuthConfigType.java Wed Jul 30 11:21:58 2008
@@ -27,6 +27,7 @@
 import java.io.Serializable;
 import java.util.Map;
 import java.util.HashMap;
+import java.util.Collections;
 
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
@@ -90,6 +91,18 @@
     @XmlJavaTypeAdapter(KeyedObjectMapAdapter.class)
     protected Map<String, ClientAuthContextType> clientAuthContext;
 
+
+    public ClientAuthConfigType() {
+    }
+
+    public ClientAuthConfigType(ClientAuthContextType clientAuthContextType, boolean _protected) {
+        this.messageLayer = clientAuthContextType.getMessageLayer();
+        this.appContext = clientAuthContextType.getAppContext();
+        this.authenticationContextID = clientAuthContextType.getAuthenticationContextID();
+        this.clientAuthContext = Collections.singletonMap(clientAuthContextType.getKey(), clientAuthContextType);
+        this._protected = _protected;
+    }
+
     /**
      * Gets the value of the messageLayer property.
      * 

Modified: geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/model/ClientAuthContextType.java
URL: http://svn.apache.org/viewvc/geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/model/ClientAuthContextType.java?rev=681163&r1=681162&r2=681163&view=diff
==============================================================================
--- geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/model/ClientAuthContextType.java (original)
+++ geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/model/ClientAuthContextType.java Wed Jul 30 11:21:58 2008
@@ -27,6 +27,7 @@
 import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Collections;
 
 import javax.security.auth.Subject;
 import javax.security.auth.callback.CallbackHandler;
@@ -82,6 +83,17 @@
     protected String authenticationContextID;
     protected List<AuthModuleType<ClientAuthModule>> clientAuthModule;
 
+
+    public ClientAuthContextType() {
+    }
+
+    public ClientAuthContextType(String messageLayer, String appContext, String authenticationContextID, AuthModuleType<ClientAuthModule> clientAuthModule) {
+        this.messageLayer = messageLayer;
+        this.appContext = appContext;
+        this.authenticationContextID = authenticationContextID;
+        this.clientAuthModule = Collections.singletonList(clientAuthModule);
+    }
+
     /**
      * Gets the value of the messageLayer property.
      *

Modified: geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/model/ConfigProviderType.java
URL: http://svn.apache.org/viewvc/geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/model/ConfigProviderType.java?rev=681163&r1=681162&r2=681163&view=diff
==============================================================================
--- geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/model/ConfigProviderType.java (original)
+++ geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/model/ConfigProviderType.java Wed Jul 30 11:21:58 2008
@@ -355,7 +355,7 @@
 
     public void initialize(ClassLoaderLookup classLoaderLookup, CallbackHandler callbackHandler) throws AuthException {
         if (className == null) {
-            provider = new ConfigProviderImpl(this, classLoaderLookup);
+            provider = new ConfigProviderImpl(getClientAuthConfig(), getServerAuthConfig(), classLoaderLookup);
         } else {
             final ClassLoader classLoader = classLoaderLookup.getClassLoader(classLoaderName);
             try {
@@ -391,12 +391,15 @@
 
     public static class ConfigProviderImpl implements AuthConfigProvider {
 
-        private final ConfigProviderType configProviderType;
+//        private final ConfigProviderType configProviderType;
         private final ClassLoaderLookup classLoaderLookup;
+        private final Map<String, ClientAuthConfigType> clientConfigTypeMap;
+        private final Map<String, ServerAuthConfigType> serverAuthConfigMap;
 
-        public ConfigProviderImpl(ConfigProviderType configProviderType, ClassLoaderLookup classLoaderLookup) {
-            this.configProviderType = configProviderType;
+        public ConfigProviderImpl(Map<String, ClientAuthConfigType> clientConfigTypeMap, Map<String, ServerAuthConfigType> serverAuthConfigMap, ClassLoaderLookup classLoaderLookup) {
             this.classLoaderLookup = classLoaderLookup;
+            this.clientConfigTypeMap = clientConfigTypeMap;
+            this.serverAuthConfigMap = serverAuthConfigMap;
         }
 
         /**
@@ -415,16 +418,15 @@
             if (appContext == null) {
                 throw new NullPointerException("appContext");
             }
-            final Map<String, ClientAuthConfigType> configTypeMap = configProviderType.getClientAuthConfig();
-            ClientAuthConfigType ctx = configTypeMap.get(getRegistrationKey(layer, appContext));
+            ClientAuthConfigType ctx = clientConfigTypeMap.get(getRegistrationKey(layer, appContext));
             if (ctx == null) {
-                ctx = configTypeMap.get(getRegistrationKey(null, appContext));
+                ctx = clientConfigTypeMap.get(getRegistrationKey(null, appContext));
             }
             if (ctx == null) {
-                ctx = configTypeMap.get(getRegistrationKey(layer, null));
+                ctx = clientConfigTypeMap.get(getRegistrationKey(layer, null));
             }
             if (ctx == null) {
-                ctx = configTypeMap.get(getRegistrationKey(null, null));
+                ctx = clientConfigTypeMap.get(getRegistrationKey(null, null));
             }
             if (ctx != null) {
                 
@@ -440,15 +442,15 @@
             if (appContext == null) {
                 throw new NullPointerException("appContext");
             }
-            ServerAuthConfigType ctx = configProviderType.getServerAuthConfig().get(getRegistrationKey(layer, appContext));
+            ServerAuthConfigType ctx = serverAuthConfigMap.get(getRegistrationKey(layer, appContext));
             if (ctx == null) {
-                ctx = configProviderType.getServerAuthConfig().get(getRegistrationKey(null, appContext));
+                ctx = serverAuthConfigMap.get(getRegistrationKey(null, appContext));
             }
             if (ctx == null) {
-                ctx = configProviderType.getServerAuthConfig().get(getRegistrationKey(layer, null));
+                ctx = serverAuthConfigMap.get(getRegistrationKey(layer, null));
             }
             if (ctx == null) {
-                ctx = configProviderType.getServerAuthConfig().get(getRegistrationKey(null, null));
+                ctx = serverAuthConfigMap.get(getRegistrationKey(null, null));
             }
             if (ctx != null) {
 

Added: geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/model/JaspiUtil.java
URL: http://svn.apache.org/viewvc/geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/model/JaspiUtil.java?rev=681163&view=auto
==============================================================================
--- geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/model/JaspiUtil.java (added)
+++ geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/model/JaspiUtil.java Wed Jul 30 11:21:58 2008
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 org.apache.geronimo.components.jaspi.model;
+
+import java.util.Map;
+import java.util.Collections;
+
+import javax.security.auth.message.config.AuthConfigProvider;
+import javax.security.auth.message.config.ClientAuthConfig;
+import javax.security.auth.message.AuthException;
+import javax.security.auth.message.module.ClientAuthModule;
+import javax.security.auth.message.module.ServerAuthModule;
+import javax.security.auth.callback.CallbackHandler;
+
+import org.apache.geronimo.components.jaspi.ClassLoaderLookup;
+
+/**
+ * Convenience methods to wrap various jaspi objects into AuthConfigProvider instances, ready to be registered.
+ * @version $Rev:$ $Date:$
+ */
+public class JaspiUtil {
+
+    private JaspiUtil() {
+    }
+
+    public static AuthConfigProvider wrapClientAuthConfig(ClientAuthConfigType clientAuthConfigType, ClassLoaderLookup classLoaderLookup, CallbackHandler callbackHandler) throws AuthException {
+        Map<String, ClientAuthConfigType> clientAuthConfig = Collections.singletonMap(clientAuthConfigType.getKey(), clientAuthConfigType);
+        return new ConfigProviderType.ConfigProviderImpl(clientAuthConfig, Collections.<String, ServerAuthConfigType>emptyMap(), classLoaderLookup);
+    }
+
+    public static AuthConfigProvider wrapClientAuthContext(ClientAuthContextType clientAuthContextType, boolean _protected, ClassLoaderLookup classLoaderLookup, CallbackHandler callbackHandler) throws AuthException {
+        ClientAuthConfigType clientAuthConfigType = new ClientAuthConfigType(clientAuthContextType, _protected);
+        return wrapClientAuthConfig(clientAuthConfigType, classLoaderLookup, callbackHandler);
+    }
+
+    public static AuthConfigProvider wrapClientAuthModule(String messageLayer, String appContext, String authenticationContextID, AuthModuleType<ClientAuthModule> clientAuthModuleType, boolean _protected, ClassLoaderLookup classLoaderLookup, CallbackHandler callbackHandler) throws AuthException {
+        ClientAuthContextType clientAuthContextType = new ClientAuthContextType(messageLayer, appContext, authenticationContextID, clientAuthModuleType);
+        return wrapClientAuthContext(clientAuthContextType, _protected, classLoaderLookup, callbackHandler);
+    }
+
+
+    public static AuthConfigProvider wrapServerAuthConfig(ServerAuthConfigType serverAuthConfigType, ClassLoaderLookup classLoaderLookup, CallbackHandler callbackHandler) throws AuthException {
+        Map<String, ServerAuthConfigType> serverAuthConfig = Collections.singletonMap(serverAuthConfigType.getKey(), serverAuthConfigType);
+        return new ConfigProviderType.ConfigProviderImpl(Collections.<String, ClientAuthConfigType>emptyMap(), serverAuthConfig, classLoaderLookup);
+    }
+
+    public static AuthConfigProvider wrapServerAuthContext(ServerAuthContextType serverAuthContextType, boolean _protected, ClassLoaderLookup classLoaderLookup, CallbackHandler callbackHandler) throws AuthException {
+        ServerAuthConfigType serverAuthConfigType = new ServerAuthConfigType(serverAuthContextType, _protected);
+        return wrapServerAuthConfig(serverAuthConfigType, classLoaderLookup, callbackHandler);
+    }
+
+    public static AuthConfigProvider wrapServerAuthModule(String messageLayer, String appContext, String authenticationContextID, AuthModuleType<ServerAuthModule> serverAuthModuleType, boolean _protected, ClassLoaderLookup classLoaderLookup, CallbackHandler callbackHandler) throws AuthException {
+        ServerAuthContextType serverAuthContextType = new ServerAuthContextType(messageLayer, appContext, authenticationContextID, serverAuthModuleType);
+        return wrapServerAuthContext(serverAuthContextType, _protected, classLoaderLookup, callbackHandler);
+    }
+
+}

Propchange: geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/model/JaspiUtil.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/model/JaspiUtil.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/model/JaspiUtil.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/model/JaspiXmlUtil.java
URL: http://svn.apache.org/viewvc/geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/model/JaspiXmlUtil.java?rev=681163&r1=681162&r2=681163&view=diff
==============================================================================
--- geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/model/JaspiXmlUtil.java (original)
+++ geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/model/JaspiXmlUtil.java Wed Jul 30 11:21:58 2008
@@ -45,12 +45,12 @@
 public class JaspiXmlUtil {
     public static final XMLInputFactory XMLINPUT_FACTORY = XMLInputFactory.newInstance();
     public static final JAXBContext JASPI_CONTEXT;
-    private static KeyedObjectMapAdapter configProviderMapAdapter = new KeyedObjectMapAdapter(ConfigProviderType.class);
+//    private static KeyedObjectMapAdapter configProviderMapAdapter = new KeyedObjectMapAdapter(ConfigProviderType.class);
 
     static {
         try {
 //            JASPI_CONTEXT = JAXBContext.newInstance(JaspiType.class);
-            JASPI_CONTEXT = com.envoisolutions.sxc.jaxb.JAXBContextImpl.newInstance(new Class[] {JaspiType.class}, Collections.singletonMap("com.envoisolutions.sxc.generate", "false"));
+            JASPI_CONTEXT = com.envoisolutions.sxc.jaxb.JAXBContextImpl.newInstance(new Class[] {JaspiType.class, ConfigProviderType.class, ClientAuthConfigType.class, ClientAuthContextType.class, ServerAuthConfigType.class, ServerAuthContextType.class, AuthModuleType.class}, Collections.singletonMap("com.envoisolutions.sxc.generate", "false"));
 
         } catch (JAXBException e) {
             throw new RuntimeException("Could not create jaxb contexts for plugin types", e);
@@ -63,26 +63,127 @@
         KeyedObjectMapAdapter.staticCallbackHandler = callbackHandler;
     }
 
-    public static void writeJaspi(JaspiType metadata, Writer out) throws XMLStreamException, JAXBException {
+    public static <T> void write(JAXBElement<T> element, Writer out) throws JAXBException {
         Marshaller marshaller = JASPI_CONTEXT.createMarshaller();
-        marshaller.setAdapter(configProviderMapAdapter);
         marshaller.setProperty("jaxb.formatted.output", true);
-        JAXBElement<JaspiType> element = new ObjectFactory().createJaspi(metadata);
         marshaller.marshal(element, out);
     }
 
+    public static <T>T load(Reader in, Class<T> clazz) throws ParserConfigurationException, IOException, SAXException, JAXBException, XMLStreamException {
+        XMLStreamReader xmlStream = XMLINPUT_FACTORY.createXMLStreamReader(in);
+        return load(xmlStream, clazz);
+    }
+
+    public static <T>T load(XMLStreamReader in, Class<T> clazz) throws ParserConfigurationException, IOException, SAXException, JAXBException, XMLStreamException {
+        Unmarshaller unmarshaller = JASPI_CONTEXT.createUnmarshaller();
+        JAXBElement<T> element = unmarshaller.unmarshal(in, clazz);
+        return element.getValue();
+    }
+
+    public static void writeJaspi(JaspiType metadata, Writer out) throws XMLStreamException, JAXBException {
+        write(new ObjectFactory().createJaspi(metadata), out);
+    }
 
     public static JaspiType loadJaspi(Reader in) throws ParserConfigurationException, IOException, SAXException, JAXBException, XMLStreamException {
-        XMLStreamReader xmlStream = XMLINPUT_FACTORY.createXMLStreamReader(in);
-        return loadJaspi(xmlStream);
+        return load(in, JaspiType.class);
     }
 
     public static JaspiType loadJaspi(XMLStreamReader in) throws ParserConfigurationException, IOException, SAXException, JAXBException, XMLStreamException {
-        Unmarshaller unmarshaller = JASPI_CONTEXT.createUnmarshaller();
-        unmarshaller.setAdapter(configProviderMapAdapter);
-        JAXBElement<JaspiType> element = unmarshaller.unmarshal(in, JaspiType.class);
-        JaspiType rbac = element.getValue();
-        return rbac;
+        return load(in, JaspiType.class);
+    }
+
+    public static void writeConfigProvider(ConfigProviderType metadata, Writer out) throws XMLStreamException, JAXBException {
+        write(new ObjectFactory().createConfigProvider(metadata), out);
+    }
+
+    public static ConfigProviderType loadConfigProvider(Reader in) throws ParserConfigurationException, IOException, SAXException, JAXBException, XMLStreamException {
+        return load(in, ConfigProviderType.class);
+    }
+
+    public static ConfigProviderType loadConfigProvider(XMLStreamReader in) throws ParserConfigurationException, IOException, SAXException, JAXBException, XMLStreamException {
+        return load(in, ConfigProviderType.class);
+    }
+
+
+    public static void writeClientAuthConfig(ClientAuthConfigType metadata, Writer out) throws XMLStreamException, JAXBException {
+        write(new ObjectFactory().createClientAuthConfig(metadata), out);
+    }
+
+    public static ClientAuthConfigType loadClientAuthConfig(Reader in) throws ParserConfigurationException, IOException, SAXException, JAXBException, XMLStreamException {
+        return load(in, ClientAuthConfigType.class);
+    }
+
+    public static ClientAuthConfigType loadClientAuthConfig(XMLStreamReader in) throws ParserConfigurationException, IOException, SAXException, JAXBException, XMLStreamException {
+        return load(in, ClientAuthConfigType.class);
+    }
+
+
+    public static void writeClientAuthContext(ClientAuthContextType metadata, Writer out) throws XMLStreamException, JAXBException {
+        write(new ObjectFactory().createClientAuthContext(metadata), out);
+    }
+
+    public static ClientAuthContextType loadClientAuthContext(Reader in) throws ParserConfigurationException, IOException, SAXException, JAXBException, XMLStreamException {
+        return load(in, ClientAuthContextType.class);
+    }
+
+    public static ClientAuthContextType loadClientAuthContext(XMLStreamReader in) throws ParserConfigurationException, IOException, SAXException, JAXBException, XMLStreamException {
+        return load(in, ClientAuthContextType.class);
     }
 
+    
+    public static void writeClientAuthModule(AuthModuleType metadata, Writer out) throws XMLStreamException, JAXBException {
+        write(new ObjectFactory().createClientAuthModule(metadata), out);
+    }
+
+    public static AuthModuleType loadClientAuthModule(Reader in) throws ParserConfigurationException, IOException, SAXException, JAXBException, XMLStreamException {
+        return load(in, AuthModuleType.class);
+    }
+
+    public static AuthModuleType loadClientAuthModule(XMLStreamReader in) throws ParserConfigurationException, IOException, SAXException, JAXBException, XMLStreamException {
+        return load(in, AuthModuleType.class);
+    }
+
+
+
+    public static void writeServerAuthConfig(ServerAuthConfigType metadata, Writer out) throws XMLStreamException, JAXBException {
+        write(new ObjectFactory().createServerAuthConfig(metadata), out);
+    }
+
+    public static ServerAuthConfigType loadServerAuthConfig(Reader in) throws ParserConfigurationException, IOException, SAXException, JAXBException, XMLStreamException {
+        return load(in, ServerAuthConfigType.class);
+    }
+
+    public static ServerAuthConfigType loadServerAuthConfig(XMLStreamReader in) throws ParserConfigurationException, IOException, SAXException, JAXBException, XMLStreamException {
+        return load(in, ServerAuthConfigType.class);
+    }
+
+
+    public static void writeServerAuthContext(ServerAuthContextType metadata, Writer out) throws XMLStreamException, JAXBException {
+        write(new ObjectFactory().createServerAuthContext(metadata), out);
+    }
+
+    public static ServerAuthContextType loadServerAuthContext(Reader in) throws ParserConfigurationException, IOException, SAXException, JAXBException, XMLStreamException {
+        return load(in, ServerAuthContextType.class);
+    }
+
+    public static ServerAuthContextType loadServerAuthContext(XMLStreamReader in) throws ParserConfigurationException, IOException, SAXException, JAXBException, XMLStreamException {
+        return load(in, ServerAuthContextType.class);
+    }
+
+
+    public static void writeServerAuthModule(AuthModuleType metadata, Writer out) throws XMLStreamException, JAXBException {
+        write(new ObjectFactory().createServerAuthModule(metadata), out);
+    }
+
+    public static AuthModuleType loadServerAuthModule(Reader in) throws ParserConfigurationException, IOException, SAXException, JAXBException, XMLStreamException {
+        return load(in, AuthModuleType.class);
+    }
+
+    public static AuthModuleType loadServerAuthModule(XMLStreamReader in) throws ParserConfigurationException, IOException, SAXException, JAXBException, XMLStreamException {
+        return load(in, AuthModuleType.class);
+    }
+
+
+
+
 }

Modified: geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/model/KeyedObjectMapAdapter.java
URL: http://svn.apache.org/viewvc/geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/model/KeyedObjectMapAdapter.java?rev=681163&r1=681162&r2=681163&view=diff
==============================================================================
--- geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/model/KeyedObjectMapAdapter.java (original)
+++ geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/model/KeyedObjectMapAdapter.java Wed Jul 30 11:21:58 2008
@@ -30,6 +30,7 @@
 import javax.security.auth.callback.CallbackHandler;
 
 import org.apache.geronimo.components.jaspi.ClassLoaderLookup;
+import org.apache.geronimo.components.jaspi.ConstantClassLoaderLookup;
 
 /**
  * @version $Rev$ $Date$
@@ -53,12 +54,7 @@
         } else {
             ClassLoader testLoader = Thread.currentThread().getContextClassLoader();
             final ClassLoader cl = testLoader == null ? KeyedObjectMapAdapter.class.getClassLoader() : testLoader;
-            classLoaderLookup = new ClassLoaderLookup() {
-
-                public ClassLoader getClassLoader(String name) {
-                    return cl;
-                }
-            };
+            classLoaderLookup = new ConstantClassLoaderLookup(cl);
         }
         this.type = type;
         callbackHandler = staticCallbackHandler;

Modified: geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/model/ObjectFactory.java
URL: http://svn.apache.org/viewvc/geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/model/ObjectFactory.java?rev=681163&r1=681162&r2=681163&view=diff
==============================================================================
--- geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/model/ObjectFactory.java (original)
+++ geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/model/ObjectFactory.java Wed Jul 30 11:21:58 2008
@@ -1,24 +1,8 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
 //
 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.5-b01-fcs 
 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
 // Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2008.07.15 at 04:13:34 PM PDT 
+// Generated on: 2008.07.29 at 04:09:58 PM PDT 
 //
 
 
@@ -43,13 +27,18 @@
  * groups.  Factory methods for each of these are 
  * provided in this class.
  * 
- *
- * @version $Rev$ $Date$
  */
 @XmlRegistry
 public class ObjectFactory {
 
+    private final static QName _ServerAuthContext_QNAME = new QName("http://geronimo.apache.org/xml/ns/geronimo-jaspi", "serverAuthContext");
+    private final static QName _ClientAuthConfig_QNAME = new QName("http://geronimo.apache.org/xml/ns/geronimo-jaspi", "clientAuthConfig");
+    private final static QName _ClientAuthContext_QNAME = new QName("http://geronimo.apache.org/xml/ns/geronimo-jaspi", "clientAuthContext");
+    private final static QName _ServerAuthConfig_QNAME = new QName("http://geronimo.apache.org/xml/ns/geronimo-jaspi", "serverAuthConfig");
     private final static QName _Jaspi_QNAME = new QName("http://geronimo.apache.org/xml/ns/geronimo-jaspi", "jaspi");
+    private final static QName _ServerAuthModule_QNAME = new QName("http://geronimo.apache.org/xml/ns/geronimo-jaspi", "serverAuthModule");
+    private final static QName _ConfigProvider_QNAME = new QName("http://geronimo.apache.org/xml/ns/geronimo-jaspi", "configProvider");
+    private final static QName _ClientAuthModule_QNAME = new QName("http://geronimo.apache.org/xml/ns/geronimo-jaspi", "clientAuthModule");
 
     /**
      * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.apache.geronimo.xml.ns.geronimo_jaspi
@@ -59,43 +48,51 @@
     }
 
     /**
-     * Create an instance of {@link JaspiType }
+     * Create an instance of {@link AuthModuleType }
      * 
      */
-    public JaspiType createJaspiType() {
-        return new JaspiType();
+    public AuthModuleType createAuthModuleType() {
+        return new AuthModuleType();
     }
 
     /**
-     * Create an instance of {@link ServerAuthContextType }
+     * Create an instance of {@link ProtectionPolicyType }
      * 
      */
-    public ServerAuthContextType createServerAuthContextType() {
-        return new ServerAuthContextType();
+    public ProtectionPolicyType createProtectionPolicyType() {
+        return new ProtectionPolicyType();
     }
 
     /**
-     * Create an instance of {@link AuthModuleType }
+     * Create an instance of {@link JaspiType }
      * 
      */
-    public AuthModuleType createAuthModuleType() {
-        return new AuthModuleType();
+    public JaspiType createJaspiType() {
+        return new JaspiType();
     }
 
     /**
-     * Create an instance of {@link ServerAuthConfigType }
+     * Create an instance of {@link ClientAuthConfigType }
      * 
      */
-    public ServerAuthConfigType createServerAuthConfigType() {
-        return new ServerAuthConfigType();
+    public ClientAuthConfigType createClientAuthConfigType() {
+        return new ClientAuthConfigType();
     }
 
     /**
-     * Create an instance of {@link TargetType }
+     * Create an instance of {@link ServerAuthContextType }
      * 
      */
-    public TargetType createTargetType() {
-        return new TargetType();
+    public ServerAuthContextType createServerAuthContextType() {
+        return new ServerAuthContextType();
+    }
+
+    /**
+     * Create an instance of {@link ClientAuthContextType }
+     * 
+     */
+    public ClientAuthContextType createClientAuthContextType() {
+        return new ClientAuthContextType();
     }
 
     /**
@@ -107,11 +104,11 @@
     }
 
     /**
-     * Create an instance of {@link ClientAuthContextType }
+     * Create an instance of {@link TargetPolicyType }
      * 
      */
-    public ClientAuthContextType createClientAuthContextType() {
-        return new ClientAuthContextType();
+    public TargetPolicyType createTargetPolicyType() {
+        return new TargetPolicyType();
     }
 
     /**
@@ -123,27 +120,55 @@
     }
 
     /**
-     * Create an instance of {@link TargetPolicyType }
+     * Create an instance of {@link TargetType }
      * 
      */
-    public TargetPolicyType createTargetPolicyType() {
-        return new TargetPolicyType();
+    public TargetType createTargetType() {
+        return new TargetType();
     }
 
     /**
-     * Create an instance of {@link ClientAuthConfigType }
+     * Create an instance of {@link ServerAuthConfigType }
      * 
      */
-    public ClientAuthConfigType createClientAuthConfigType() {
-        return new ClientAuthConfigType();
+    public ServerAuthConfigType createServerAuthConfigType() {
+        return new ServerAuthConfigType();
     }
 
     /**
-     * Create an instance of {@link ProtectionPolicyType }
+     * Create an instance of {@link JAXBElement }{@code <}{@link ServerAuthContextType }{@code >}}
      * 
      */
-    public ProtectionPolicyType createProtectionPolicyType() {
-        return new ProtectionPolicyType();
+    @XmlElementDecl(namespace = "http://geronimo.apache.org/xml/ns/geronimo-jaspi", name = "serverAuthContext")
+    public JAXBElement<ServerAuthContextType> createServerAuthContext(ServerAuthContextType value) {
+        return new JAXBElement<ServerAuthContextType>(_ServerAuthContext_QNAME, ServerAuthContextType.class, null, value);
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link ClientAuthConfigType }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "http://geronimo.apache.org/xml/ns/geronimo-jaspi", name = "clientAuthConfig")
+    public JAXBElement<ClientAuthConfigType> createClientAuthConfig(ClientAuthConfigType value) {
+        return new JAXBElement<ClientAuthConfigType>(_ClientAuthConfig_QNAME, ClientAuthConfigType.class, null, value);
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link ClientAuthContextType }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "http://geronimo.apache.org/xml/ns/geronimo-jaspi", name = "clientAuthContext")
+    public JAXBElement<ClientAuthContextType> createClientAuthContext(ClientAuthContextType value) {
+        return new JAXBElement<ClientAuthContextType>(_ClientAuthContext_QNAME, ClientAuthContextType.class, null, value);
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link ServerAuthConfigType }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "http://geronimo.apache.org/xml/ns/geronimo-jaspi", name = "serverAuthConfig")
+    public JAXBElement<ServerAuthConfigType> createServerAuthConfig(ServerAuthConfigType value) {
+        return new JAXBElement<ServerAuthConfigType>(_ServerAuthConfig_QNAME, ServerAuthConfigType.class, null, value);
     }
 
     /**
@@ -155,4 +180,31 @@
         return new JAXBElement<JaspiType>(_Jaspi_QNAME, JaspiType.class, null, value);
     }
 
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link AuthModuleType }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "http://geronimo.apache.org/xml/ns/geronimo-jaspi", name = "serverAuthModule")
+    public JAXBElement<AuthModuleType> createServerAuthModule(AuthModuleType value) {
+        return new JAXBElement<AuthModuleType>(_ServerAuthModule_QNAME, AuthModuleType.class, null, value);
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link ConfigProviderType }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "http://geronimo.apache.org/xml/ns/geronimo-jaspi", name = "configProvider")
+    public JAXBElement<ConfigProviderType> createConfigProvider(ConfigProviderType value) {
+        return new JAXBElement<ConfigProviderType>(_ConfigProvider_QNAME, ConfigProviderType.class, null, value);
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link AuthModuleType }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "http://geronimo.apache.org/xml/ns/geronimo-jaspi", name = "clientAuthModule")
+    public JAXBElement<AuthModuleType> createClientAuthModule(AuthModuleType value) {
+        return new JAXBElement<AuthModuleType>(_ClientAuthModule_QNAME, AuthModuleType.class, null, value);
+    }
+
 }

Modified: geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/model/ServerAuthConfigType.java
URL: http://svn.apache.org/viewvc/geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/model/ServerAuthConfigType.java?rev=681163&r1=681162&r2=681163&view=diff
==============================================================================
--- geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/model/ServerAuthConfigType.java (original)
+++ geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/model/ServerAuthConfigType.java Wed Jul 30 11:21:58 2008
@@ -27,6 +27,7 @@
 import java.io.Serializable;
 import java.util.Map;
 import java.util.HashMap;
+import java.util.Collections;
 
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
@@ -89,6 +90,17 @@
     @XmlJavaTypeAdapter(KeyedObjectMapAdapter.class)
     protected Map<String, ServerAuthContextType> serverAuthContext;
 
+    public ServerAuthConfigType() {
+    }
+
+    public ServerAuthConfigType(ServerAuthContextType serverAuthContextType, boolean _protected) {
+        this.messageLayer = serverAuthContextType.getMessageLayer();
+        this.appContext = serverAuthContextType.getAppContext();
+        this.authenticationContextID = serverAuthContextType.getAuthenticationContextID();
+        this.serverAuthContext = Collections.singletonMap(serverAuthContextType.getKey(), serverAuthContextType);
+        this._protected = _protected;
+    }
+
     /**
      * Gets the value of the messageLayer property.
      * 

Modified: geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/model/ServerAuthContextType.java
URL: http://svn.apache.org/viewvc/geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/model/ServerAuthContextType.java?rev=681163&r1=681162&r2=681163&view=diff
==============================================================================
--- geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/model/ServerAuthContextType.java (original)
+++ geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/java/org/apache/geronimo/components/jaspi/model/ServerAuthContextType.java Wed Jul 30 11:21:58 2008
@@ -27,6 +27,7 @@
 import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Collections;
 
 import javax.security.auth.Subject;
 import javax.security.auth.callback.CallbackHandler;
@@ -86,6 +87,17 @@
     @XmlTransient
     private ServerAuthContext serverAuthContext;
 
+
+    public ServerAuthContextType() {
+    }
+
+    public ServerAuthContextType(String messageLayer, String appContext, String authenticationContextID, AuthModuleType<ServerAuthModule> serverAuthModule) {
+        this.messageLayer = messageLayer;
+        this.appContext = appContext;
+        this.authenticationContextID = authenticationContextID;
+        this.serverAuthModule = Collections.singletonList(serverAuthModule);
+    }
+
     /**
      * Gets the value of the messageLayer property.
      *

Modified: geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/xsd/geronimo-jaspi.xsd
URL: http://svn.apache.org/viewvc/geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/xsd/geronimo-jaspi.xsd?rev=681163&r1=681162&r2=681163&view=diff
==============================================================================
--- geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/xsd/geronimo-jaspi.xsd (original)
+++ geronimo/components/jaspi/trunk/geronimo-jaspi/src/main/xsd/geronimo-jaspi.xsd Wed Jul 30 11:21:58 2008
@@ -49,6 +49,56 @@
         </xs:annotation>
     </xs:element>
 
+    <xs:element name="configProvider" type="jaspi:configProviderType">
+        <xs:annotation>
+            <xs:documentation>
+                Configuration of a single configProvider element
+            </xs:documentation>
+        </xs:annotation>
+    </xs:element>
+    <xs:element name="clientAuthConfig" type="jaspi:clientAuthConfigType">
+        <xs:annotation>
+            <xs:documentation>
+                Configuration of a single clientAuthConfig element
+            </xs:documentation>
+        </xs:annotation>
+    </xs:element>
+    <xs:element name="clientAuthContext" type="jaspi:clientAuthContextType">
+        <xs:annotation>
+            <xs:documentation>
+                Configuration of a single clientAuthContext element
+            </xs:documentation>
+        </xs:annotation>
+    </xs:element>
+    <xs:element name="clientAuthModule" type="jaspi:authModuleType">
+        <xs:annotation>
+            <xs:documentation>
+                Configuration of a single clientAuthModule element
+            </xs:documentation>
+        </xs:annotation>
+    </xs:element>
+    <xs:element name="serverAuthConfig" type="jaspi:serverAuthConfigType">
+        <xs:annotation>
+            <xs:documentation>
+                Configuration of a single serverAuthConfig element
+            </xs:documentation>
+        </xs:annotation>
+    </xs:element>
+    <xs:element name="serverAuthContext" type="jaspi:serverAuthContextType">
+        <xs:annotation>
+            <xs:documentation>
+                Configuration of a single serverAuthContext element
+            </xs:documentation>
+        </xs:annotation>
+    </xs:element>
+    <xs:element name="serverAuthModule" type="jaspi:authModuleType">
+        <xs:annotation>
+            <xs:documentation>
+                Configuration of a single serverAuthModule element
+            </xs:documentation>
+        </xs:annotation>
+    </xs:element>
+
     <xs:complexType name="jaspiType">
         <xs:sequence>
             <xs:element name="configProvider" type="jaspi:configProviderType" minOccurs="0" maxOccurs="unbounded">

Modified: geronimo/components/jaspi/trunk/geronimo-jaspi/src/test/java/org/apache/geronimo/components/jaspi/AuthConfigFactoryImplTest.java
URL: http://svn.apache.org/viewvc/geronimo/components/jaspi/trunk/geronimo-jaspi/src/test/java/org/apache/geronimo/components/jaspi/AuthConfigFactoryImplTest.java?rev=681163&r1=681162&r2=681163&view=diff
==============================================================================
--- geronimo/components/jaspi/trunk/geronimo-jaspi/src/test/java/org/apache/geronimo/components/jaspi/AuthConfigFactoryImplTest.java (original)
+++ geronimo/components/jaspi/trunk/geronimo-jaspi/src/test/java/org/apache/geronimo/components/jaspi/AuthConfigFactoryImplTest.java Wed Jul 30 11:21:58 2008
@@ -20,8 +20,11 @@
 import java.net.URL;
 
 import javax.security.auth.message.AuthException;
+import javax.security.auth.message.module.ClientAuthModule;
+import javax.security.auth.message.module.ServerAuthModule;
 import javax.security.auth.message.config.AuthConfigFactory;
 import javax.security.auth.message.config.RegistrationListener;
+import javax.security.auth.message.config.AuthConfigProvider;
 import javax.security.auth.message.config.AuthConfigFactory.RegistrationContext;
 import javax.security.auth.callback.CallbackHandler;
 
@@ -30,6 +33,10 @@
 import org.apache.geronimo.components.jaspi.providers.BadConstructorProvider;
 import org.apache.geronimo.components.jaspi.providers.BadImplementProvider;
 import org.apache.geronimo.components.jaspi.providers.DummyProvider;
+import org.apache.geronimo.components.jaspi.providers.DummyClientAuthModule;
+import org.apache.geronimo.components.jaspi.providers.DummyServerAuthModule;
+import org.apache.geronimo.components.jaspi.model.AuthModuleType;
+import org.apache.geronimo.components.jaspi.model.JaspiUtil;
 
 public class AuthConfigFactoryImplTest extends TestCase {
 
@@ -149,6 +156,33 @@
         factory.removeRegistration(regId);
         assertTrue(listener.notified);
     }
+
+    public void testWrapClientAuthModule() throws Exception {
+        AuthConfigFactory factory = AuthConfigFactory.getFactory();
+        AuthModuleType<ClientAuthModule> authModuleType = new AuthModuleType<ClientAuthModule>();
+        authModuleType.setClassName(DummyClientAuthModule.class.getName());
+        ClassLoaderLookup classLoaderLookup = new ConstantClassLoaderLookup(getClass().getClassLoader());
+        AuthConfigProvider authConfigProvider = JaspiUtil.wrapClientAuthModule("layer", "appContext1", "id", authModuleType, true, classLoaderLookup, null);
+        String regId = factory.registerConfigProvider(authConfigProvider, "layer", "appContext1", "description");
+        DummyListener listener = new DummyListener();
+        assertNotNull(factory.getConfigProvider("layer", "appContext1", listener));
+        factory.removeRegistration(regId);
+        assertTrue(listener.notified);
+    }
+    
+    public void testWrapServerAuthModule() throws Exception {
+        AuthConfigFactory factory = AuthConfigFactory.getFactory();
+        AuthModuleType<ServerAuthModule> authModuleType = new AuthModuleType<ServerAuthModule>();
+        authModuleType.setClassName(DummyServerAuthModule.class.getName());
+        ClassLoaderLookup classLoaderLookup = new ConstantClassLoaderLookup(getClass().getClassLoader());
+        AuthConfigProvider authConfigProvider = JaspiUtil.wrapServerAuthModule("layer", "appContext1", "id", authModuleType, true, classLoaderLookup, null);
+        String regId = factory.registerConfigProvider(authConfigProvider, "layer", "appContext1", "description");
+        DummyListener listener = new DummyListener();
+        assertNotNull(factory.getConfigProvider("layer", "appContext1", listener));
+        factory.removeRegistration(regId);
+        assertTrue(listener.notified);
+    }
+
     
     public static class DummyListener implements RegistrationListener {
         public boolean notified = true;

Modified: geronimo/components/jaspi/trunk/geronimo-jaspi/src/test/java/org/apache/geronimo/components/jaspi/model/JaxbTest.java
URL: http://svn.apache.org/viewvc/geronimo/components/jaspi/trunk/geronimo-jaspi/src/test/java/org/apache/geronimo/components/jaspi/model/JaxbTest.java?rev=681163&r1=681162&r2=681163&view=diff
==============================================================================
--- geronimo/components/jaspi/trunk/geronimo-jaspi/src/test/java/org/apache/geronimo/components/jaspi/model/JaxbTest.java (original)
+++ geronimo/components/jaspi/trunk/geronimo-jaspi/src/test/java/org/apache/geronimo/components/jaspi/model/JaxbTest.java Wed Jul 30 11:21:58 2008
@@ -39,9 +39,14 @@
 import javax.security.auth.message.config.ClientAuthContext;
 import javax.security.auth.message.config.ServerAuthConfig;
 import javax.security.auth.message.config.ServerAuthContext;
+import javax.security.auth.message.AuthException;
+import javax.security.auth.message.module.ClientAuthModule;
+import javax.security.auth.callback.CallbackHandler;
 
 import org.testng.annotations.Test;
 import org.xml.sax.SAXException;
+import org.apache.geronimo.components.jaspi.ClassLoaderLookup;
+import org.apache.geronimo.components.jaspi.ConstantClassLoaderLookup;
 
 /**
  * @version $Rev$ $Date$
@@ -52,13 +57,15 @@
 
     private final int count = 2;
 
+    private final ClassLoaderLookup classLoaderLookup = new ConstantClassLoaderLookup(getClass().getClassLoader());
+    private CallbackHandler callbackHandler;
+
     @Test
     public void testLoad() throws Exception {
-        String file = "test-jaspi.xml";
+        String file = "jaspi";
         JaspiType jaspi1 = loadJaspi(file);
         if (jaspi1.getConfigProvider().size() != count) throw new Exception("expected " + count + " configprovider, not this: " + jaspi1.getConfigProvider());
-        URL url = getClass().getClassLoader().getResource("test-jaspi.xml");
-        File newFile = new File(new File(url.getPath()).getParentFile(), "test-jaspi-write.xml");
+        File newFile = getWriteFile(file);
         Writer writer = new FileWriter(newFile);
         JaspiXmlUtil.writeJaspi(jaspi1, writer);
         JaspiType jaspi2 = JaspiXmlUtil.loadJaspi(new FileReader(newFile));
@@ -67,38 +74,110 @@
 
     @Test
     public void testLoad2() throws Exception {
-        String file = "test-jaspi-2.xml";
+        String file = "jaspi-2";
         JaspiType jaspi1 = loadJaspi(file);
         if (jaspi1.getConfigProvider().size() != count) throw new Exception("expected " + count + " configprovider, not this: " + jaspi1.getConfigProvider());
-        URL url = getClass().getClassLoader().getResource("test-jaspi.xml");
-        File newFile = new File(new File(url.getPath()).getParentFile(), "test-jaspi-2-write.xml");
+        File newFile = getWriteFile(file);
         Writer writer = new FileWriter(newFile);
         JaspiXmlUtil.writeJaspi(jaspi1, writer);
         JaspiType jaspi2 = JaspiXmlUtil.loadJaspi(new FileReader(newFile));
         if (jaspi2.getConfigProvider().size() != count) throw new Exception("expected " + count + " configprovider, not this: " + jaspi2.getConfigProvider());
 
         AuthConfigProvider configProvider = jaspi1.getConfigProvider().get(ConfigProviderType.getRegistrationKey("Http", "test-app1")).getProvider();
-        ClientAuthConfig clientAuthConfig = configProvider.getClientAuthConfig("Http", "test-app1", null);
-        String authContextID = clientAuthConfig.getAuthContextID(null);
-        ClientAuthContext clientAuthContext = clientAuthConfig.getAuthContext(authContextID, null, null);
-        clientAuthContext.secureRequest(null, null);
+        checkConfigProvider(configProvider);
+    }
 
-        ServerAuthConfig serverAuthConfig = configProvider.getServerAuthConfig("Http", "test-app1", null);
-         authContextID = serverAuthConfig.getAuthContextID(null);
-        ServerAuthContext serverAuthContext = serverAuthConfig.getAuthContext(authContextID, null, null);
-        serverAuthContext.secureResponse(null, null);
+    private JaspiType loadJaspi(String file) throws ParserConfigurationException, IOException, SAXException, JAXBException, XMLStreamException {
+        Reader reader = getReader(file);
+        JaspiType rbac = JaspiXmlUtil.loadJaspi(reader);
+        return rbac;
+    }
+
+    private Reader getReader(String file) {
+        InputStream in = getClass().getClassLoader().getResourceAsStream("test-" + file + ".xml");
+        Reader reader = new InputStreamReader(in);
+        return reader;
+    }
 
+    private File getWriteFile(String file) {
+        URL url = getClass().getClassLoader().getResource("test-jaspi.xml");
+        File newFile = new File(new File(url.getPath()).getParentFile(), "test-" + file + "-write.xml");
+        return newFile;
+    }
 
+    @Test
+    public void testConfigProvider() throws Exception {
+        String file = "config-provider";
+        Reader reader = getReader(file);
+        ConfigProviderType jaspi1 = JaspiXmlUtil.loadConfigProvider(reader);
+        jaspi1.initialize(classLoaderLookup, callbackHandler);
+        File newFile = getWriteFile(file);
+        Writer writer = new FileWriter(newFile);
+        JaspiXmlUtil.writeConfigProvider(jaspi1, writer);
+        ConfigProviderType jaspi2 = JaspiXmlUtil.loadConfigProvider(new FileReader(newFile));
 
+        AuthConfigProvider configProvider = jaspi1.getProvider();
+        checkConfigProvider(configProvider);
     }
 
-    private JaspiType loadJaspi(String file) throws ParserConfigurationException, IOException, SAXException, JAXBException, XMLStreamException {
-        InputStream in = getClass().getClassLoader().getResourceAsStream(file);
-        Reader reader = new InputStreamReader(in);
-        JaspiType rbac = JaspiXmlUtil.loadJaspi(reader);
-        return rbac;
+    @Test
+    public void testClientAuthConfig() throws Exception {
+        String file = "client-auth-config";
+        Reader reader = getReader(file);
+        ClientAuthConfigType jaspi1 = JaspiXmlUtil.loadClientAuthConfig(reader);
+        jaspi1.initialize(classLoaderLookup, callbackHandler);
+        File newFile = getWriteFile(file);
+        Writer writer = new FileWriter(newFile);
+        JaspiXmlUtil.writeClientAuthConfig(jaspi1, writer);
+        ClientAuthConfigType jaspi2 = JaspiXmlUtil.loadClientAuthConfig(new FileReader(newFile));
+
+        ClientAuthConfig clientAuthConfig = jaspi1.newClientAuthConfig("Http", "app", classLoaderLookup, callbackHandler);
+        checkClientAuthConfig(clientAuthConfig);
     }
 
+    @Test
+    public void testClientAuthContext() throws Exception {
+        String file = "client-auth-context";
+        Reader reader = getReader(file);
+        ClientAuthContextType jaspi1 = JaspiXmlUtil.loadClientAuthContext(reader);
+        File newFile = getWriteFile(file);
+        Writer writer = new FileWriter(newFile);
+        JaspiXmlUtil.writeClientAuthContext(jaspi1, writer);
+        ClientAuthContextType jaspi2 = JaspiXmlUtil.loadClientAuthContext(new FileReader(newFile));
+
+        ClientAuthContext clientAuthConfig = jaspi1.newClientAuthContext(classLoaderLookup, callbackHandler);
+        clientAuthConfig.secureRequest(null, null);
+    }
+
+    @Test
+    public void testClientAuthModule() throws Exception {
+        String file = "client-auth-module";
+        Reader reader = getReader(file);
+        AuthModuleType<ClientAuthModule> jaspi1 = JaspiXmlUtil.loadClientAuthModule(reader);
+        File newFile = getWriteFile(file);
+        Writer writer = new FileWriter(newFile);
+        JaspiXmlUtil.writeClientAuthModule(jaspi1, writer);
+        AuthModuleType jaspi2 = JaspiXmlUtil.loadClientAuthModule(new FileReader(newFile));
+
+        ClientAuthModule clientAuthConfig = jaspi1.newAuthModule(classLoaderLookup, callbackHandler);
+        clientAuthConfig.secureRequest(null, null);
+    }
+
+    private void checkConfigProvider(AuthConfigProvider configProvider) throws AuthException {
+        ClientAuthConfig clientAuthConfig = configProvider.getClientAuthConfig("Http", "test-app1", null);
+        checkClientAuthConfig(clientAuthConfig);
+
+        ServerAuthConfig serverAuthConfig = configProvider.getServerAuthConfig("Http", "test-app1", null);
+        String authContextID = serverAuthConfig.getAuthContextID(null);
+        ServerAuthContext serverAuthContext = serverAuthConfig.getAuthContext(authContextID, null, null);
+        serverAuthContext.secureResponse(null, null);
+    }
+
+    private void checkClientAuthConfig(ClientAuthConfig clientAuthConfig) throws AuthException {
+        String authContextID = clientAuthConfig.getAuthContextID(null);
+        ClientAuthContext clientAuthContext = clientAuthConfig.getAuthContext(authContextID, null, null);
+        clientAuthContext.secureRequest(null, null);
+    }
 
 
 }

Added: geronimo/components/jaspi/trunk/geronimo-jaspi/src/test/resources/test-client-auth-config.xml
URL: http://svn.apache.org/viewvc/geronimo/components/jaspi/trunk/geronimo-jaspi/src/test/resources/test-client-auth-config.xml?rev=681163&view=auto
==============================================================================
--- geronimo/components/jaspi/trunk/geronimo-jaspi/src/test/resources/test-client-auth-config.xml (added)
+++ geronimo/components/jaspi/trunk/geronimo-jaspi/src/test/resources/test-client-auth-config.xml Wed Jul 30 11:21:58 2008
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You 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.
+-->
+
+<clientAuthConfig xmlns="http://geronimo.apache.org/xml/ns/geronimo-jaspi">
+    <authenticationContextID>authenticationContextID1</authenticationContextID>
+    <protected>true</protected>
+    <clientAuthContext>
+        <clientAuthModule>
+            <className>org.apache.geronimo.components.jaspi.providers.DummyClientAuthModule</className>
+        </clientAuthModule>
+    </clientAuthContext>
+</clientAuthConfig>

Propchange: geronimo/components/jaspi/trunk/geronimo-jaspi/src/test/resources/test-client-auth-config.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/components/jaspi/trunk/geronimo-jaspi/src/test/resources/test-client-auth-config.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/components/jaspi/trunk/geronimo-jaspi/src/test/resources/test-client-auth-config.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/components/jaspi/trunk/geronimo-jaspi/src/test/resources/test-client-auth-context.xml
URL: http://svn.apache.org/viewvc/geronimo/components/jaspi/trunk/geronimo-jaspi/src/test/resources/test-client-auth-context.xml?rev=681163&view=auto
==============================================================================
--- geronimo/components/jaspi/trunk/geronimo-jaspi/src/test/resources/test-client-auth-context.xml (added)
+++ geronimo/components/jaspi/trunk/geronimo-jaspi/src/test/resources/test-client-auth-context.xml Wed Jul 30 11:21:58 2008
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You 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.
+-->
+
+<clientAuthContext xmlns="http://geronimo.apache.org/xml/ns/geronimo-jaspi">
+    <clientAuthModule>
+        <className>org.apache.geronimo.components.jaspi.providers.DummyClientAuthModule</className>
+    </clientAuthModule>
+</clientAuthContext>

Propchange: geronimo/components/jaspi/trunk/geronimo-jaspi/src/test/resources/test-client-auth-context.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/components/jaspi/trunk/geronimo-jaspi/src/test/resources/test-client-auth-context.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/components/jaspi/trunk/geronimo-jaspi/src/test/resources/test-client-auth-context.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/components/jaspi/trunk/geronimo-jaspi/src/test/resources/test-client-auth-module.xml
URL: http://svn.apache.org/viewvc/geronimo/components/jaspi/trunk/geronimo-jaspi/src/test/resources/test-client-auth-module.xml?rev=681163&view=auto
==============================================================================
--- geronimo/components/jaspi/trunk/geronimo-jaspi/src/test/resources/test-client-auth-module.xml (added)
+++ geronimo/components/jaspi/trunk/geronimo-jaspi/src/test/resources/test-client-auth-module.xml Wed Jul 30 11:21:58 2008
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You 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.
+-->
+
+<clientAuthModule xmlns="http://geronimo.apache.org/xml/ns/geronimo-jaspi">
+    <className>org.apache.geronimo.components.jaspi.providers.DummyClientAuthModule</className>
+</clientAuthModule>

Propchange: geronimo/components/jaspi/trunk/geronimo-jaspi/src/test/resources/test-client-auth-module.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/components/jaspi/trunk/geronimo-jaspi/src/test/resources/test-client-auth-module.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/components/jaspi/trunk/geronimo-jaspi/src/test/resources/test-client-auth-module.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Copied: geronimo/components/jaspi/trunk/geronimo-jaspi/src/test/resources/test-config-provider.xml (from r677988, geronimo/components/jaspi/trunk/geronimo-jaspi/src/test/resources/test-jaspi-2.xml)
URL: http://svn.apache.org/viewvc/geronimo/components/jaspi/trunk/geronimo-jaspi/src/test/resources/test-config-provider.xml?p2=geronimo/components/jaspi/trunk/geronimo-jaspi/src/test/resources/test-config-provider.xml&p1=geronimo/components/jaspi/trunk/geronimo-jaspi/src/test/resources/test-jaspi-2.xml&r1=677988&r2=681163&rev=681163&view=diff
==============================================================================
--- geronimo/components/jaspi/trunk/geronimo-jaspi/src/test/resources/test-jaspi-2.xml (original)
+++ geronimo/components/jaspi/trunk/geronimo-jaspi/src/test/resources/test-config-provider.xml Wed Jul 30 11:21:58 2008
@@ -16,40 +16,27 @@
     limitations under the License.
 -->
 
-<jaspi xmlns="http://geronimo.apache.org/xml/ns/geronimo-jaspi">
-
-    <configProvider>
-        <messageLayer>Http</messageLayer>
-        <appContext>test-app1</appContext>
-        <description>description</description>
-        <clientAuthConfig>
-            <authenticationContextID>authenticationContextID1</authenticationContextID>
-            <protected>true</protected>
-            <clientAuthContext>
-                <clientAuthModule>
-                    <className>org.apache.geronimo.components.jaspi.providers.DummyClientAuthModule</className>
-                </clientAuthModule>
-            </clientAuthContext>
-        </clientAuthConfig>
-        <serverAuthConfig>
-            <authenticationContextID>authenticationContextID2</authenticationContextID>
-            <protected>true</protected>
-            <serverAuthContext>
-                <serverAuthModule>
-                    <className>org.apache.geronimo.components.jaspi.providers.DummyServerAuthModule</className>
-                </serverAuthModule>
-            </serverAuthContext>
-        </serverAuthConfig>
-        <persistent>true</persistent>
-    </configProvider>
-
-    <configProvider>
-        <messageLayer>Http</messageLayer>
-        <appContext>test-app2</appContext>
-        <description>description2</description>
-        <className>org.apache.geronimo.components.jaspi.providers.DummyProvider</className>
-        <properties>foo=bar</properties>
-        <persistent>true</persistent>
-    </configProvider>
-
-</jaspi>
\ No newline at end of file
+<configProvider xmlns="http://geronimo.apache.org/xml/ns/geronimo-jaspi">
+    <messageLayer>Http</messageLayer>
+    <appContext>test-app1</appContext>
+    <description>description</description>
+    <clientAuthConfig>
+        <authenticationContextID>authenticationContextID1</authenticationContextID>
+        <protected>true</protected>
+        <clientAuthContext>
+            <clientAuthModule>
+                <className>org.apache.geronimo.components.jaspi.providers.DummyClientAuthModule</className>
+            </clientAuthModule>
+        </clientAuthContext>
+    </clientAuthConfig>
+    <serverAuthConfig>
+        <authenticationContextID>authenticationContextID2</authenticationContextID>
+        <protected>true</protected>
+        <serverAuthContext>
+            <serverAuthModule>
+                <className>org.apache.geronimo.components.jaspi.providers.DummyServerAuthModule</className>
+            </serverAuthModule>
+        </serverAuthContext>
+    </serverAuthConfig>
+    <persistent>true</persistent>
+</configProvider>



Mime
View raw message