Remove AAF from SO 01/140901/2
authorFiete Ostkamp <Fiete.Ostkamp@telekom.de>
Fri, 16 May 2025 14:22:09 +0000 (16:22 +0200)
committerFiete Ostkamp <Fiete.Ostkamp@telekom.de>
Fri, 16 May 2025 15:04:19 +0000 (17:04 +0200)
- remove all AAF dependendies
- remove the aaf spring profile
- rename auth-related properties
  - mso.config.cadi.aafId -> mso.auth.user
  - mso.auth              -> mso.auth.password

Issue-ID: SO-4155
Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de>
Change-Id: I8249970f7f7027638d1da631574893d252b3c90b

bpmn/mso-infrastructure-bpmn/pom.xml
common/pom.xml
common/src/main/java/org/onap/so/security/SecurityFilters.java [deleted file]
common/src/main/java/org/onap/so/security/SoCadiFilter.java [deleted file]
common/src/main/java/org/onap/so/security/SoNoAuthWebSecurityConfigurerAdapter.java
common/src/main/java/org/onap/so/utils/ExternalTaskServiceUtils.java
cxf-logging/pom.xml
deployment-configs/src/main/resources/logger/logback-spring.xml
mso-api-handlers/mso-api-handler-infra/pom.xml
pom.xml

index b0d5902..eb19876 100644 (file)
       <artifactId>assertj-core</artifactId>
       <scope>test</scope>
     </dependency>
-    <dependency>
-      <groupId>org.onap.aaf.authz</groupId>
-      <artifactId>aaf-cadi-aaf</artifactId>
-      <exclusions>
-        <exclusion>
-          <groupId>javax.servlet</groupId>
-          <artifactId>servlet-api</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>log4j</groupId>
-          <artifactId>log4j</artifactId>
-        </exclusion>
-      </exclusions>
-    </dependency>
     <dependency>
       <groupId>org.camunda.bpm.springboot</groupId>
       <artifactId>camunda-bpm-spring-boot-starter-test</artifactId>
       <scope>test</scope>
     </dependency>
-    <dependency>
-      <groupId>org.onap.aaf.authz</groupId>
-      <artifactId>aaf-misc-rosetta</artifactId>
-      <scope>runtime</scope>
-    </dependency>
   </dependencies>
 </project>
index a697ba6..240ea6d 100644 (file)
       <artifactId>junit-vintage-engine</artifactId>
       <scope>test</scope>
     </dependency>
-    <dependency>
-      <groupId>org.onap.aaf.authz</groupId>
-      <artifactId>aaf-cadi-client</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.onap.aaf.authz</groupId>
-      <artifactId>aaf-cadi-aaf</artifactId>
-      <exclusions>
-        <exclusion>
-          <groupId>javax.servlet</groupId>
-          <artifactId>servlet-api</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>log4j</groupId>
-          <artifactId>log4j</artifactId>
-        </exclusion>
-      </exclusions>
-    </dependency>
-    <dependency>
-      <groupId>org.onap.aaf.authz</groupId>
-      <artifactId>aaf-auth-client</artifactId>
-      <scope>runtime</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.onap.aaf.authz</groupId>
-      <artifactId>aaf-misc-env</artifactId>
-      <scope>runtime</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.onap.aaf.authz</groupId>
-      <artifactId>aaf-misc-rosetta</artifactId>
-      <scope>runtime</scope>
-    </dependency>
     <dependency>
       <groupId>org.reflections</groupId>
       <artifactId>reflections</artifactId>
