portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwat...@apache.org
Subject svn commit: r788614 - in /portals/jetspeed-2/portal/trunk: components/jetspeed-profiler/src/test/java/JETSPEED-INF/spring/ components/jetspeed-profiler/src/test/java/org/apache/jetspeed/profiler/ components/jetspeed-serializer/src/main/java/org/apache/...
Date Fri, 26 Jun 2009 07:33:22 GMT
Author: rwatler
Date: Fri Jun 26 07:33:22 2009
New Revision: 788614

URL: http://svn.apache.org/viewvc?rev=788614&view=rev
Log:
JS2-1034: implement SSO import/export serialization

Added:
    portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/test/java/JETSPEED-INF/spring/JetspeedSerializerOverride.xml
    portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSSSOSite.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSSSOSiteRemoteUser.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSSSOSiteRemoteUsers.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSSSOSites.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-sso/src/main/java/org/apache/jetspeed/serializer/
    portals/jetspeed-2/portal/trunk/components/jetspeed-sso/src/main/java/org/apache/jetspeed/serializer/JetspeedSSOSerializer.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-sso/src/main/java/org/apache/jetspeed/sso/impl/SSOUtils.java
Modified:
    portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/test/java/org/apache/jetspeed/profiler/TestProfiler.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/JetspeedSerializerImpl.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSSnapshot.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-sso/src/main/java/org/apache/jetspeed/sso/impl/SSOClientImpl.java
    portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/serializer/JetspeedSerializer.java
    portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/serializer.xml
    portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/sso.xml

Added: portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/test/java/JETSPEED-INF/spring/JetspeedSerializerOverride.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/test/java/JETSPEED-INF/spring/JetspeedSerializerOverride.xml?rev=788614&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/test/java/JETSPEED-INF/spring/JetspeedSerializerOverride.xml (added)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/test/java/JETSPEED-INF/spring/JetspeedSerializerOverride.xml Fri Jun 26 07:33:22 2009
@@ -0,0 +1,68 @@
+<?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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
+
+  <bean id="org.apache.jetspeed.serializer.JetspeedSerializer" name="JetspeedSerializer"
+    class="org.apache.jetspeed.serializer.JetspeedSerializerImpl">
+    <meta key="j2:cat" value="default or serializer" />
+    <constructor-arg index="0">
+      <list>
+        <bean class="org.apache.jetspeed.serializer.JetspeedCapabilitiesSerializer">
+          <constructor-arg ref="org.apache.jetspeed.capabilities.Capabilities" />
+        </bean>
+        <bean class="org.apache.jetspeed.serializer.JetspeedSecuritySerializer">
+          <constructor-arg index="0" ref="org.apache.jetspeed.security.spi.JetspeedPrincipalManagerProvider" />
+          <constructor-arg index="1" ref="org.apache.jetspeed.security.GroupManager" />
+          <constructor-arg index="2" ref="org.apache.jetspeed.security.RoleManager" />
+          <constructor-arg index="3" ref="org.apache.jetspeed.security.UserManager" />
+          <constructor-arg index="4" ref="org.apache.jetspeed.security.spi.CredentialPasswordEncoder" />
+          <constructor-arg index="5" ref="org.apache.jetspeed.security.PermissionManager" />
+          <constructor-arg index="6" ref="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager" />
+          <constructor-arg index="7" ref="org.apache.jetspeed.security.spi.JetspeedSecurityPersistenceManager" />
+        </bean>
+        <bean class="org.apache.jetspeed.serializer.JetspeedProfilerSerializer">
+          <constructor-arg index="0" ref="org.apache.jetspeed.profiler.Profiler" />
+          <constructor-arg index="1" ref="org.apache.jetspeed.security.UserManager" />
+        </bean>
+        <bean class="org.apache.jetspeed.serializer.JetspeedRegistrySerializer">
+          <constructor-arg index="0" ref="org.apache.jetspeed.components.portletregistry.PortletRegistry" />
+          <constructor-arg index="1" ref="org.apache.jetspeed.components.portletpreferences.PortletPreferencesProvider" />
+          <constructor-arg index="2" ref="org.apache.jetspeed.search.SearchEngine" />
+        </bean>
+      </list>
+    </constructor-arg>
+    <constructor-arg index="1">
+      <map>
+        <entry key="process_capabilities">
+          <value type="java.lang.Boolean">true</value>
+        </entry>
+        <entry key="process_users">
+          <value type="java.lang.Boolean">true</value>
+        </entry>
+        <entry key="process_permissions">
+          <value type="java.lang.Boolean">true</value>
+        </entry>
+        <entry key="process_profiler">
+          <value type="java.lang.Boolean">true</value>
+        </entry>
+      </map>
+    </constructor-arg>
+  </bean>
+
+</beans>

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/test/java/org/apache/jetspeed/profiler/TestProfiler.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/test/java/org/apache/jetspeed/profiler/TestProfiler.java?rev=788614&r1=788613&r2=788614&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/test/java/org/apache/jetspeed/profiler/TestProfiler.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/test/java/org/apache/jetspeed/profiler/TestProfiler.java Fri Jun 26 07:33:22 2009
@@ -584,9 +584,13 @@
 
     protected String[] getConfigurations()
     {
-        return new String[] { "profiler.xml", "transaction.xml", "serializer.xml", "security-providers.xml", "cache-test.xml", "capabilities.xml", "registry.xml", "search.xml", "jetspeed-spring.xml",
-                "security-managers.xml", "security-spi.xml", "security-spi-atn.xml", "security-atz.xml", "static-bean-references.xml", "pluto-services.xml", "JETSPEED-INF/spring/JetspeedPrincipalManagerProviderOverride.xml",
-                "JETSPEED-INF/spring/JetspeedPreferencesOverride.xml"};
+        return new String[] { "profiler.xml", "transaction.xml", "serializer.xml", "security-providers.xml", "cache-test.xml",
+                              "capabilities.xml", "registry.xml", "search.xml", "jetspeed-spring.xml", "security-managers.xml",
+                              "security-spi.xml", "security-spi-atn.xml", "security-atz.xml", "static-bean-references.xml",
+                              "pluto-services.xml",
+                              "JETSPEED-INF/spring/JetspeedPrincipalManagerProviderOverride.xml",
+                              "JETSPEED-INF/spring/JetspeedPreferencesOverride.xml",
+                              "JETSPEED-INF/spring/JetspeedSerializerOverride.xml"};
     }
 
     protected String getBeanDefinitionFilterCategories()

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/JetspeedSerializerImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/JetspeedSerializerImpl.java?rev=788614&r1=788613&r2=788614&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/JetspeedSerializerImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/JetspeedSerializerImpl.java Fri Jun 26 07:33:22 2009
@@ -69,6 +69,10 @@
 import org.apache.jetspeed.serializer.objects.JSSecurityDomain;
 import org.apache.jetspeed.serializer.objects.JSSecurityDomains;
 import org.apache.jetspeed.serializer.objects.JSSnapshot;
