continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r1134319 - in /continuum/trunk: ./ continuum-api/src/main/java/org/apache/continuum/configuration/ continuum-api/src/main/java/org/apache/maven/continuum/configuration/ continuum-base/continuum-configuration/src/main/java/org/apache/continu...
Date Fri, 10 Jun 2011 13:27:05 GMT
Author: ctan
Date: Fri Jun 10 13:27:04 2011
New Revision: 1134319

URL: http://svn.apache.org/viewvc?rev=1134319&view=rev
Log:
[CONTINUUM-2044] added a pre-shared encrypted key between the master and all its agents

Added:
    continuum/trunk/continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/configuration/
    continuum/trunk/continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfigurationException.java   (with props)
    continuum/trunk/continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfigurationService.java   (with props)
    continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-server/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportAuthenticator.java   (with props)
Removed:
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfigurationException.java
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfigurationService.java
Modified:
    continuum/trunk/continuum-api/src/main/java/org/apache/continuum/configuration/GeneralConfiguration.java
    continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/configuration/ConfigurationService.java
    continuum/trunk/continuum-base/continuum-configuration/src/main/java/org/apache/continuum/configuration/DefaultContinuumConfiguration.java
    continuum/trunk/continuum-base/continuum-configuration/src/main/mdo/continuum-configuration.xml
    continuum/trunk/continuum-buildagent/continuum-buildagent-api/pom.xml
    continuum/trunk/continuum-buildagent/continuum-buildagent-api/src/main/mdo/continuum-buildagent.xml
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultBuildAgentConfiguration.java
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultBuildAgentConfigurationService.java
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/GeneralBuildAgentConfiguration.java
    continuum/trunk/continuum-buildagent/continuum-buildagent-webapp/src/main/resources/applicationContext.xml
    continuum/trunk/continuum-buildagent/continuum-buildagent-webapp/src/main/webapp/WEB-INF/web.xml
    continuum/trunk/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildProjectTaskExecutor.java
    continuum/trunk/continuum-commons/pom.xml
    continuum/trunk/continuum-commons/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java
    continuum/trunk/continuum-commons/src/test/java/org/apache/maven/continuum/configuration/ConfigurationServiceTest.java
    continuum/trunk/continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java
    continuum/trunk/continuum-core/src/main/java/org/apache/continuum/release/distributed/manager/DefaultDistributedReleaseManager.java
    continuum/trunk/continuum-core/src/test/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManagerTest.java
    continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-server/pom.xml
    continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/configuration/ConfigurationServiceMock.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigurationAction.java
    continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
    continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/configurationEdit.jsp
    continuum/trunk/pom.xml

Modified: continuum/trunk/continuum-api/src/main/java/org/apache/continuum/configuration/GeneralConfiguration.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-api/src/main/java/org/apache/continuum/configuration/GeneralConfiguration.java?rev=1134319&r1=1134318&r2=1134319&view=diff
==============================================================================
--- continuum/trunk/continuum-api/src/main/java/org/apache/continuum/configuration/GeneralConfiguration.java (original)
+++ continuum/trunk/continuum-api/src/main/java/org/apache/continuum/configuration/GeneralConfiguration.java Fri Jun 10 13:27:04 2011
@@ -51,6 +51,8 @@ public class GeneralConfiguration
     
     private boolean distributedBuildEnabled;
 
+    private String sharedSecretPassword;
+
     public GeneralConfiguration()
     {
         // nothing here
@@ -161,4 +163,14 @@ public class GeneralConfiguration
     {
         this.distributedBuildEnabled = distributedBuildEnabled;
     }
+
+    public void setSharedSecretPassword( String sharedSecretPassword )
+    {
+        this.sharedSecretPassword = sharedSecretPassword;
+    }
+
+    public String getSharedSecretPassword()
+    {
+        return sharedSecretPassword;
+    }
 }

Modified: continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/configuration/ConfigurationService.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/configuration/ConfigurationService.java?rev=1134319&r1=1134318&r2=1134319&view=diff
==============================================================================
--- continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/configuration/ConfigurationService.java (original)
+++ continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/configuration/ConfigurationService.java Fri Jun 10 13:27:04 2011
@@ -134,6 +134,10 @@ public interface ConfigurationService
 
     boolean containsBuildAgentUrl(String buildAgentUrl,  BuildAgentGroupConfiguration buildAgentGroup );
 
+    void setSharedSecretPassword( String sharedSecretPassword );
+
+    String getSharedSecretPassword();
+
     // ----------------------------------------------------------------------
     //
     // ----------------------------------------------------------------------

