<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>
<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>
+++ /dev/null
-/*-
- * ============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;
- }
-}
+++ /dev/null
-/*-
- * ============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);
- }
-
-
-}
* 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=========================================================
*/
@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 {
}
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");
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
- <dependency>
+ <dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<scope>test</scope>
-<!-- ============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">
<property name="auditLogName" value="audit" />
<property name="debugLogName" value="debug" />
<property name="cadiLogName" value="cadi" />
-
+
<property name="currentTimeStamp" value="%d{"yyyy-MM-dd'T'HH:mm:ss.SSSXXX",UTC}"/>
<property name="errorPattern"
<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>
<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">
<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>
<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>