+import org.apache.jetspeed.serializer.objects.JSSSOSite;
+import org.apache.jetspeed.serializer.objects.JSSSOSiteRemoteUser;
+import org.apache.jetspeed.serializer.objects.JSSSOSiteRemoteUsers;
+import org.apache.jetspeed.serializer.objects.JSSSOSites;
 import org.apache.jetspeed.serializer.objects.JSUser;
 import org.apache.jetspeed.serializer.objects.JSUserAttributes;
 import org.apache.jetspeed.serializer.objects.JSUserGroups;
@@ -234,6 +238,11 @@
         binding.setAlias(JSSecurityDomains.class, "SecurityDomains");
         binding.setAlias(JSSecurityDomain.class, "SecurityDomain");
 
+        binding.setAlias(JSSSOSite.class, "Site");
+        binding.setAlias(JSSSOSiteRemoteUser.class, "RemoteUser");
+        binding.setAlias(JSSSOSiteRemoteUsers.class, "RemoteUsers");
+        binding.setAlias(JSSSOSites.class, "SSOSites");
+
         binding.setAlias(String.class, "String");
         binding.setAlias(Integer.class, "int");
 

Added: portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSSSOSite.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSSSOSite.java?rev=788614&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSSSOSite.java (added)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSSSOSite.java Fri Jun 26 07:33:22 2009
@@ -0,0 +1,227 @@
+/*
+ * 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.jetspeed.serializer.objects;
+
+import javolution.xml.XMLFormat;
+import javolution.xml.stream.XMLStreamException;
+
+import org.apache.commons.lang.StringEscapeUtils;
+
+/**
+ * Jetspeed Serialized (JS) SSOSite
+ * 
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id: $
+ */
+public class JSSSOSite
+{
+    private String name;
+
+    private String siteURL;
+
+    private boolean allowUserSet;
+
+    private boolean certificateRequired;
+    
+    private boolean challengeResponseAuthentication;
+    
+    private String realm;
+    
+    private boolean formAuthentication;
+    
+    private String formUserField;
+    
+    private String formPwdField;
+    
+    private JSSSOSiteRemoteUsers remoteUsers;
+
+    public JSSSOSite()
+    {
+    }
+
+    public String getName()
+    {
+        return name;
+    }
+
+    public void setName(String name)
+    {
+        this.name = name;
+    }
+
+    public String getSiteURL()
+    {
+        return siteURL;
+    }
+
+    public void setSiteURL(String siteURL)
+    {
+        this.siteURL = siteURL;
+    }
+
+    public boolean isAllowUserSet()
+    {
+        return allowUserSet;
+    }
+
+    public void setAllowUserSet(boolean allowUserSet)
+    {
+        this.allowUserSet = allowUserSet;
+    }
+
+    public boolean isCertificateRequired()
+    {
+        return certificateRequired;
+    }
+
+    public void setCertificateRequired(boolean certificateRequired)
+    {
+        this.certificateRequired = certificateRequired;
+    }
+
+    public boolean isChallengeResponseAuthentication()
+    {
+        return challengeResponseAuthentication;
+    }
+
+    public void setChallengeResponseAuthentication(boolean challengeResponseAuthentication)
+    {
+        this.challengeResponseAuthentication = challengeResponseAuthentication;
+    }
+
+    public String getRealm()
+    {
+        return realm;
+    }
+
+    public void setRealm(String realm)
+    {
+        this.realm = realm;
+    }
+
+    public boolean isFormAuthentication()
+    {
+        return formAuthentication;
+    }
+
+    public void setFormAuthentication(boolean formAuthentication)
+    {
+        this.formAuthentication = formAuthentication;
+    }
+
+    public String getFormUserField()
+    {
+        return formUserField;
+    }
+
+    public void setFormUserField(String formUserField)
+    {
+        this.formUserField = formUserField;
+    }
+
+    public String getFormPwdField()
+    {
+        return formPwdField;
+    }
+
+    public void setFormPwdField(String formPwdField)
+    {
+        this.formPwdField = formPwdField;
+    }
+
+    public JSSSOSiteRemoteUsers getRemoteUsers()
+    {
+        return remoteUsers;
+    }
+
+    public void setRemoteUsers(JSSSOSiteRemoteUsers remoteUsers)
+    {
+        this.remoteUsers = remoteUsers;
+    }
+
+    public void addRemoteUser(JSSSOSiteRemoteUser remoteUser)
+    {
+        if (remoteUsers == null)
+        {
+            remoteUsers = new JSSSOSiteRemoteUsers();
+        }
+        remoteUsers.add(remoteUser);
+    }
+
+    /***************************************************************************
+     * SERIALIZER
+     */
+    @SuppressWarnings("unused")
+    private static final XMLFormat XML = new XMLFormat(JSSSOSite.class)
+    {
+        public void write(Object o, OutputElement xml) throws XMLStreamException
+        {
+            try
+            {
+                JSSSOSite g = (JSSSOSite) o;
+
+                xml.setAttribute("name", g.getName());
+                xml.setAttribute("siteURL", g.getSiteURL());
+                xml.setAttribute("allowUserSet", g.isAllowUserSet());
+                xml.setAttribute("certificateRequired", g.isCertificateRequired());
+                xml.setAttribute("challengeResponseAuthentication", g.isChallengeResponseAuthentication());
+                xml.setAttribute("realm", g.getRealm());
+                xml.setAttribute("formAuthentication", g.isFormAuthentication());
+                xml.setAttribute("formUserField", g.getFormUserField());
+                xml.setAttribute("formPwdField", g.getFormPwdField());
+
+                xml.add(g.getRemoteUsers());
+            }
+            catch (Exception e)
+            {
+                e.printStackTrace();
+            }
+        }
+
+        public void read(InputElement xml, Object o)
+        {
+            try
+            {
+                JSSSOSite g = (JSSSOSite) o;
+
+                g.setName(StringEscapeUtils.unescapeHtml(xml.getAttribute("name", (String)null)));
+                g.setSiteURL(StringEscapeUtils.unescapeHtml(xml.getAttribute("siteURL", (String)null)));
+                g.setAllowUserSet(Boolean.parseBoolean(StringEscapeUtils.unescapeHtml(xml.getAttribute("allowUserSet", "false"))));
+                g.setCertificateRequired(Boolean.parseBoolean(StringEscapeUtils.unescapeHtml(xml.getAttribute("certificateRequired", "false"))));
+                g.setChallengeResponseAuthentication(Boolean.parseBoolean(StringEscapeUtils.unescapeHtml(xml.getAttribute("challengeResponseAuthentication", "false"))));
+                g.setRealm(StringEscapeUtils.unescapeHtml(xml.getAttribute("realm", (String)null)));
+                g.setFormAuthentication(Boolean.parseBoolean(StringEscapeUtils.unescapeHtml(xml.getAttribute("formAuthentication", "false"))));
+                g.setFormUserField(StringEscapeUtils.unescapeHtml(xml.getAttribute("formUserField", (String)null)));
+                g.setFormPwdField(StringEscapeUtils.unescapeHtml(xml.getAttribute("formPwdField", (String)null)));
+                
+                Object o1 = null;
+                while (xml.hasNext())
+                {
+                    o1 = xml.getNext();
+                    if (o1 instanceof JSSSOSiteRemoteUsers)
+                    {
+                        g.setRemoteUsers((JSSSOSiteRemoteUsers)o1);
+                    }
+                }
+            }
+            catch (Exception e)
+            {
+                e.printStackTrace();
+            }
+        }
+    };
+}