Modified: continuum/trunk/continuum-base/continuum-configuration/src/main/java/org/apache/continuum/configuration/DefaultContinuumConfiguration.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-base/continuum-configuration/src/main/java/org/apache/continuum/configuration/DefaultContinuumConfiguration.java?rev=1134319&r1=1134318&r2=1134319&view=diff
==============================================================================
--- continuum/trunk/continuum-base/continuum-configuration/src/main/java/org/apache/continuum/configuration/DefaultContinuumConfiguration.java (original)
+++ continuum/trunk/continuum-base/continuum-configuration/src/main/java/org/apache/continuum/configuration/DefaultContinuumConfiguration.java Fri Jun 10 13:27:04 2011
@@ -126,6 +126,7 @@ public class DefaultContinuumConfigurati
 
             this.generalConfiguration.setNumberOfBuildsInParallel( configuration.getNumberOfBuildsInParallel() );
             this.generalConfiguration.setBaseUrl( configuration.getBaseUrl() );
+            this.generalConfiguration.setSharedSecretPassword( configuration.getSharedSecretPassword() );
             
             if ( StringUtils.isNotEmpty( configuration.getBuildOutputDirectory() ) )
             {
@@ -232,6 +233,7 @@ public class DefaultContinuumConfigurati
             ContinuumConfigurationModel configurationModel = new ContinuumConfigurationModel();
             configurationModel.setBaseUrl( this.generalConfiguration.getBaseUrl() );
             configurationModel.setNumberOfBuildsInParallel( this.generalConfiguration.getNumberOfBuildsInParallel() );
+            configurationModel.setSharedSecretPassword( this.generalConfiguration.getSharedSecretPassword() );
 
             // normally not null but NPE free is better !
             if ( this.generalConfiguration.getBuildOutputDirectory() != null )

Modified: continuum/trunk/continuum-base/continuum-configuration/src/main/mdo/continuum-configuration.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-base/continuum-configuration/src/main/mdo/continuum-configuration.xml?rev=1134319&r1=1134318&r2=1134319&view=diff
==============================================================================
--- continuum/trunk/continuum-base/continuum-configuration/src/main/mdo/continuum-configuration.xml (original)
+++ continuum/trunk/continuum-base/continuum-configuration/src/main/mdo/continuum-configuration.xml Fri Jun 10 13:27:04 2011
@@ -77,6 +77,11 @@
           <type>boolean</type>
         </field>
         <field>
+          <name>sharedSecretPassword</name>
+          <version>1.4.1+</version>
+          <type>String</type>
+        </field>
+        <field>
           <name>buildAgents</name>
           <version>1.1.0+</version>
           <association>

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-api/pom.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-api/pom.xml?rev=1134319&r1=1134318&r2=1134319&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-api/pom.xml (original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-api/pom.xml Fri Jun 10 13:27:04 2011
@@ -38,7 +38,7 @@ under the License.
             <model>src/main/mdo/continuum-buildagent.xml</model>
           </models>
           <useJava5>true</useJava5>
-          <version>1.1.0</version>
+          <version>1.4.1</version>
         </configuration>
         <executions>
           <execution>

Added: continuum/trunk/continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfigurationException.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfigurationException.java?rev=1134319&view=auto
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfigurationException.java (added)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfigurationException.java Fri Jun 10 13:27:04 2011
@@ -0,0 +1,39 @@
+package org.apache.continuum.buildagent.configuration;
+
+/*
+ * 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.
+ */
+
+public class BuildAgentConfigurationException
+    extends Exception
+{
+    public BuildAgentConfigurationException( String message )
+    {
+        super( message );
+    }
+
+    public BuildAgentConfigurationException( Throwable cause )
+    {
+        super( cause );
+    }
+
+    public BuildAgentConfigurationException( String message, Throwable cause )
+    {
+        super( message, cause );
+    }
+}

Propchange: continuum/trunk/continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfigurationException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/trunk/continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfigurationException.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: continuum/trunk/continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfigurationService.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfigurationService.java?rev=1134319&view=auto
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfigurationService.java (added)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfigurationService.java Fri Jun 10 13:27:04 2011
@@ -0,0 +1,53 @@
+package org.apache.continuum.buildagent.configuration;
+
+/*
+ * 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.
+ */
+
+import java.io.File;
+import java.util.List;
+
+import org.apache.continuum.buildagent.model.Installation;
+import org.apache.continuum.buildagent.model.LocalRepository;
+
+public interface BuildAgentConfigurationService
+{
+    String ROLE = BuildAgentConfigurationService.class.getName();
+
+    File getBuildOutputDirectory();
+
+    File getBuildOutputDirectory( int projectId );
+
+    File getWorkingDirectory();
+
+    File getWorkingDirectory( int projectId );
+
+    String getContinuumServerUrl();
+
+    String getBuildOutput( int projectId )
+        throws BuildAgentConfigurationException;
+
+    File getBuildOutputFile( int projectId )
+        throws BuildAgentConfigurationException;
+
+    List<Installation> getAvailableInstallations();
+    
+    List<LocalRepository> getLocalRepositories();
+
+    String getSharedSecretPassword();
+}

Propchange: continuum/trunk/continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfigurationService.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/trunk/continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfigurationService.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-api/src/main/mdo/continuum-buildagent.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-api/src/main/mdo/continuum-buildagent.xml?rev=1134319&r1=1134318&r2=1134319&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-api/src/main/mdo/continuum-buildagent.xml (original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-api/src/main/mdo/continuum-buildagent.xml Fri Jun 10 13:27:04 2011
@@ -63,6 +63,11 @@
             <multiplicity>*</multiplicity>
           </association>
         </field>
+        <field>
+          <name>sharedSecretPassword</name>
+          <version>1.4.1+</version>
+          <type>String</type>
+        </field>
       </fields>
     </class>
     <class xml.tagName="buildagent-installation">

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultBuildAgentConfiguration.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultBuildAgentConfiguration.java?rev=1134319&r1=1134318&r2=1134319&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultBuildAgentConfiguration.java (original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultBuildAgentConfiguration.java Fri Jun 10 13:27:04 2011
@@ -106,6 +106,7 @@ public class DefaultBuildAgentConfigurat
             this.generalBuildAgentConfiguration.setContinuumServerUrl( configuration.getContinuumServerUrl() );
             this.generalBuildAgentConfiguration.setInstallations( configuration.getInstallations() );
             this.generalBuildAgentConfiguration.setLocalRepositories( configuration.getLocalRepositories() );
+            this.generalBuildAgentConfiguration.setSharedSecretPassword( configuration.getSharedSecretPassword() );
         }
         catch ( IOException e )
         {
@@ -155,6 +156,7 @@ public class DefaultBuildAgentConfigurat
             configurationModel.setContinuumServerUrl( this.generalBuildAgentConfiguration.getContinuumServerUrl() );
             configurationModel.setInstallations( this.generalBuildAgentConfiguration.getInstallations() );
             configurationModel.setLocalRepositories( this.generalBuildAgentConfiguration.getLocalRepositories() );
+            configurationModel.setSharedSecretPassword( this.generalBuildAgentConfiguration.getSharedSecretPassword() );
 
             ContinuumBuildAgentConfigurationModelXpp3Writer writer =
                 new ContinuumBuildAgentConfigurationModelXpp3Writer();

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultBuildAgentConfigurationService.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultBuildAgentConfigurationService.java?rev=1134319&r1=1134318&r2=1134319&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultBuildAgentConfigurationService.java (original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultBuildAgentConfigurationService.java Fri Jun 10 13:27:04 2011
@@ -149,7 +149,12 @@ public class DefaultBuildAgentConfigurat
     {
         return generalBuildAgentConfiguration.getLocalRepositories();
     }
-    
+
+    public String getSharedSecretPassword()
+    {
+        return generalBuildAgentConfiguration.getSharedSecretPassword();
+    }
+
     private void loadData()
         throws BuildAgentConfigurationException
     {

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/GeneralBuildAgentConfiguration.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/GeneralBuildAgentConfiguration.java?rev=1134319&r1=1134318&r2=1134319&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/GeneralBuildAgentConfiguration.java (original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/GeneralBuildAgentConfiguration.java Fri Jun 10 13:27:04 2011
@@ -37,6 +37,8 @@ public class GeneralBuildAgentConfigurat
     
     private List<LocalRepository> localRepositories;
 
+    private String sharedSecretPassword;
+
     public File getWorkingDirectory()
     {
         return workingDirectory;
@@ -86,4 +88,14 @@ public class GeneralBuildAgentConfigurat
     {
         this.localRepositories = localRepositories;
     }
+
+    public void setSharedSecretPassword( String sharedSecretPassword )
+    {
+        this.sharedSecretPassword = sharedSecretPassword;
+    }
+
+    public String getSharedSecretPassword()
+    {
+        return sharedSecretPassword;
+    }
 }

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-webapp/src/main/resources/applicationContext.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-webapp/src/main/resources/applicationContext.xml?rev=1134319&r1=1134318&r2=1134319&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-webapp/src/main/resources/applicationContext.xml (original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-webapp/src/main/resources/applicationContext.xml Fri Jun 10 13:27:04 2011
@@ -4,16 +4,19 @@
        xsi:schemaLocation="http://www.springframework.org/schema/beans
            http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
   
-  <bean id="slaveBuildAgentTransportServer" class="org.apache.continuum.distributed.transport.slave.SlaveBuildAgentTransportServer">
+  <bean id="slaveBuildAgentTransportServer" lazy-init="true" scope="singleton" class="org.apache.continuum.distributed.transport.slave.SlaveBuildAgentTransportServer">
     <constructor-arg ref="continuumBuildAgentService"/>
   </bean>
 
-  <bean name="xmlrpcServicesList" class="java.util.ArrayList">
+  <bean name="xmlrpcServicesList" lazy-init="true" scope="singleton" class="java.util.ArrayList">
     <constructor-arg>
       <list>
         <ref bean="slaveBuildAgentTransportServer"/>
       </list>
     </constructor-arg>
   </bean>
-  
+
+  <bean name="xmlRpcAuthenticator" class="org.apache.continuum.distributed.transport.slave.SlaveBuildAgentTransportAuthenticator">
+    <constructor-arg ref="buildAgentConfigurationService"/>
+  </bean>
 </beans>

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-webapp/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-webapp/src/main/webapp/WEB-INF/web.xml?rev=1134319&r1=1134318&r2=1134319&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-webapp/src/main/webapp/WEB-INF/web.xml (original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-webapp/src/main/webapp/WEB-INF/web.xml Fri Jun 10 13:27:04 2011
@@ -58,6 +58,10 @@
       <param-value>xmlrpcServicesList</param-value>
     </init-param>
     <init-param>
+      <param-name>authHandlerBeanName</param-name>
+      <param-value>xmlRpcAuthenticator</param-value>
+    </init-param>
+    <init-param>
       <param-name>enabledForExtensions</param-name>
       <param-value>true</param-value>
     </init-param>

Modified: continuum/trunk/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildProjectTaskExecutor.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildProjectTaskExecutor.java?rev=1134319&r1=1134318&r2=1134319&view=diff
==============================================================================
--- continuum/trunk/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildProjectTaskExecutor.java (original)
+++ continuum/trunk/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildProjectTaskExecutor.java Fri Jun 10 13:27:04 2011
@@ -40,6 +40,7 @@ import org.apache.continuum.utils.Contin
 import org.apache.continuum.utils.ProjectSorter;
 import org.apache.continuum.utils.build.BuildTrigger;
 import org.apache.maven.continuum.ContinuumException;
+import org.apache.maven.continuum.configuration.ConfigurationService;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.BuildResult;
 import org.apache.maven.continuum.model.project.Project;
@@ -85,6 +86,11 @@ public class DistributedBuildProjectTask
      */
     private BuildResultDao buildResultDao;
 
+    /**
+     * @plexus.requirement
+     */
+    private ConfigurationService configurationService;
+
     public void setBuildAgentUrl( String buildAgentUrl )
     {
         this.buildAgentUrl = buildAgentUrl;
@@ -102,7 +108,8 @@ public class DistributedBuildProjectTask
 
         try
         {
-            SlaveBuildAgentTransportClient client = new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
+            SlaveBuildAgentTransportClient client = new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ), "", 
+                                                                                        configurationService.getSharedSecretPassword() );
 
             log.info( "initializing buildContext for projectGroupId=" + prepareBuildTask.getProjectGroupId() );
             List<Map<String, Object>> buildContext =

Modified: continuum/trunk/continuum-commons/pom.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-commons/pom.xml?rev=1134319&r1=1134318&r2=1134319&view=diff
==============================================================================
--- continuum/trunk/continuum-commons/pom.xml (original)
+++ continuum/trunk/continuum-commons/pom.xml Fri Jun 10 13:27:04 2011
@@ -54,7 +54,7 @@ under the License.
     <dependency>
       <groupId>javax.annotation</groupId>
       <artifactId>jsr250-api</artifactId>
-    </dependency>    
+    </dependency>
     <dependency>
       <groupId>commons-lang</groupId>
       <artifactId>commons-lang</artifactId>
@@ -112,7 +112,11 @@ under the License.
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-utils</artifactId>
-    </dependency>    
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.redback</groupId>
+      <artifactId>redback-policy</artifactId>
+    </dependency>
     <dependency>
       <groupId>org.codehaus.redback</groupId>
       <artifactId>plexus-spring</artifactId>

Modified: continuum/trunk/continuum-commons/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-commons/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java?rev=1134319&r1=1134318&r2=1134319&view=diff
==============================================================================
--- continuum/trunk/continuum-commons/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java (original)
+++ continuum/trunk/continuum-commons/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java Fri Jun 10 13:27:04 2011
@@ -39,6 +39,7 @@ import org.apache.maven.continuum.model.
 import org.apache.maven.continuum.model.project.Schedule;
 import org.apache.maven.continuum.model.system.SystemConfiguration;
 import org.apache.maven.continuum.store.ContinuumStoreException;
+import org.codehaus.plexus.redback.policy.PasswordEncoder;
 import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.util.StringUtils;
 import org.slf4j.Logger;
@@ -74,6 +75,9 @@ public class DefaultConfigurationService
 
     private GeneralConfiguration generalConfiguration;
 
+    @Resource( name="passwordEncoder#sha256" )
+    private PasswordEncoder encoder;
+
     // ----------------------------------------------------------------------
     //
     // ----------------------------------------------------------------------
@@ -651,6 +655,29 @@ public class DefaultConfigurationService
         generalConfiguration.setNumberOfBuildsInParallel( num );
     }
 
+    public String getSharedSecretPassword()
+    {
+        return generalConfiguration.getSharedSecretPassword();
+    }
+
+    public void setSharedSecretPassword( String sharedSecretPassword )
+    {
+        String encryptedPassword = encoder.encodePassword( sharedSecretPassword );
+
+        if ( StringUtils.isNotBlank( generalConfiguration.getSharedSecretPassword() ) )
+        {
+            String previousEncodedPassword = generalConfiguration.getSharedSecretPassword();
+            // check if nothing changed
+            if ( previousEncodedPassword.equals( sharedSecretPassword ) || 
+                            previousEncodedPassword.equals( encryptedPassword ) )
+            {
+                return;
+            }
+        }
+
+        generalConfiguration.setSharedSecretPassword( encryptedPassword );
+    }
+
     // ----------------------------------------------------------------------
     //
     // ----------------------------------------------------------------------

Modified: continuum/trunk/continuum-commons/src/test/java/org/apache/maven/continuum/configuration/ConfigurationServiceTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-commons/src/test/java/org/apache/maven/continuum/configuration/ConfigurationServiceTest.java?rev=1134319&r1=1134318&r2=1134319&view=diff
==============================================================================
--- continuum/trunk/continuum-commons/src/test/java/org/apache/maven/continuum/configuration/ConfigurationServiceTest.java (original)
+++ continuum/trunk/continuum-commons/src/test/java/org/apache/maven/continuum/configuration/ConfigurationServiceTest.java Fri Jun 10 13:27:04 2011
@@ -155,5 +155,12 @@ public class ConfigurationServiceTest
         assertEquals( "check # build agent groups", 1, service.getBuildAgentGroups().size() );
         assertEquals( "group-1", service.getBuildAgentGroups().get( 0 ).getName() );
         assertEquals( "windows", service.getBuildAgentGroups().get( 0 ).getBuildAgents().get( 0 ).getDescription() );
+        assertNull( service.getSharedSecretPassword() );
+
+        service.setSharedSecretPassword( "password" );
+        service.store();
+        service.reload();
+
+        assertNotNull( service.getSharedSecretPassword() );
     }
 }

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java?rev=1134319&r1=1134318&r2=1134319&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java Fri Jun 10 13:27:04 2011
@@ -1534,7 +1534,7 @@ public class DefaultDistributedBuildMana
     public SlaveBuildAgentTransportService createSlaveBuildAgentTransportClientConnection( String buildAgentUrl ) 
         throws MalformedURLException, Exception
     {
-        return new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
+        return new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ), "", configurationService.getSharedSecretPassword() );
     }
 
     // for unit testing

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/continuum/release/distributed/manager/DefaultDistributedReleaseManager.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/continuum/release/distributed/manager/DefaultDistributedReleaseManager.java?rev=1134319&r1=1134318&r2=1134319&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/continuum/release/distributed/manager/DefaultDistributedReleaseManager.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/continuum/release/distributed/manager/DefaultDistributedReleaseManager.java Fri Jun 10 13:27:04 2011
@@ -39,6 +39,7 @@ import org.apache.continuum.configuratio
 import org.apache.continuum.configuration.BuildAgentConfigurationException;
 import org.apache.continuum.dao.BuildResultDao;
 import org.apache.continuum.distributed.transport.slave.SlaveBuildAgentTransportClient;
+import org.apache.continuum.distributed.transport.slave.SlaveBuildAgentTransportService;
 import org.apache.continuum.model.repository.LocalRepository;
 import org.apache.continuum.release.distributed.DistributedReleaseUtil;
 import org.apache.continuum.release.model.PreparedRelease;
@@ -53,7 +54,6 @@ import org.apache.maven.continuum.releas
 import org.apache.maven.shared.release.ReleaseResult;
 import org.codehaus.plexus.util.IOUtil;
 import org.codehaus.plexus.util.StringUtils;
-import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -103,7 +103,7 @@ public class DefaultDistributedReleaseMa
         {
             if ( distributedBuildManager.isAgentAvailable( buildAgentUrl ) )
             {
-                SlaveBuildAgentTransportClient client = new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
+                SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
                 return client.getReleasePluginParameters( projectId, pomFilename );
             }
 
@@ -140,7 +140,7 @@ public class DefaultDistributedReleaseMa
         {
             if ( distributedBuildManager.isAgentAvailable( buildAgentUrl ) )
             {
-                SlaveBuildAgentTransportClient client = new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
+                SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
                 return client.processProject( projectId, pomFilename, autoVersionSubmodules );
             }
 
@@ -176,7 +176,7 @@ public class DefaultDistributedReleaseMa
         {
             if ( distributedBuildManager.isAgentAvailable( buildAgentUrl ) )
             {
-                SlaveBuildAgentTransportClient client = new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
+                SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
     
                 String releaseId =
                     client.releasePrepare( createProjectMap( project ), releaseProperties,
@@ -220,7 +220,7 @@ public class DefaultDistributedReleaseMa
         {
             if ( distributedBuildManager.isAgentAvailable( buildAgentUrl ) )
             {
-                SlaveBuildAgentTransportClient client = new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
+                SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
                 Map<String, Object> result = client.getReleaseResult( releaseId );
     
                 ReleaseResult releaseResult = new ReleaseResult();
@@ -264,7 +264,7 @@ public class DefaultDistributedReleaseMa
         {
             if ( distributedBuildManager.isAgentAvailable( buildAgentUrl ) )
             {
-                SlaveBuildAgentTransportClient client = new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
+                SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
                 return client.getListener( releaseId );
             }
 
@@ -300,7 +300,7 @@ public class DefaultDistributedReleaseMa
         {
             if ( distributedBuildManager.isAgentAvailable( buildAgentUrl ) )
             {
-                SlaveBuildAgentTransportClient client = new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
+                SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
                 client.removeListener( releaseId );
             }
 
@@ -337,7 +337,7 @@ public class DefaultDistributedReleaseMa
         {
             if ( distributedBuildManager.isAgentAvailable( buildAgentUrl ) )
             {
-                SlaveBuildAgentTransportClient client = new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
+                SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
                 return client.getPreparedReleaseName( releaseId );
             }
 
@@ -404,7 +404,7 @@ public class DefaultDistributedReleaseMa
         {
             if ( distributedBuildManager.isAgentAvailable( buildAgentUrl ) )
             {
-                SlaveBuildAgentTransportClient client = new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
+                SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
                 client.releasePerform( releaseId, goals, arguments, useReleaseProfile, map, username );
     
                 addReleaseInProgress( releaseId, "perform", projectId, username );
@@ -464,7 +464,7 @@ public class DefaultDistributedReleaseMa
         {
             if ( distributedBuildManager.isAgentAvailable( buildAgentUrl ) )
             {
-                SlaveBuildAgentTransportClient client = new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
+                SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
                 String releaseId =
                     client.releasePerformFromScm( goals, arguments, useReleaseProfile, map, scmUrl, scmUsername,
                                                   scmPassword, scmTag, scmTagBase, environments, username );
@@ -506,7 +506,7 @@ public class DefaultDistributedReleaseMa
         {
             if ( distributedBuildManager.isAgentAvailable( buildAgentUrl ) )
             {
-                SlaveBuildAgentTransportClient client = new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
+                SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
                 client.releaseRollback( releaseId, projectId );
             }
 
@@ -542,7 +542,7 @@ public class DefaultDistributedReleaseMa
         {
             if ( distributedBuildManager.isAgentAvailable( buildAgentUrl ) )
             {
-                SlaveBuildAgentTransportClient client = new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
+                SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
                 String result = client.releaseCleanup( releaseId );
     
                 removeFromReleaseInProgress( releaseId );
@@ -592,8 +592,7 @@ public class DefaultDistributedReleaseMa
                     {
                         if ( distributedBuildManager.isAgentAvailable( buildAgentUrl ) )
                         {
-                            SlaveBuildAgentTransportClient client =
-                                new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ) );
+                            SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
                             Map map = client.getListener( releaseId );
     
                             if ( map != null && !map.isEmpty() )
@@ -661,6 +660,12 @@ public class DefaultDistributedReleaseMa
         return null;
     }
 
+    public SlaveBuildAgentTransportService createSlaveBuildAgentTransportClientConnection( String buildAgentUrl ) 
+        throws MalformedURLException, Exception
+    {
+        return new SlaveBuildAgentTransportClient( new URL( buildAgentUrl ), "", configurationService.getSharedSecretPassword() );
+    }
+
     private Map createProjectMap( Project project )
     {
         Map<String, Object> map = new HashMap<String, Object>();

Modified: continuum/trunk/continuum-core/src/test/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManagerTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/test/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManagerTest.java?rev=1134319&r1=1134318&r2=1134319&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/test/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManagerTest.java (original)
+++ continuum/trunk/continuum-core/src/test/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManagerTest.java Fri Jun 10 13:27:04 2011
@@ -328,6 +328,9 @@ public class DefaultDistributedBuildMana
                 exactly( 2 ).of( configurationService ).getBuildAgents();
                 will( returnValue( buildAgents ) );
 
+                one( configurationService ).getSharedSecretPassword();
+                will( returnValue( null ) );
+
                 one( configurationService ).updateBuildAgent( buildAgent1 );
                 one( configurationService ).store();
 
@@ -397,6 +400,9 @@ public class DefaultDistributedBuildMana
                 one( configurationService ).getBuildAgents();
                 will( returnValue( buildAgents ) );
 
+                one( configurationService ).getSharedSecretPassword();
+                will( returnValue( null ) );
+
                 one( configurationService ).updateBuildAgent( buildAgent1 );
                 one( configurationService ).store();
             }
@@ -412,6 +418,9 @@ public class DefaultDistributedBuildMana
                 exactly( 5 ).of( configurationService ).getBuildAgents();
                 will( returnValue( buildAgents ) );
 
+                one( configurationService ).getSharedSecretPassword();
+                will( returnValue( null ) );
+                
                 one( configurationService ).updateBuildAgent( buildAgent1 );
                 one( configurationService ).store();
 
@@ -443,6 +452,9 @@ public class DefaultDistributedBuildMana
                 exactly( 6 ).of( configurationService ).getBuildAgents();
                 will( returnValue( buildAgents ) );
 
+                exactly( 2 ).of( configurationService ).getSharedSecretPassword();
+                will( returnValue( null ) );
+
                 one( configurationService ).updateBuildAgent( buildAgent1 );
                 one( configurationService ).updateBuildAgent( buildAgent2 );
                 exactly( 2 ).of( configurationService ).store();

Modified: continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-server/pom.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-server/pom.xml?rev=1134319&r1=1134318&r2=1134319&view=diff
==============================================================================
--- continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-server/pom.xml (original)
+++ continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-server/pom.xml Fri Jun 10 13:27:04 2011
@@ -40,5 +40,15 @@ under the License.
       <groupId>org.slf4j</groupId>
       <artifactId>slf4j-api</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.apache.xmlrpc</groupId>
+      <artifactId>xmlrpc-server</artifactId>
+      <exclusions>
+        <exclusion>
+          <groupId>commons-logging</groupId>
+          <artifactId>commons-logging</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
   </dependencies>
 </project>

Added: continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-server/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportAuthenticator.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-server/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportAuthenticator.java?rev=1134319&view=auto
==============================================================================
--- continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-server/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportAuthenticator.java (added)
+++ continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-server/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportAuthenticator.java Fri Jun 10 13:27:04 2011
@@ -0,0 +1,59 @@
+package org.apache.continuum.distributed.transport.slave;
+
+/*
+ * 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.
+ */
+
+import org.apache.continuum.buildagent.configuration.BuildAgentConfigurationService;
+import org.apache.xmlrpc.XmlRpcException;
+import org.apache.xmlrpc.XmlRpcRequest;
+import org.apache.xmlrpc.common.XmlRpcHttpRequestConfigImpl;
+import org.apache.xmlrpc.server.AbstractReflectiveHandlerMapping.AuthenticationHandler;
+import org.codehaus.plexus.util.StringUtils;
+
+public class SlaveBuildAgentTransportAuthenticator
+    implements AuthenticationHandler
+{
+    private BuildAgentConfigurationService buildAgentConfigurationService;
+
+    public SlaveBuildAgentTransportAuthenticator( BuildAgentConfigurationService buildAgentConfigurationService )
+    {
+        this.buildAgentConfigurationService = buildAgentConfigurationService;
+    }
+
+    public boolean isAuthorized( XmlRpcRequest pRequest )
+        throws XmlRpcException
+    {
+        if ( pRequest.getConfig() instanceof XmlRpcHttpRequestConfigImpl )
+        {
+            XmlRpcHttpRequestConfigImpl config = (XmlRpcHttpRequestConfigImpl) pRequest.getConfig();
+
+            if ( StringUtils.isBlank( config.getBasicPassword() ) || 
+                            StringUtils.isBlank( buildAgentConfigurationService.getSharedSecretPassword() ) )
+            {
+                throw new XmlRpcException( "Shared Secret Password is not configured properly" );
+            }
+
+            return buildAgentConfigurationService.getSharedSecretPassword().equals( config.getBasicPassword() );
+        }
+
+        throw new XmlRpcException( "Unsupported transport (must be http)" );
+    }
+
+
+}

Propchange: continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-server/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportAuthenticator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-server/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportAuthenticator.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/configuration/ConfigurationServiceMock.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/configuration/ConfigurationServiceMock.java?rev=1134319&r1=1134318&r2=1134319&view=diff
==============================================================================
--- continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/configuration/ConfigurationServiceMock.java (original)
+++ continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/configuration/ConfigurationServiceMock.java Fri Jun 10 13:27:04 2011
@@ -178,6 +178,15 @@ public class ConfigurationServiceMock
         return null;
     }
 
+    public String getSharedSecretPassword()
+    {
+        return null;
+    }
+
+    public void setSharedSecretPassword( String sharedSecretPassword )
+    {        
+    }
+
     public boolean isLoaded()
     {
         return false;

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigurationAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigurationAction.java?rev=1134319&r1=1134318&r2=1134319&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigurationAction.java (original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigurationAction.java Fri Jun 10 13:27:04 2011
@@ -67,6 +67,8 @@ public class ConfigurationAction
 
     private boolean distributedBuildEnabled;
 
+    private String sharedSecretPassword;
+
     public void prepare()
     {
         ConfigurationService configuration = getContinuum().getConfiguration();
@@ -116,6 +118,8 @@ public class ConfigurationAction
         setRequireReleaseOutput( Boolean.valueOf( requireRelease ) );
 
         distributedBuildEnabled = configuration.isDistributedBuildEnabled();
+
+        sharedSecretPassword = configuration.getSharedSecretPassword();
     }
 
     public String input()
@@ -179,6 +183,8 @@ public class ConfigurationAction
 
         configuration.setDistributedBuildEnabled( distributedBuildEnabled );
 
+        configuration.setSharedSecretPassword( sharedSecretPassword );
+
         configuration.store();
 
         return SUCCESS;
@@ -273,4 +279,14 @@ public class ConfigurationAction
     {
         this.distributedBuildEnabled = distributedBuildEnabled;
     }
+
+    public void setSharedSecretPassword( String sharedSecretPassword )
+    {
+        this.sharedSecretPassword = sharedSecretPassword;
+    }
+
+    public String getSharedSecretPassword()
+    {
+        return sharedSecretPassword;
+    }
 }

Modified: continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties?rev=1134319&r1=1134318&r2=1134319&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties (original)
+++ continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties Fri Jun 10 13:27:04 2011
@@ -279,6 +279,8 @@ configuration.releaseOutputDirectory.mes
 configuration.releaseOutputDirectory.required = You must define a release output directory
 configuration.numberOfBuildsInParallel.invalid = Number of Allowed Builds in Parallel must be greater than zero
 configuration.distributedBuildEnabled.label = Enable Distributed Builds
+configuration.sharedSecretPassword.label = Shared Secret Password
+configuration.sharedSecretPassword.message = Enter the shared secret password between master and agents when distributed build is enabled
 
 # ----------------------------------------------------------------------
 # Page: Add Project

Modified: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/configurationEdit.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/configurationEdit.jsp?rev=1134319&r1=1134318&r2=1134319&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/configurationEdit.jsp (original)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/configurationEdit.jsp Fri Jun 10 13:27:04 2011
@@ -26,6 +26,21 @@
     <title>
       <s:text name="configuration.page.title"/>
     </title>
+    <script language="javascript">
+      function setSecretPassword()
+      {
+        var form = document.forms[ "editConfiguration" ];
+
+        if ( form.distributedBuildEnabled.checked == true )
+        {
+          form.sharedSecretPassword.disabled = false;
+        }
+        else
+        {
+          form.sharedSecretPassword.disabled = true;
+        }
+      }
+    </script>
   </head>
 
   <body>
@@ -34,7 +49,7 @@
       <s:text name="configuration.section.title"/>
     </h3>
 
-    <s:form action="configuration!save" method="post">
+    <s:form name="editConfiguration" action="configuration!save" method="post">
 
       <c:if test="${!empty actionErrors}">
         <div class="errormessage">
@@ -93,7 +108,15 @@
             <s:checkbox label="%{getText('configuration.disable.parallel.builds')}" name="requireParallelBuilds" required="true"/>
             --%>
 
-            <s:checkbox label="%{getText('configuration.distributedBuildEnabled.label')}" name="distributedBuildEnabled"/>
+            <s:checkbox label="%{getText('configuration.distributedBuildEnabled.label')}" name="distributedBuildEnabled" onclick="setSecretPassword();"/>
+
+            <s:password label="%{getText('configuration.sharedSecretPassword.label')}" name="sharedSecretPassword" disabled="%{!distributedBuildEnabled}" showPassword="true">
+              <s:param name="desc">
+                <p>
+                  <s:text name="configuration.sharedSecretPassword.message"/>
+                </p>
+              </s:param>
+            </s:password>
 
             <s:hidden name="requireReleaseOutput"/>
           </tbody>

Modified: continuum/trunk/pom.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/pom.xml?rev=1134319&r1=1134318&r2=1134319&view=diff
==============================================================================
--- continuum/trunk/pom.xml (original)
+++ continuum/trunk/pom.xml Fri Jun 10 13:27:04 2011
@@ -1721,6 +1721,6 @@ under the License.
     <archiva.version>1.2.1</archiva.version>
     <slf4jVersion>1.5.8</slf4jVersion>
     <xmlrpc.version>3.1</xmlrpc.version>
-    <atlassian.xmlrpc.binder.version>0.8.2</atlassian.xmlrpc.binder.version>
+    <atlassian.xmlrpc.binder.version>0.9</atlassian.xmlrpc.binder.version>
   </properties>
 </project>



Mime
View raw message