diff --git a/common/src/main/java/org/onap/so/security/SecurityFilters.java b/common/src/main/java/org/onap/so/security/SecurityFilters.java
deleted file mode 100644 (file)
index 7ad0fd0..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 - 2019 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.so.security;
-
-import org.springframework.boot.web.servlet.FilterRegistrationBean;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Profile;
-import org.springframework.core.Ordered;
-
-@Configuration
-@Profile("!test & aaf")
-public class SecurityFilters {
-
-    @Bean
-    public FilterRegistrationBean<SoCadiFilter> loginRegistrationBean() {
-        FilterRegistrationBean<SoCadiFilter> filterRegistrationBean = new FilterRegistrationBean<>();
-        filterRegistrationBean.setFilter(new SoCadiFilter());
-        filterRegistrationBean.setName("cadiFilter");
-        filterRegistrationBean.setOrder(Ordered.HIGHEST_PRECEDENCE);
-        return filterRegistrationBean;
-    }
-}
diff --git a/common/src/main/java/org/onap/so/security/SoCadiFilter.java b/common/src/main/java/org/onap/so/security/SoCadiFilter.java
deleted file mode 100644 (file)
index 1660220..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP SO
- * ================================================================================
- * Copyright (C) 2017-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.so.security;
-
-import javax.annotation.Priority;
-import javax.servlet.FilterConfig;
-import javax.servlet.ServletException;
-import org.onap.aaf.cadi.config.Config;
-import org.onap.aaf.cadi.filter.CadiFilter;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.context.annotation.Profile;
-import org.springframework.stereotype.Component;
-
-@Component
-@Profile("!test & aaf")
-// Run right before default priority of 0 to block requests
-@Priority(-1)
-public class SoCadiFilter extends CadiFilter {
-
-    protected final Logger logger = LoggerFactory.getLogger(SoCadiFilter.class);
-
-    @Value("${mso.config.cadi.cadiLoglevel:#{null}}")
-    private String cadiLoglevel;
-
-    @Value("${mso.config.cadi.cadiKeyFile:#{null}}")
-    private String cadiKeyFile;
-
-    @Value("${mso.config.cadi.cadiTruststorePassword:#{null}}")
-    private String cadiTrustStorePassword;
-
-    @Value("${mso.config.cadi.cadiTrustStore:#{null}}")
-    private String cadiTrustStore;
-
-    @Value("${mso.config.cadi.cadiLatitude:#{null}}")
-    private String cadiLatitude;
-
-    @Value("${mso.config.cadi.cadiLongitude:#{null}}")
-    private String cadiLongitude;
-
-    @Value("${mso.config.cadi.aafEnv:#{null}}")
-    private String aafEnv;
-
-    @Value("${mso.config.cadi.aafApiVersion:#{null}}")
-    private String aafApiVersion;
-
-    @Value("${mso.config.cadi.aafRootNs:#{null}}")
-    private String aafRootNs;
-
-    @Value("${mso.config.cadi.aafId:#{null}}")
-    private String aafMechId;
-
-    @Value("${mso.config.cadi.aafPassword:#{null}}")
-    private String aafMechIdPassword;
-
-    @Value("${mso.config.cadi.aafLocateUrl:#{null}}")
-    private String aafLocateUrl;
-
-    @Value("${mso.config.cadi.aafUrl:#{null}}")
-    private String aafUrl;
-
-    @Value("${mso.config.cadi.apiEnforcement:#{null}}")
-    private String apiEnforcement;
-
-    @Value("${mso.config.cadi.userExpires:#{null}}")
-    private String userExpires;
-
-    private void checkIfNullProperty(String key, String value) {
-        /*
-         * When value is null, it is not defined in application.yaml set nothing in System properties
-         */
-        if (value != null) {
-            System.setProperty(key, value);
-        }
-    }
-
-    @Override
-    public void init(FilterConfig filterConfig) throws ServletException {
-        checkIfNullProperty(Config.CADI_LOGLEVEL, cadiLoglevel);
-        checkIfNullProperty(Config.CADI_KEYFILE, cadiKeyFile);
-        checkIfNullProperty(Config.CADI_TRUSTSTORE, cadiTrustStore);
-        checkIfNullProperty(Config.CADI_TRUSTSTORE_PASSWORD, cadiTrustStorePassword);
-        checkIfNullProperty(Config.CADI_LATITUDE, cadiLatitude);
-        checkIfNullProperty(Config.CADI_LONGITUDE, cadiLongitude);
-        checkIfNullProperty(Config.AAF_ENV, aafEnv);
-        checkIfNullProperty(Config.AAF_API_VERSION, aafApiVersion);
-        checkIfNullProperty(Config.AAF_ROOT_NS, aafRootNs);
-        checkIfNullProperty(Config.AAF_APPID, aafMechId);
-        checkIfNullProperty(Config.AAF_APPPASS, aafMechIdPassword);
-        checkIfNullProperty(Config.AAF_LOCATE_URL, aafLocateUrl);
-        checkIfNullProperty(Config.AAF_URL, aafUrl);
-        checkIfNullProperty(Config.CADI_API_ENFORCEMENT, apiEnforcement);
-        checkIfNullProperty(Config.AAF_USER_EXPIRES, userExpires);
-        // checkIfNullProperty(AFT_ENVIRONMENT_VAR, aftEnv);
-        logger.debug(" *** init Filter Config *** ");
-        super.init(filterConfig);
-    }
-
-
-}
index 4a112b9..8218c66 100644 (file)
@@ -5,15 +5,15 @@
  * 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.
- * 
+ *
  * SPDX-License-Identifier: Apache-2.0
  * ============LICENSE_END=========================================================
  */
@@ -34,7 +34,7 @@ import org.springframework.security.web.firewall.StrictHttpFirewall;
 @EnableWebSecurity
 @Configuration
 @Order(2)