Added: portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSSSOSiteRemoteUser.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSSSOSiteRemoteUser.java?rev=788614&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSSSOSiteRemoteUser.java (added)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSSSOSiteRemoteUser.java Fri Jun 26 07:33:22 2009
@@ -0,0 +1,134 @@
+/*
+ * 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.jetspeed.serializer.objects;
+
+import javolution.xml.XMLFormat;
+import javolution.xml.stream.XMLStreamException;
+
+import org.apache.commons.lang.StringEscapeUtils;
+
+/**
+ * Jetspeed Serialized (JS) SSORemoteUser
+ * 
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id: $
+ */
+public class JSSSOSiteRemoteUser
+{
+    private String principalName;
+
+    private String principalType;
+    
+    private String name;
+    
+    private char[] password;
+
+    public JSSSOSiteRemoteUser()
+    {
+    }
+
+    public String getPrincipalName()
+    {
+        return principalName;
+    }
+
+    public void setPrincipalName(String principalName)
+    {
+        this.principalName = principalName;
+    }
+
+    public String getPrincipalType()
+    {
+        return principalType;
+    }
+
+    public void setPrincipalType(String principalType)
+    {
+        this.principalType = principalType;
+    }
+
+    public String getName()
+    {
+        return name;
+    }
+
+    public void setName(String name)
+    {
+        this.name = name;
+    }
+
+    public char[] getPassword()
+    {
+        return password;
+    }
+
+    public void setPassword(char[] password)
+    {
+        this.password = password;
+    }
+
+    public void setUserCredential(String name, char[] password)
+    {
+        setName(name);
+        setPassword(password);
+    }
+
+    /***************************************************************************
+     * SERIALIZER
+     */
+    @SuppressWarnings("unused")
+    private static final XMLFormat XML = new XMLFormat(JSSSOSiteRemoteUser.class)
+    {
+        public void write(Object o, OutputElement xml) throws XMLStreamException
+        {
+            try
+            {
+                JSSSOSiteRemoteUser g = (JSSSOSiteRemoteUser) o;
+
+                xml.setAttribute("principalName", g.getPrincipalName());
+                xml.setAttribute("principalType", g.getPrincipalType());
+                xml.setAttribute("name", g.getName());
+                if (g.getPassword() != null)
+                {
+                    xml.setAttribute("password", new String(g.getPassword()));
+                }
+            }
+            catch (Exception e)
+            {
+                e.printStackTrace();
+            }
+        }
+
+        public void read(InputElement xml, Object o)
+        {
+            try
+            {
+                JSSSOSiteRemoteUser g = (JSSSOSiteRemoteUser) o;
+
+                g.setPrincipalName(StringEscapeUtils.unescapeHtml(xml.getAttribute("principalName", (String)null)));
+                g.setPrincipalType(StringEscapeUtils.unescapeHtml(xml.getAttribute("principalType", (String)null)));
+                g.setName(StringEscapeUtils.unescapeHtml(xml.getAttribute("name", (String)null)));
+                String passwordString = StringEscapeUtils.unescapeHtml(xml.getAttribute("password", (String)null));
+                g.setPassword((passwordString != null) ? passwordString.toCharArray() : null);
+            }
+            catch (Exception e)
+            {
+                e.printStackTrace();
+            }
+        }
+    };
+}

