You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2018/01/16 10:56:04 UTC

[sling-whiteboard] branch master updated (622ff8c -> 68a0d97)

This is an automated email from the ASF dual-hosted git repository.

rombert pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/sling-whiteboard.git.


    from 622ff8c  SLING-7255 - Donating Sling Resource Encryption Utils
     new 8e84d13  SLING-6585 - Switch to the ASF code signing service
     new 9fc871e  SLING-6585 - Switch to the ASF code signing service
     new f990281  SLING-6585 - Switch to the ASF code signing service
     new 68a0d97  SLING-6585 - Switch to the ASF code signing service

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/tomcat/buildutil/SignCodeMojo.java  | 68 +++++++++++++++++-----
 1 file changed, 52 insertions(+), 16 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
['"commits@sling.apache.org" <co...@sling.apache.org>'].

[sling-whiteboard] 01/04: SLING-6585 - Switch to the ASF code signing service

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-whiteboard.git

commit 8e84d13c62b19b0b2f9bfff9eac33c4b00b2e103
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Fri Jan 12 18:19:58 2018 +0200

    SLING-6585 - Switch to the ASF code signing service
    
    Adjust code signing service names
---
 codesign/src/main/java/org/apache/tomcat/buildutil/SignCodeMojo.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/codesign/src/main/java/org/apache/tomcat/buildutil/SignCodeMojo.java b/codesign/src/main/java/org/apache/tomcat/buildutil/SignCodeMojo.java
index 79dfcfd..950dbd0 100644
--- a/codesign/src/main/java/org/apache/tomcat/buildutil/SignCodeMojo.java
+++ b/codesign/src/main/java/org/apache/tomcat/buildutil/SignCodeMojo.java
@@ -130,7 +130,7 @@ public class SignCodeMojo extends AbstractMojo {
     private boolean includeProjectArtifact;
     
     /**
-     * Use <tt>Java TEST signing Sha256</tt> for testing and <tt>Java signing Sha256</tt> for prod 
+     * Use <tt>Java TEST Signing Sha256</tt> for testing and <tt>Java Signing Sha256</tt> for prod 
      */
     @Parameter(required = true)
     private String signingService;

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-whiteboard] 04/04: SLING-6585 - Switch to the ASF code signing service

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-whiteboard.git

commit 68a0d979461d70cbc5d003d88c9dca19065b95e0
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Mon Jan 15 18:45:11 2018 +0200

    SLING-6585 - Switch to the ASF code signing service
    
    Fix a NPE when the codesign.sslDebug property is enabled.
---
 .../src/main/java/org/apache/tomcat/buildutil/SignCodeMojo.java     | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/codesign/src/main/java/org/apache/tomcat/buildutil/SignCodeMojo.java b/codesign/src/main/java/org/apache/tomcat/buildutil/SignCodeMojo.java
index b3ff3d0..4bbd62f 100644
--- a/codesign/src/main/java/org/apache/tomcat/buildutil/SignCodeMojo.java
+++ b/codesign/src/main/java/org/apache/tomcat/buildutil/SignCodeMojo.java
@@ -206,7 +206,11 @@ public class SignCodeMojo extends AbstractMojo {
             throw new MojoExecutionException("Signing failed : " + e.getMessage(), e);
         } finally {
             if ( sslDebug ) {
-                System.setProperty("javax.net.debug", oldSslDebug);
+                if ( oldSslDebug != null ) {
+                    System.setProperty("javax.net.debug", oldSslDebug);
+                } else {
+                    System.clearProperty("javax.net.debug");
+                }
             }
         }
     }

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-whiteboard] 03/04: SLING-6585 - Switch to the ASF code signing service

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-whiteboard.git

commit f990281d8e9772e3e206525404c50bb2e586b147
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Mon Jan 15 18:45:11 2018 +0200

    SLING-6585 - Switch to the ASF code signing service
    
    Update documentation and perform minor code cleanups
---
 .../org/apache/tomcat/buildutil/SignCodeMojo.java  | 50 ++++++++++++++++++----
 1 file changed, 41 insertions(+), 9 deletions(-)

diff --git a/codesign/src/main/java/org/apache/tomcat/buildutil/SignCodeMojo.java b/codesign/src/main/java/org/apache/tomcat/buildutil/SignCodeMojo.java
index 221f18b..b3ff3d0 100644
--- a/codesign/src/main/java/org/apache/tomcat/buildutil/SignCodeMojo.java
+++ b/codesign/src/main/java/org/apache/tomcat/buildutil/SignCodeMojo.java
@@ -57,6 +57,26 @@ import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
 // file copied and adapted from http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/buildutil/SignCode.java?revision=1789744&view=co