-@Profile({"aaf", "test", "serviceMesh"})
+@Profile({"test", "serviceMesh"})
 public class SoNoAuthWebSecurityConfigurerAdapter extends WebSecurityConfigurerAdapter {
     @Override
     public void configure(final WebSecurity web) throws Exception {
index 1a8307e..6c98547 100644 (file)
@@ -48,12 +48,13 @@ public class ExternalTaskServiceUtils {
     }
 
     protected ClientRequestInterceptor createClientInterceptor(String auth) {
-        return new BasicAuthProvider(env.getRequiredProperty("mso.config.cadi.aafId"), auth);
+        return new BasicAuthProvider(env.getRequiredProperty("mso.auth.user"), auth);
     }
 
     protected String getAuth() throws Exception {
         try {
-            return CryptoUtils.decrypt(env.getRequiredProperty("mso.auth"), env.getRequiredProperty("mso.msoKey"));
+            return CryptoUtils.decrypt(env.getRequiredProperty("mso.auth.password"),
+                    env.getRequiredProperty("mso.msoKey"));
         } catch (IllegalStateException | GeneralSecurityException e) {
             logger.error("Error Decrypting Password", e);
             throw new Exception("Cannot load password");
index 8a1af4a..1df8606 100644 (file)
@@ -34,7 +34,7 @@
       <groupId>org.slf4j</groupId>
       <artifactId>slf4j-api</artifactId>
     </dependency>
-        <dependency>
+    <dependency>
       <groupId>org.junit.vintage</groupId>
       <artifactId>junit-vintage-engine</artifactId>
       <scope>test</scope>
index bd9712a..a126930 100644 (file)
@@ -1,12 +1,12 @@
-<!-- ============LICENSE_START======================================================= 
-       ECOMP MSO ================================================================================ 
-       Copyright (C) 2017 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 
+<!-- ============LICENSE_START=======================================================
+       ECOMP MSO ================================================================================
+       Copyright (C) 2017 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========================================================= -->
 
 <configuration scan="false" debug="false">
@@ -23,7 +23,7 @@
        <property name="auditLogName" value="audit" />
        <property name="debugLogName" value="debug" />
        <property name="cadiLogName" value="cadi" />
-       
+
        <property name="currentTimeStamp" value="%d{&quot;yyyy-MM-dd'T'HH:mm:ss.SSSXXX&quot;,UTC}"/>
 
        <property name="errorPattern"
@@ -52,8 +52,8 @@
        <appender name="Audit"
                class="ch.qos.logback.core.rolling.RollingFileAppender">
                <filter class="ch.qos.logback.core.filter.EvaluatorFilter">
-                       <evaluator class="ch.qos.logback.classic.boolex.OnMarkerEvaluator">     
-                               <marker>ENTRY</marker>                  
+                       <evaluator class="ch.qos.logback.classic.boolex.OnMarkerEvaluator">
+                               <marker>ENTRY</marker>
                                <marker>EXIT</marker>
                        </evaluator>
                        <onMismatch>DENY</onMismatch>
@@ -81,8 +81,8 @@
        <appender name="Metric"
                class="ch.qos.logback.core.rolling.RollingFileAppender">
                <filter class="ch.qos.logback.core.filter.EvaluatorFilter">
-                       <evaluator class="ch.qos.logback.classic.boolex.OnMarkerEvaluator">     
-                               <marker>INVOKE</marker>                 
+                       <evaluator class="ch.qos.logback.classic.boolex.OnMarkerEvaluator">
+                               <marker>INVOKE</marker>
                                <marker>INVOKE-RETURN</marker>
                        </evaluator>
                        <onMismatch>DENY</onMismatch>
                        <pattern>${debugPattern}</pattern>
                </encoder>
        </appender>
-       
+
 
        <appender name="asyncDebug" class="ch.qos.logback.classic.AsyncAppender">
                <queueSize>256</queueSize>
                <appender-ref ref="Debug" />
                <includeCallerData>true</includeCallerData>
        </appender>
-       
+
        <appender name="Cadi"
                class="ch.qos.logback.core.rolling.RollingFileAppender">
                <file>${logs_dir:-.}/${cadiLogName}.log</file>
        <logger name="org.onap" level="${LOG_LEVEL:-DEBUG}" />
        <logger name="org.apache.cxf.interceptor" level="${LOG_LEVEL:-DEBUG}" />
        <logger name="com.woorea.openstack.connector" level="${LOG_LEVEL:-DEBUG}" />
-       
-       <!-- AAF Logs go here-->
-       <logger name="org.apache.catalina.core.ContainerBase" level="WARN" additivity="false">
-               <appender-ref ref="asyncCadi" />
-       </logger>
 
     <!-- Jersey Openstack Connector Logs Go Here for Openstack4J -->
     <logger name="os" level="${LOG_LEVEL:-DEBUG}" />
-    
+
        <logger name="org.reflections" level="ERROR" additivity="false" />
 
        <logger name="AUDIT" level="INFO" additivity="false">
index 5ce6e34..37bc619 100644 (file)
       <groupId>io.micrometer</groupId>
       <artifactId>micrometer-registry-prometheus</artifactId>
     </dependency>
-    <dependency>
-      <groupId>org.onap.aaf.authz</groupId>
-      <artifactId>aaf-cadi-aaf</artifactId>
-      <exclusions>
-        <exclusion>
-          <groupId>javax.servlet</groupId>
-          <artifactId>servlet-api</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>log4j</groupId>
-          <artifactId>log4j</artifactId>
-        </exclusion>
-      </exclusions>
-    </dependency>
-    <dependency>
-      <groupId>org.onap.aaf.authz</groupId>
-      <artifactId>aaf-auth-client</artifactId>
-      <scope>runtime</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.onap.aaf.authz</groupId>
-      <artifactId>aaf-misc-env</artifactId>
-      <scope>runtime</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.onap.aaf.authz</groupId>
-      <artifactId>aaf-misc-rosetta</artifactId>
-      <scope>runtime</scope>
-    </dependency>
   </dependencies>
   <build>
     <finalName>${project.artifactId}-${project.version}</finalName>
diff --git a/pom.xml b/pom.xml
index 32ee482..5b6642b 100644 (file)
--- a/pom.xml
+++ b/pom.xml
     <jax.ws.rs>2.1</jax.ws.rs>
     <springboot.version>2.3.7.RELEASE</springboot.version>
     <spring-cloud.version>Hoxton.SR8</spring-cloud.version>
-    <aaf.version>2.1.21</aaf.version>
     <format.skipValidate>false</format.skipValidate>
     <format.skipExecute>true</format.skipExecute>
     <io.fabric8.version>0.33.0</io.fabric8.version>
     <appc.client.version>1.7.2</appc.client.version>
     <bowman.client.version>0.9.0</bowman.client.version>
-    <aaf.cadi.version>2.1.15</aaf.cadi.version>
     <so-etsi-sol003-adapter-version>1.9.0-SNAPSHOT</so-etsi-sol003-adapter-version>
     <onap-logging-version>1.6.9</onap-logging-version>
     <jackson.version>2.14.2</jackson.version>
       <version>2.4</version>
       <scope>test</scope>
     </dependency>
-      <dependency>
-        <groupId>org.springframework.cloud</groupId>
-        <artifactId>spring-cloud-starter-sleuth</artifactId>
-      </dependency>
-      <dependency>
-        <groupId>org.springframework.cloud</groupId>
-        <artifactId>spring-cloud-sleuth-zipkin</artifactId>
+    <dependency>
+      <groupId>org.springframework.cloud</groupId>
+      <artifactId>spring-cloud-starter-sleuth</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework.cloud</groupId>
+      <artifactId>spring-cloud-sleuth-zipkin</artifactId>
     </dependency>
   </dependencies>
   <dependencyManagement>
           </exclusion>
         </exclusions>
       </dependency>
-      <dependency>
-        <groupId>org.onap.aaf.authz</groupId>
-        <artifactId>aaf-cadi-client</artifactId>
-        <version>${aaf.version}</version>
-      </dependency>
-      <dependency>
-        <groupId>org.onap.aaf.authz</groupId>
-        <artifactId>aaf-cadi-aaf</artifactId>
-        <version>${aaf.version}</version>
-        <exclusions>
-          <exclusion>
-            <groupId>javax.servlet</groupId>
-            <artifactId>servlet-api</artifactId>
-          </exclusion>
-          <exclusion>
-            <groupId>log4j</groupId>
-            <artifactId>log4j</artifactId>
-          </exclusion>
-        </exclusions>
-      </dependency>
-      <dependency>
-        <groupId>org.onap.aaf.authz</groupId>
-        <artifactId>aaf-auth-client</artifactId>
-        <version>${aaf.version}</version>
-        <scope>runtime</scope>
-      </dependency>
-      <dependency>
-        <groupId>org.onap.aaf.authz</groupId>
-        <artifactId>aaf-misc-env</artifactId>
-        <version>${aaf.version}</version>
-        <scope>runtime</scope>
-      </dependency>
-      <dependency>
-        <groupId>org.onap.aaf.authz</groupId>
-        <artifactId>aaf-misc-rosetta</artifactId>
-        <version>${aaf.version}</version>
-        <scope>runtime</scope>
-      </dependency>
       <dependency>
         <groupId>ch.vorburger.mariaDB4j</groupId>
         <artifactId>mariaDB4j</artifactId>