Added: portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSSSOSiteRemoteUsers.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSSSOSiteRemoteUsers.java?rev=788614&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSSSOSiteRemoteUsers.java (added)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSSSOSiteRemoteUsers.java Fri Jun 26 07:33:22 2009
@@ -0,0 +1,31 @@
+/*
+ * 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.jetspeed.serializer.objects;
+
+import java.util.ArrayList;
+
+/**
+ * Simple wrapper class for XML serialization
+ * 
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id: $
+ *
+ */
+public class JSSSOSiteRemoteUsers extends ArrayList<JSSSOSiteRemoteUser>
+{
+    private static final long serialVersionUID = 1L;
+}

Added: portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSSSOSites.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSSSOSites.java?rev=788614&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSSSOSites.java (added)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSSSOSites.java Fri Jun 26 07:33:22 2009
@@ -0,0 +1,31 @@
+/*
+ * 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.jetspeed.serializer.objects;
+
+import java.util.ArrayList;
+
+/**
+ * Simple wrapper class for XML serialization
+ * 
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id: $
+ *
+ */
+public class JSSSOSites extends ArrayList<JSSSOSite>
+{
+    private static final long serialVersionUID = 1L;
+}

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSSnapshot.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSSnapshot.java?rev=788614&r1=788613&r2=788614&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSSnapshot.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-serializer/src/main/java/org/apache/jetspeed/serializer/objects/JSSnapshot.java Fri Jun 26 07:33:22 2009
@@ -68,8 +68,10 @@
     private JSApplications applications;
     
     private JSSecurityDomains securityDomains;
-    
 