+/**
+ * The <tt>SignMojo</tt> executs a signing operation against the Symantec Secure App Service
+ * 
+ * <p>It uses the SOAP API to send the artifacts for signing and download them.</p>
+ * 
+ * <p>The recommended usage of the plugin is to define the sensitive parameters in a profile
+ * in the <tt>settings.xml</tt> file:
+ * 
+ * <ol>
+ *   <li>codesign.userName</li>
+ *   <li>codesign.password</li>
+ *   <li>codesign.partnerCode</li>
+ *   <li>codesign.keyStore</li>
+ *   <li>codesign.keyStorePassword</li>
+ * </ol>
+ * </p>
+ * 
+ * <p>Following that, the plugin configuration can be done in the pom.xml file for non-sensitive parameters.</p>
+ * 
+ */
 @Mojo(
         name = "sign",
         defaultPhase = LifecyclePhase.PACKAGE,
@@ -114,21 +134,27 @@ public class SignCodeMojo extends AbstractMojo {
     @Parameter(defaultValue = "${project.version}")
     private String applicationVersion;
 
-    @Parameter(required = true, defaultValue="${codesign.keyStorePassword}")
-    private String keyStorePassword;
-    
     @Parameter(required = true, defaultValue="${codesign.keyStore}")
     private String keyStore;
     
+    @Parameter(required = true, defaultValue="${codesign.keyStorePassword}")
+    private String keyStorePassword;
+    
+    /**
+     * Allows definition of additional artifacts to sign
+     */
     @Parameter
     private FileSet[] artifactSets;
+
+    /**
+     * When set to true the project's primary artifact will be added to the list of files to sign
+     */
+    @Parameter
+    private boolean includeProjectArtifact;
     
     @Parameter(property="codesign.sslDebug")
     private boolean sslDebug;
     
-    @Parameter
-    private boolean includeProjectArtifact;
-    
     /**
      * Use <tt>Java TEST Signing Sha256</tt> for testing and <tt>Java Signing Sha256</tt> for prod 
      */
@@ -139,7 +165,6 @@ public class SignCodeMojo extends AbstractMojo {
     @Override
     public void execute() throws MojoExecutionException {
     	
-    	// TODO - do we want configurable files to sign?
     	List<File> filesToSign = new ArrayList<>();
     	
     	if ( includeProjectArtifact )
@@ -158,8 +183,10 @@ public class SignCodeMojo extends AbstractMojo {
     		}
     	}
     	
-    	if ( filesToSign.isEmpty() ) 
+    	if ( filesToSign.isEmpty() ) { 
     		getLog().info("No files to sign, skipping");
+    		return;
+    	}
     	
     	for ( File toSign : filesToSign )
     		getLog().info("Would sign " + toSign);
@@ -167,8 +194,9 @@ public class SignCodeMojo extends AbstractMojo {
         // Set up the TLS client
         System.setProperty("javax.net.ssl.keyStore", keyStore);
         System.setProperty("javax.net.ssl.keyStorePassword", keyStorePassword);
+        String oldSslDebug = null;
     	if ( sslDebug ) {
-    	    System.setProperty("javax.net.debug","all");
+    	    oldSslDebug = System.setProperty("javax.net.debug","all");
     	}
     	
         try {
@@ -176,6 +204,10 @@ public class SignCodeMojo extends AbstractMojo {
             downloadSignedFiles(filesToSign, signingSetID);
         } catch (SOAPException | IOException e) {
             throw new MojoExecutionException("Signing failed : " + e.getMessage(), e);
+        } finally {
+            if ( sslDebug ) {
+                System.setProperty("javax.net.debug", oldSslDebug);
+            }
         }
     }
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-whiteboard] 02/04: SLING-6585 - Switch to the ASF code signing service

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-whiteboard.git

commit 9fc871e4db0ef518aae090f24702d42df42d5109
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Mon Jan 15 16:40:47 2018 +0200

    SLING-6585 - Switch to the ASF code signing service
    
    Allow mojo parameters to be overridden by settings or CLI args.
    Also fix minor typo.
---
 .../java/org/apache/tomcat/buildutil/SignCodeMojo.java     | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/codesign/src/main/java/org/apache/tomcat/buildutil/SignCodeMojo.java b/codesign/src/main/java/org/apache/tomcat/buildutil/SignCodeMojo.java
index 950dbd0..221f18b 100644
--- a/codesign/src/main/java/org/apache/tomcat/buildutil/SignCodeMojo.java
+++ b/codesign/src/main/java/org/apache/tomcat/buildutil/SignCodeMojo.java
@@ -93,19 +93,19 @@ public class SignCodeMojo extends AbstractMojo {
     /**
      * The username of the API user
      */
-    @Parameter(required = true)
+    @Parameter(required = true, defaultValue="${codesign.userName}")
     private String userName;
     
     /**
      * The password of the API user
      */
-    @Parameter(required = true)
+    @Parameter(required = true, defaultValue="${codesign.password}")
     private String password;
     
     /**
      * The partner code, initially sent via an email to you titled 'Your Secure App Service API username'
      */
-    @Parameter(required = true)
+    @Parameter(required = true, defaultValue="${codesign.partnerCode}")
     private String partnerCode;
     
     @Parameter(defaultValue = "${project.name}")
@@ -114,10 +114,10 @@ public class SignCodeMojo extends AbstractMojo {
     @Parameter(defaultValue = "${project.version}")
     private String applicationVersion;
 
-    @Parameter(required = true)
+    @Parameter(required = true, defaultValue="${codesign.keyStorePassword}")
     private String keyStorePassword;
     
-    @Parameter(required = true)
+    @Parameter(required = true, defaultValue="${codesign.keyStore}")
     private String keyStore;
     
     @Parameter
@@ -132,7 +132,7 @@ public class SignCodeMojo extends AbstractMojo {
     /**
      * Use <tt>Java TEST Signing Sha256</tt> for testing and <tt>Java Signing Sha256</tt> for prod 
      */
-    @Parameter(required = true)
+    @Parameter(required = true, defaultValue="${codesign.signingService}")
     private String signingService;
 
 
@@ -218,7 +218,7 @@ public class SignCodeMojo extends AbstractMojo {
         SOAPConnectionFactory soapConnectionFactory = SOAPConnectionFactory.newInstance();
         SOAPConnection connection = soapConnectionFactory.createConnection();
 
-        log("Sending singing request to server and waiting for response");
+        log("Sending signing request to server and waiting for response");
         SOAPMessage response = connection.call(message, SIGNING_SERVICE_URL);
 
         if ( getLog().isDebugEnabled()) {

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.