Update to new Oparent 97/67697/1
authorInstrumental <jonathan.gathman@att.com>
Wed, 19 Sep 2018 11:59:20 +0000 (06:59 -0500)
committerInstrumental <jonathan.gathman@att.com>
Wed, 19 Sep 2018 11:59:31 +0000 (06:59 -0500)
Issue-ID: AAF-509
Change-Id: Ic9235812d4a396fdc86a4938b626805c22773c00
Signed-off-by: Instrumental <jonathan.gathman@att.com>
auth/auth-batch/pom.xml
auth/auth-batch/src/main/java/org/onap/aaf/auth/javax/JavaxMailer.java [deleted file]
auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/ca/LocalCA.java
auth/pom.xml
cadi/servlet-sample/pom.xml
pom.xml

index 1c49d6f..a30ccaa 100644 (file)
                        <groupId>org.onap.aaf.authz</groupId>
                        <artifactId>aaf-auth-cass</artifactId>
                </dependency>
-               
-               <dependency>
-                       <groupId>javax.mail</groupId>
-                       <artifactId>mail</artifactId>
-               </dependency>
 
                <dependency>
                        <groupId>org.slf4j</groupId>
diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/javax/JavaxMailer.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/javax/JavaxMailer.java
deleted file mode 100644 (file)
index f4a0f37..0000000
+++ /dev/null
@@ -1,160 +0,0 @@
-/**
- * ============LICENSE_START====================================================
- * org.onap.aaf
- * ===========================================================================
- * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
- * ===========================================================================
- * Licensed 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.
- * ============LICENSE_END====================================================
- *
- */
-package org.onap.aaf.auth.javax;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.mail.Address;
-import javax.mail.Message;
-import javax.mail.MessagingException;
-import javax.mail.Session;
-import javax.mail.Transport;
-import javax.mail.internet.InternetAddress;
-import javax.mail.internet.MimeMessage;
-
-import org.onap.aaf.auth.env.AuthzTrans;
-import org.onap.aaf.auth.org.Mailer;
-import org.onap.aaf.auth.org.OrganizationException;
-
-public class JavaxMailer implements Mailer {
-    private Session session;
-
-      public JavaxMailer() {
-          
-            // Get the default Session object.
-            session = Session.getDefaultInstance(System.getProperties());
-    
-      }
-      
-      @Override
-        public int sendEmail(AuthzTrans trans, boolean testMode, String mailFrom, List<String> to, List<String> cc, String subject, String body,
-                Boolean urgent) throws OrganizationException {
-
-            int status = 1;
-
-
-            try {
-                // Create a default MimeMessage object.
-                MimeMessage message = new MimeMessage(session);
-
-                // Set From: header field of the header.
-                message.setFrom(new InternetAddress(mailFrom));
-
-                if (!testMode) {
-                    // Set To: header field of the header. This is a required field
-                    // and calling module should make sure that it is not null or
-                    // blank
-                    message.addRecipients(Message.RecipientType.TO,getAddresses(to));
-
-                    // Set CC: header field of the header.
-                    if ((cc != null) && (cc.size() > 0)) {
-                        message.addRecipients(Message.RecipientType.CC,getAddresses(cc));
-                    }
-
-                    // Set Subject: header field
-                    message.setSubject(subject);
-
-                    if (urgent) {
-                        message.addHeader("X-Priority", "1");
-                    }
-
-                    // Now set the actual message
-                    message.setText(body);
-                } else {
-
-                    // override recipients
-                    message.addRecipients(Message.RecipientType.TO,
-                            InternetAddress.parse(mailFrom));
-
-                    // Set Subject: header field
-                    message.setSubject("[TESTMODE] " + subject);
-
-                    if (urgent) {
-                        message.addHeader("X-Priority", "1");
-                    }
-
-                    ArrayList<String> newBody = new ArrayList<>();
-
-                    Address temp[] = getAddresses(to);
-                    String headerString = "TO:\t" + InternetAddress.toString(temp) + "\n";
-
-                    temp = getAddresses(cc);
-                    headerString += "CC:\t" + InternetAddress.toString(temp) + "\n";
-
-                    newBody.add(headerString);
-
-                    newBody.add("Text: \n");
-
-                    newBody.add(body);
-                    String outString = "";
-                    for (String s : newBody) {
-                        outString += s + "\n";
-                    }
-
-                    message.setText(outString);
-                }
-                // Send message
-                Transport.send(message);
-                status = 0;
-
-            } catch (MessagingException mex) {
-                System.out.println("Error messaging: "+ mex.getMessage());
-                System.out.println("Error messaging: "+ mex.toString());
-                throw new OrganizationException("Exception send email message "
-                        + mex.getMessage());
-            }
-
-            return status;
-        }
-
-        /**
-         * Convert the delimiter String into Internet addresses with the default
-         * delimiter of ";"
-         * @param strAddress
-         * @return
-         */
-        private Address[] getAddresses(List<String> strAddress) throws OrganizationException {
-            return this.getAddresses(strAddress,";");
-        }
-        /**
-         * Convert the delimiter String into Internet addresses with the
-         * delimiter of provided
-         * @param strAddresses
-         * @param delimiter
-         * @return
-         */
-        private Address[] getAddresses(List<String> strAddresses, String delimiter) throws OrganizationException {
-            Address[] addressArray = new Address[strAddresses.size()];
-            int count = 0;
-            for (String addr : strAddresses)
-            {
-                try{
-                    addressArray[count] = new InternetAddress(addr);
-                    count++;
-                } catch (Exception e){
-                    throw new OrganizationException("Failed to parse the email address "+ addr +": "+e.getMessage());
-                }
-            }
-            return addressArray;
-        }
-
-}
index 2a3ce53..da63486 100644 (file)
@@ -82,7 +82,6 @@ public class LocalCA extends CA {
     
     private final PrivateKey caKey;
     private final X500Name issuer;
-    private final SecureRandom random = new SecureRandom();
     private BigInteger serial;
     private final X509ChainWithIssuer x509cwi; // "Cert" is CACert
     
@@ -90,7 +89,7 @@ public class LocalCA extends CA {
     public LocalCA(Access access, final String name, final String env, final String[][] params) throws IOException, CertException {
         super(access, name, env);
     
-        serial = new BigInteger(64,random);
+        serial = new BigInteger(64,new SecureRandom());
 
         if (params.length<1 || params[0].length<2) {
             throw new IOException("LocalCA expects cm_ca.<ca name>=org.onap.aaf.auth.cm.ca.LocalCA,<full path to key file>[;<Full Path to Trust Chain, ending with actual CA>]+");
index a6af750..5bdc022 100644 (file)
@@ -51,7 +51,6 @@
                <stagingNexusPath>/content/repositories/staging/</stagingNexusPath>
                <sitePath>/content/sites/site/org/onap/aaf/authz/${project.artifactId}/${project.version}</sitePath>
                <!-- We have to up these versions from the original to avoid Security Errors -->
-               <project.cassVersion>3.4.0</project.cassVersion>
                <project.nettyVersion>4.1.22.Final</project.nettyVersion>
                <project.project.ext_root_dir>/opt/app/osaaf</project.project.ext_root_dir>
        </properties>
index 0da47f2..34c3dc4 100644 (file)
@@ -21,7 +21,6 @@
                <dependency>
                        <groupId>org.onap.aaf.authz</groupId>
                        <artifactId>aaf-cadi-aaf</artifactId>
-                       <version>${project.version}</version>
                </dependency>
 
        </dependencies>
diff --git a/pom.xml b/pom.xml
index 985160e..51c6463 100644 (file)
--- a/pom.xml
+++ b/pom.xml
        <parent>
                <groupId>org.onap.oparent</groupId>
                <artifactId>oparent</artifactId>
-               <version>1.2.0</version>
+               <version>1.2.1-SNAPSHOT</version>
        </parent>
 
        <properties>
                <nexusproxy>https://nexus.onap.org</nexusproxy>
+               <onap.nexus.url>https://nexus.onap.org</onap.nexus.url>
                <snapshotNexusPath>/content/repositories/snapshots/</snapshotNexusPath>
                <releaseNexusPath>/content/repositories/releases/</releaseNexusPath>
                <stagingNexusPath>/content/repositories/staging/</stagingNexusPath>
@@ -49,7 +50,8 @@
                <powermock.version>1.5.1</powermock.version>
                <mockito.version>1.9.5</mockito.version>
                <project.interfaceVersion>${project.version}</project.interfaceVersion>
-               <project.jettyVersion>9.4.11.v20180605</project.jettyVersion>
+               <project.jettyVersion>9.4.12.v20180830</project.jettyVersion>
+               <project.cassVersion>3.6.0</project.cassVersion>
 
        </properties>
        <build>
                                <groupId>javax.servlet</groupId>
                                <artifactId>javax.servlet-api</artifactId>
                                <version>3.0.1</version>
-                       </dependency><dependency>
+                       </dependency>
+                       
+                       <!-- JettyVersion is partly covered in "OParent" 
+                         dependency>
                                <groupId>org.eclipse.jetty</groupId>
                                <artifactId>jetty-servlet</artifactId>
                                <version>${project.jettyVersion}</version>
                                <artifactId>jetty-server</artifactId>
                                <version>${project.jettyVersion}</version>
                        </dependency>
-
+                       
                        <dependency>
                                <groupId>org.eclipse.jetty</groupId>
-                               <artifactId>jetty-io</artifactId>
+                               <artifactId>jetty-http</artifactId>
                                <version>${project.jettyVersion}</version>
                        </dependency>
 
                        <dependency>
                                <groupId>org.eclipse.jetty</groupId>
-                               <artifactId>jetty-security</artifactId>
+                               <artifactId>jetty-io</artifactId>
                                <version>${project.jettyVersion}</version>
                        </dependency>
 
                        <dependency>
                                <groupId>org.eclipse.jetty</groupId>
-                               <artifactId>jetty-http</artifactId>
+                               <artifactId>jetty-security</artifactId>
                                <version>${project.jettyVersion}</version>
                        </dependency>
 
+
                        <dependency>
                                <groupId>org.eclipse.jetty</groupId>
                                <artifactId>jetty-util</artifactId>
                                <version>${project.jettyVersion}</version>
                        </dependency>
+                        -->
 
                        <dependency>
                                <groupId>org.slf4j</groupId>