+    private JSSSOSites ssoSites;
+
+    
     /**
      * check the software version and subvversion against the saved
      * version...and verify whether it is compatible...
@@ -96,6 +98,7 @@
         rules = new JSProfilingRules();
         applications = new JSApplications();
         securityDomains=new JSSecurityDomains();
+        ssoSites = new JSSSOSites();
     }
 
     public JSSnapshot(String name)
@@ -434,6 +437,23 @@
         this.securityDomains = securityDomains;
     }
 
+    /**
+     * @return Returns the SSOSites.
+     */
+    public JSSSOSites getSSOSites()
+    {
+        return ssoSites;
+    }
+
+    /**
+     * @param sites
+     *            The SSO sites to set.
+     */
+    public void setSSOSites(JSSSOSites sites)
+    {
+        this.ssoSites = sites;
+    }
+
 
     /***************************************************************************
      * SERIALIZER
@@ -519,6 +539,10 @@
                 {
                     xml.add(g.getSecurityDomains());
                 }
+                if ( !g.getSSOSites().isEmpty() )
+                {
+                    xml.add(g.getSSOSites());
+                }
             }
             catch (Exception e)
             {
@@ -589,6 +613,8 @@
                         g.applications = (JSApplications) o1;
                     else if (o1 instanceof JSSecurityDomains)
                         g.securityDomains = (JSSecurityDomains) o1;
+                    else if (o1 instanceof JSSSOSites)
+                        g.ssoSites = (JSSSOSites) o1;
                 }
             }
             catch (Exception e)

Added: portals/jetspeed-2/portal/trunk/components/jetspeed-sso/src/main/java/org/apache/jetspeed/serializer/JetspeedSSOSerializer.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-sso/src/main/java/org/apache/jetspeed/serializer/JetspeedSSOSerializer.java?rev=788614&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-sso/src/main/java/org/apache/jetspeed/serializer/JetspeedSSOSerializer.java (added)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-sso/src/main/java/org/apache/jetspeed/serializer/JetspeedSSOSerializer.java Fri Jun 26 07:33:22 2009
@@ -0,0 +1,329 @@
+/*
+ * 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.jetspeed.serializer;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.jetspeed.security.JetspeedPrincipal;
+import org.apache.jetspeed.security.PasswordCredential;
+import org.apache.jetspeed.security.GroupManager;
+import org.apache.jetspeed.security.SecurityException;
+import org.apache.jetspeed.security.UserManager;
+import org.apache.jetspeed.serializer.objects.JSSnapshot;
+import org.apache.jetspeed.serializer.objects.JSSSOSite;
+import org.apache.jetspeed.serializer.objects.JSSSOSiteRemoteUser;
+import org.apache.jetspeed.serializer.objects.JSSSOSites;
+import org.apache.jetspeed.sso.SSOException;
+import org.apache.jetspeed.sso.SSOManager;
+import org.apache.jetspeed.sso.SSOSite;
+import org.apache.jetspeed.sso.SSOUser;
+import org.apache.jetspeed.sso.impl.SSOUtils;
+import org.slf4j.Logger;
+
+/**
+ * JetspeedSSOSerializer - Profiler component serializer
+ *
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id$
+ */
+public class JetspeedSSOSerializer extends AbstractJetspeedComponentSerializer
+{
+    private SSOManager ssoManager;
+    private GroupManager groupManager;
+    private UserManager userManager;
+    
+    public JetspeedSSOSerializer(SSOManager ssoManager, GroupManager groupManager, UserManager userManager)
+    {
+        this.ssoManager = ssoManager;
+        this.groupManager = groupManager;
+        this.userManager = userManager;
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.serializer.AbstractJetspeedComponentSerializer#deleteData(java.util.Map, org.slf4j.Logger)
+     */
+    protected void deleteData(Map settings, Logger log) throws SerializerException
+    {
+        if (isSettingSet(settings, JetspeedSerializer.KEY_PROCESS_SSO))
+        {
+            log.info("deleting SSO sites, principals, and security domains");
+        }
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.serializer.AbstractJetspeedComponentSerializer#processExport(org.apache.jetspeed.serializer.objects.JSSnapshot, java.util.Map, org.slf4j.Logger)
+     */
+    protected void processExport(JSSnapshot data, Map settings, Logger log) throws SerializerException
+    {
+        if (isSettingSet(settings, JetspeedSerializer.KEY_PROCESS_SSO))
+        {
+            log.info("collecting SSO sites, principals, and security domains");
+            exportSSOSites(data, settings, log);
+        }
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.serializer.AbstractJetspeedComponentSerializer#processImport(org.apache.jetspeed.serializer.objects.JSSnapshot, java.util.Map, org.slf4j.Logger)
+     */
+    protected void processImport(JSSnapshot data, Map settings, Logger log) throws SerializerException
+    {
+        if (isSettingSet(settings, JetspeedSerializer.KEY_PROCESS_SSO))
+        {
+            log.info("creating SSO sites, principals, and security domains");
+            recreateSSOSites(data, settings, log);
+        }
+    }
+    
+    /**
+     * delete SSO site data
+     * 
+     * @param settings export settings
+     * @param log export logger
+     * @throws SerializerException
+     */
+    private void deleteSSOSites(Map settings, Logger log) throws SerializerException
+    {
+        Iterator<SSOSite> list = null;
+        try
+        {
+            list = (new ArrayList<SSOSite>(ssoManager.getSites(""))).iterator();
+        }
+        catch (Exception e)
+        {
+            throw new SerializerException(SerializerException.GET_EXISTING_OBJECTS.create(new String[]{"SSOSites", e.getMessage()}));
+        }
+        while (list.hasNext())
+        {
+            try
+            {
+                SSOSite s = list.next();
+                ssoManager.removeSite(s);
+            }
+            catch (Exception e)
+            {
+                throw new SerializerException(e);
+            }
+        }
+    }
+
+    /**
+     * Create the SSO Site Wrapper
+     * 
+     * @param s sso site
+     * @return sso site wrapper
+     * @throws SSOException
+     */
+    private JSSSOSite createSSOSite(SSOSite s) throws SSOException
+    {
+        JSSSOSite site = new JSSSOSite();
+        site.setName(s.getName());
+        site.setSiteURL(s.getURL());
+        site.setAllowUserSet(s.isAllowUserSet());
+        site.setCertificateRequired(s.isCertificateRequired());
+        site.setChallengeResponseAuthentication(s.isChallengeResponseAuthentication());
+        site.setRealm(s.getRealm());
+        site.setFormAuthentication(s.isFormAuthentication());
+        site.setFormUserField(s.getFormUserField());
+        site.setFormPwdField(s.getFormPwdField());
+
+        Iterator<SSOUser> ruIter = ssoManager.getUsersForSite(s).iterator();
+        while (ruIter.hasNext())
+        {
+            SSOUser ru = ruIter.next();
+            PasswordCredential ruCredential = ssoManager.getCredentials(ru);
+            if (ruCredential != null)
+            {
+                String ruName = ru.getName();
+                String rupType = null;
+                String rupName = null;
+                Collection<JetspeedPrincipal> ruPrincipals = ssoManager.getPortalPrincipals(ru);
+                if ((ruPrincipals != null) && !ruPrincipals.isEmpty())
+                {
+                    JetspeedPrincipal rup = ruPrincipals.iterator().next();
+                    rupName = rup.getName();
+                    if (rup.getType().getName().equals("user"))
+                    {
+                        rupType = "user";
+                    }
+                    else if (rup.getType().getName().equals("group"))
+                    {
+                        rupType = "group";
+                    }
+                }
+                if ((rupName != null) && (rupType != null))
+                {
+                    String ruPassword = SSOUtils.scramble(ruCredential.getPassword());
+                    JSSSOSiteRemoteUser siteRemoteUser = new JSSSOSiteRemoteUser();
+                    siteRemoteUser.setPrincipalName(rupName);
+                    siteRemoteUser.setPrincipalType(rupType);
+                    siteRemoteUser.setUserCredential(ruName, ruPassword.toCharArray());
+                    site.addRemoteUser(siteRemoteUser);
+                }
+            }
+        }
+
+        return site;
+    }
+
+    /**
+     * extract SSO sites and save in snapshot file
+     * 
+     * @param data sso data snapshot
+     * @param settings export settings
+     * @param log export logger
+     * @throws SerializerException
+     */
+    private void exportSSOSites(JSSnapshot data, Map settings, Logger log) throws SerializerException
+    {
+        Map<String,JSSSOSite> ssoSitesMap = new HashMap<String,JSSSOSite>();
+        Iterator<SSOSite> list = null;
+        try
+        {
+            list = ssoManager.getSites("").iterator();
+        }
+        catch (Exception e)
+        {
+            throw new SerializerException(SerializerException.GET_EXISTING_OBJECTS.create(new String[]{"SSOSites", e.getMessage()}));
+        }
+        while (list.hasNext())
+        {
+            try
+            {
+                SSOSite s = list.next();                
+                if (!(ssoSitesMap.containsKey(s.getURL())))
+                {
+                    JSSSOSite site = createSSOSite(s);
+                    ssoSitesMap.put(site.getSiteURL(), site);
+                    data.getSSOSites().add(site);
+                }
+            }
+            catch (Exception e)
+            {
+                throw new SerializerException(SerializerException.CREATE_SERIALIZED_OBJECT_FAILED.create(new String[]{"SSOSites", e.getMessage()}));
+            }
+        }
+    }
+    
+    /**
+     * Construct SSO site from (JS) SSOSite.
+     * 
+     * @param site SSO site
+     * @param s existing SSO site
+     * @return created SSO site
+     * @throws SerializerException
+     * @throws SSOException
+     * @throws SecurityException
+     */
+    private SSOSite recreateSSOSite(JSSSOSite site, SSOSite s) throws SerializerException, SSOException, SecurityException
+    {
+        if (s != null)
+        {
+            ssoManager.removeSite(s);
+        }
+        
+        s = ssoManager.newSite(site.getName(), site.getSiteURL());
+        s = ssoManager.addSite(s);
+        s.setAllowUserSet(site.isAllowUserSet());
+        s.setCertificateRequired(site.isCertificateRequired());
+        s.setChallengeResponseAuthentication(site.isChallengeResponseAuthentication());
+        s.setRealm(site.getRealm());
+        s.setFormAuthentication(site.isFormAuthentication());
+        s.setFormUserField(site.getFormUserField());
+        s.setFormPwdField(site.getFormPwdField());
+
+        if (site.getRemoteUsers() != null)
+        {
+            Iterator<JSSSOSiteRemoteUser> ruIter = site.getRemoteUsers().iterator();
+            while (ruIter.hasNext())
+            {
+                JSSSOSiteRemoteUser rUser = ruIter.next();
+                if (rUser.getPassword() != null)
+                {
+                    String pName = rUser.getPrincipalName();
+                    String pType = rUser.getPrincipalType();
+                    JetspeedPrincipal principal = null;
+                    if (pType.equals("user"))
+                    {
+                        principal = userManager.getUser(pName);
+                    }
+                    else if (pType.equals("group"))
+                    {
+                        principal = groupManager.getGroup(pName);
+                    }
+                    if (principal != null)
+                    {
+                        String rName = rUser.getName();
+                        String rPassword = new String(rUser.getPassword());
+                        ssoManager.addUser(s, principal, rName, SSOUtils.unscramble(rPassword));
+                    }
+                    else
+                    {
+                        throw new IllegalArgumentException("Cannot lookup or create SSO remote user for principal "+pType+":"+pName);
+                    }
+                }
+            }
+        }
+        
+        return s;
+    }
+    
+    /**
+     * Create imported SSO sites.
+     * 
+     * @param data sso data snapshot
+     * @param settings import settings
+     * @param log import logger
+     * @throws SerializerException
+     */
+    private void recreateSSOSites(JSSnapshot data, Map settings, Logger log) throws SerializerException
+    {
+        log.debug("recreateSSOSites - processing");
+
+        JSSSOSites sites = data.getSSOSites();
+        if ((sites != null) && (sites.size() > 0))
+        {
+            Iterator<JSSSOSite> sitesIter = sites.iterator();
+            while (sitesIter.hasNext())
+            {
+                JSSSOSite site = sitesIter.next();
+                try
+                {
+                    SSOSite s = ssoManager.getSiteByUrl(site.getSiteURL());
+                    if ((s == null) || isSettingSet(settings, JetspeedSerializer.KEY_OVERWRITE_EXISTING))
+                    {
+                        s = recreateSSOSite(site, s);
+                        ssoManager.updateSite(s);
+                    }
+                }
+                catch (Exception e)
+                {
+                    throw new SerializerException(SerializerException.CREATE_OBJECT_FAILED.create("SSOSite",e.getLocalizedMessage()));
+                }
+            }
+        }
+        else
+        {
+            log.debug("NO SSO SITES?????");
+        }
+        
+        log.debug("recreateSSOSites - done");        
+    }
+}

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-sso/src/main/java/org/apache/jetspeed/sso/impl/SSOClientImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-sso/src/main/java/org/apache/jetspeed/sso/impl/SSOClientImpl.java?rev=788614&r1=788613&r2=788614&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-sso/src/main/java/org/apache/jetspeed/sso/impl/SSOClientImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-sso/src/main/java/org/apache/jetspeed/sso/impl/SSOClientImpl.java Fri Jun 26 07:33:22 2009
@@ -148,7 +148,7 @@
         httpClient.getState().setCredentials(
                 site.getRealm(),
                 url.getHost(),
-                new UsernamePasswordCredentials(credential.getUserName(),  this.unscramble(credential.getPassword()))
+                new UsernamePasswordCredentials(credential.getUserName(), SSOUtils.unscramble(credential.getPassword()))
             );
      // Build URL if it's Form authentication
         StringBuffer siteURL = new StringBuffer(site.getURL());
@@ -156,7 +156,7 @@
         // Check if it's form based or ChallengeResponse
         if (site.isFormAuthentication())
         {
-            siteURL.append("?").append(site.getFormUserField()).append("=").append(credential.getUserName()).append("&").append(site.getFormPwdField()).append("=").append(this.unscramble(credential.getPassword()));
+            siteURL.append("?").append(site.getFormUserField()).append("=").append(credential.getUserName()).append("&").append(site.getFormPwdField()).append("=").append(SSOUtils.unscramble(credential.getPassword()));
         }
         
         get.setDoAuthentication( true );
@@ -171,27 +171,4 @@
         }
         return status;      
     }
-        
-    static char[] scrambler ="Jestspeed-2 is getting ready for release".toCharArray();
-    
-    private char[] xor(char[] a, char[]b)
-    {
-        int len = Math.min(a.length, b.length);
-        char[] result = new char[len];
-        for(int i=0; i<len;i++)
-        {
-            result[i] = (char) (a[i] ^ b[i]);
-        }
-        return result;
-    }
-    
-    private String unscramble(String pwd)
-    {
-        byte[] bytes = pwd.getBytes();
-        bytes = Base64.decodeBase64(bytes);
-        String chars = new String(bytes);
-        String unscrambled = new String(xor(chars.toCharArray(), scrambler));
-        return unscrambled;
-    }
-    
 }

