diff options
Diffstat (limited to 'vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/config')
3 files changed, 0 insertions, 147 deletions
diff --git a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/config/ApplicationConfig.java b/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/config/ApplicationConfig.java deleted file mode 100644 index a1abb05f07..0000000000 --- a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/config/ApplicationConfig.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.onap.svnfm.simulator.config; - -import java.util.Arrays; -import org.onap.svnfm.simulator.constants.Constant; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.ApplicationArguments; -import org.springframework.boot.ApplicationRunner; -import org.springframework.cache.Cache; -import org.springframework.cache.CacheManager; -import org.springframework.cache.concurrent.ConcurrentMapCache; -import org.springframework.cache.support.SimpleCacheManager; -import org.springframework.context.annotation.Bean; -import org.springframework.core.env.Environment; -import org.springframework.stereotype.Component; - -@Component -public class ApplicationConfig implements ApplicationRunner { - - private static final String PORT = "local.server.port"; - - @Value("${server.dns.name:so-vnfm-simulator.onap}") - private String serverDnsName; - - @Value("${server.request.grant.auth:oauth}") - private String grantAuth; - - @Autowired - private Environment environment; - - private String baseUrl; - - @Override - public void run(final ApplicationArguments args) throws Exception { - baseUrl = "https://" + serverDnsName + ":" + environment.getProperty(PORT); - } - - public String getBaseUrl() { - return baseUrl; - } - - public String getGrantAuth() { - return grantAuth; - } - - @Bean - public CacheManager cacheManager() { - final Cache inlineResponse201 = new ConcurrentMapCache(Constant.IN_LINE_RESPONSE_201_CACHE); - final SimpleCacheManager manager = new SimpleCacheManager(); - manager.setCaches(Arrays.asList(inlineResponse201)); - return manager; - } -} diff --git a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/config/SvnfmApplication.java b/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/config/SvnfmApplication.java deleted file mode 100644 index 723ae906e6..0000000000 --- a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/config/SvnfmApplication.java +++ /dev/null @@ -1,46 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2019 Nordix Foundation. - * ================================================================================ - * 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========================================================= - */ - -package org.onap.svnfm.simulator.config; - -import org.onap.svnfm.simulator.controller.SvnfmController; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.autoconfigure.domain.EntityScan; -import org.springframework.cache.annotation.EnableCaching; -import org.springframework.data.jpa.repository.config.EnableJpaRepositories; - -/** - * The spring boot application for the VNF LCM. - * <p> - * The VNFM receives requests through its REST API {@link SvnfmController} - * - * @author Lathishbabu Ganesan (lathishbabu.ganesan@est.tech) - * @author ronan.kenny@est.tech - */ -@SpringBootApplication(scanBasePackages = {"org.onap"}) -@EnableJpaRepositories("org.onap.svnfm.simulator") -@EntityScan("org.onap.svnfm.simulator.model") -@EnableCaching -public class SvnfmApplication { - public static void main(final String[] args) { - SpringApplication.run(SvnfmApplication.class, args); - } -} diff --git a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/config/WebSecurityConfigImpl.java b/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/config/WebSecurityConfigImpl.java deleted file mode 100644 index 18eadd2fc3..0000000000 --- a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/config/WebSecurityConfigImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2019 Nordix Foundation. - * ================================================================================ - * 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========================================================= - */ - -package org.onap.svnfm.simulator.config; - -import org.onap.so.security.MSOSpringFirewall; -import org.onap.so.security.WebSecurityConfig; -import org.springframework.security.config.annotation.web.builders.HttpSecurity; -import org.springframework.security.config.annotation.web.builders.WebSecurity; -import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; -import org.springframework.security.web.firewall.StrictHttpFirewall; - -/** - * Configure the web security for the application. - */ -@EnableWebSecurity -public class WebSecurityConfigImpl extends WebSecurityConfig { - - @Override - protected void configure(final HttpSecurity http) throws Exception { - http.csrf().disable().authorizeRequests().antMatchers("/**").permitAll(); - } - - @Override - public void configure(final WebSecurity web) throws Exception { - super.configure(web); - final StrictHttpFirewall firewall = new MSOSpringFirewall(); - web.httpFirewall(firewall); - } - -} |