Added: portals/jetspeed-2/portal/trunk/components/jetspeed-sso/src/main/java/org/apache/jetspeed/sso/impl/SSOUtils.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-sso/src/main/java/org/apache/jetspeed/sso/impl/SSOUtils.java?rev=788614&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-sso/src/main/java/org/apache/jetspeed/sso/impl/SSOUtils.java (added)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-sso/src/main/java/org/apache/jetspeed/sso/impl/SSOUtils.java Fri Jun 26 07:33:22 2009
@@ -0,0 +1,62 @@
+/* 
+ * 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.jetspeed.sso.impl;
+
+import org.apache.commons.codec.binary.Base64;
+
+public class SSOUtils
+{
+    /*
+     * Simple encryption decryption routines since the API creates credentials 
+     * together with an user.
+     * TODO: re-implement when Security API is more flexible
+     */
+    private static char[] scrambler = "Jestspeed-2 is getting ready for release".toCharArray();
+    
+    public static String scramble(String pwd)
+    {
+        // xor-ing persistent String values is dangerous because of the (uncommon) way Java encodes UTF-8 0x00 (and some other characters).
+        // See: http://en.wikipedia.org/wiki/UTF-8#Java
+        // On some database platforms, like PostgreSQL this can lead to something like:
+        //   org.postgresql.util.PSQLException: ERROR: invalid byte sequence for encoding "UTF8": 0x00
+        // To prevent this, the resulting xored password is encoded in Base64
+        String xored = new String(xor(pwd.toCharArray(), scrambler));
+        byte[] bytes = Base64.encodeBase64(xored.getBytes());
+        String scrambled = new String(bytes);
+        return scrambled;
+    }
+    
+    public static String unscramble(String pwd)
+    {
+        byte[] bytes = pwd.getBytes();
+        bytes = Base64.decodeBase64(bytes);
+        String chars = new String(bytes);
+        String unscrambled = new String(xor(chars.toCharArray(), scrambler));
+        return unscrambled;
+    }
+    
+    private static char[] xor(char[] a, char[]b)
+    {
+        int len = Math.min(a.length, b.length);
+        char[] result = new char[len];
+        for (int i=0; (i < len); i++)
+        {
+            result[i] = (char) (a[i] ^ b[i]);
+        }
+        return result;
+    }
+}

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/serializer/JetspeedSerializer.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/serializer/JetspeedSerializer.java?rev=788614&r1=788613&r2=788614&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/serializer/JetspeedSerializer.java (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/serializer/JetspeedSerializer.java Fri Jun 26 07:33:22 2009
@@ -71,6 +71,7 @@
     String KEY_PROCESS_USER_PREFERENCES = "process_user_preferences";
     String KEY_PROCESS_PORTAL_PREFERENCES = "process_portal_preferences";
     String KEY_PROCESS_USER_TEMPLATES = "process_user_templates";
+    String KEY_PROCESS_SSO = "process_sso";
     String KEY_LOGGER = "logger";
     String KEY_OVERWRITE_EXISTING = "overwrite_existing";
     String KEY_BACKUP_BEFORE_PROCESS = "backup_before_process";

Modified: portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/serializer.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/serializer.xml?rev=788614&r1=788613&r2=788614&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/serializer.xml (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/serializer.xml Fri Jun 26 07:33:22 2009
@@ -45,6 +45,11 @@
           <constructor-arg index="1" ref="org.apache.jetspeed.components.portletpreferences.PortletPreferencesProvider" />
           <constructor-arg index="2" ref="org.apache.jetspeed.search.SearchEngine" />
         </bean>
+        <bean class="org.apache.jetspeed.serializer.JetspeedSSOSerializer">
+          <constructor-arg index="0" ref="org.apache.jetspeed.sso.SSOManager" />
+          <constructor-arg index="1" ref="org.apache.jetspeed.security.GroupManager" />
+          <constructor-arg index="2" ref="org.apache.jetspeed.security.UserManager" />
+        </bean>
         <!-- 
           <bean class="org.apache.jetspeed.serializer.JetspeedUserTemplateSerializer">
           <constructor-arg index="0" ref="org.apache.jetspeed.page.PageManager" />
@@ -81,6 +86,9 @@
         <entry key="process_user_templates">
           <value type="java.lang.Boolean">true</value>
         </entry>
+        <entry key="process_sso">
+          <value type="java.lang.Boolean">true</value>
+        </entry>
         <!--  following serializers are not yet implemented/available -->
         <entry key="process_portal_preferences">
           <value type="java.lang.Boolean">false</value>

Modified: portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/sso.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/sso.xml?rev=788614&r1=788613&r2=788614&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/sso.xml (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/sso.xml Fri Jun 26 07:33:22 2009
@@ -154,13 +154,9 @@
     </property>
     <property name="transactionAttributes">
       <props>
-        <prop key="addSite*">PROPAGATION_REQUIRED</prop>
-        <prop key="updateSite*">PROPAGATION_REQUIRED</prop>
-        <prop key="removeSite">PROPAGATION_REQUIRED</prop>
-        <prop key="addCredentialsForSite">PROPAGATION_REQUIRED</prop>
-        <prop key="updateCredentialsForSite">PROPAGATION_REQUIRED</prop>
-        <prop key="removeCredentialsForSite">PROPAGATION_REQUIRED</prop>
-        <prop key="setRealmForSite">PROPAGATION_REQUIRED</prop>
+        <prop key="add">PROPAGATION_REQUIRED</prop>
+        <prop key="update">PROPAGATION_REQUIRED</prop>
+        <prop key="remove">PROPAGATION_REQUIRED</prop>
         <prop key="*">PROPAGATION_SUPPORTS</prop>
       </props>
     </property>



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message