From a456e7e4b70b56fe4fb0c0e82645d12402ce2f78 Mon Sep 17 00:00:00 2001 From: Brinda Santh Date: Fri, 30 Aug 2019 15:32:13 -0400 Subject: Remove controllerbluprints distribution. Change-Id: I8c7269f97f2b32a0fe8689baaeddfe1e82e0d075 Issue-ID: CCSDK-1663 Signed-off-by: Brinda Santh --- .../controllerblueprints/ApplicationConstants.java | 28 ---------- .../ControllerBlueprintsApplication.java | 42 --------------- .../cds/controllerblueprints/DatabaseConfig.java | 61 --------------------- .../ccsdk/cds/controllerblueprints/WebConfig.java | 50 ----------------- .../ApplicationSecurityConfigurerAdapter.java | 62 ---------------------- 5 files changed, 243 deletions(-) delete mode 100644 ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/cds/controllerblueprints/ApplicationConstants.java delete mode 100644 ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/cds/controllerblueprints/ControllerBlueprintsApplication.java delete mode 100644 ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/cds/controllerblueprints/DatabaseConfig.java delete mode 100644 ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/cds/controllerblueprints/WebConfig.java delete mode 100644 ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/cds/controllerblueprints/security/ApplicationSecurityConfigurerAdapter.java (limited to 'ms/controllerblueprints/application/src/main/java/org') diff --git a/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/cds/controllerblueprints/ApplicationConstants.java b/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/cds/controllerblueprints/ApplicationConstants.java deleted file mode 100644 index 9a9fafffc..000000000 --- a/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/cds/controllerblueprints/ApplicationConstants.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright © 2017-2018 AT&T Intellectual Property. - * - * 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. - */ - -package org.onap.ccsdk.cds.controllerblueprints; - -/** - * ApplicationConstants.java Purpose: Provide ControllerBlueprintsApplication Constant Information - * - * @author Brinda Santh - * @version 1.0 - */ -@SuppressWarnings("unused") -public final class ApplicationConstants { - -} diff --git a/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/cds/controllerblueprints/ControllerBlueprintsApplication.java b/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/cds/controllerblueprints/ControllerBlueprintsApplication.java deleted file mode 100644 index df979c6b3..000000000 --- a/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/cds/controllerblueprints/ControllerBlueprintsApplication.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright © 2017-2018 AT&T Intellectual Property. - * - * 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. - */ - -package org.onap.ccsdk.cds.controllerblueprints; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.web.reactive.config.EnableWebFlux; - -/** - * @author Brinda Santh - */ -@SpringBootApplication -@EnableWebFlux -@ComponentScan(basePackages = {"org.onap.ccsdk.cds.controllerblueprints"}) -@EnableAutoConfiguration -public class ControllerBlueprintsApplication { - private static Logger log = LoggerFactory.getLogger(ControllerBlueprintsApplication.class); - - public static void main(String[] args) { - log.info("****** Starting Controlled Blueprints Application ******"); - SpringApplication.run(ControllerBlueprintsApplication.class, args); - } - -} \ No newline at end of file diff --git a/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/cds/controllerblueprints/DatabaseConfig.java b/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/cds/controllerblueprints/DatabaseConfig.java deleted file mode 100644 index 8ec4bd4a3..000000000 --- a/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/cds/controllerblueprints/DatabaseConfig.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright © 2017-2018 AT&T Intellectual Property. - * - * 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. - */ - -package org.onap.ccsdk.cds.controllerblueprints; - -import org.springframework.boot.autoconfigure.domain.EntityScan; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.data.jpa.repository.config.EnableJpaAuditing; -import org.springframework.data.jpa.repository.config.EnableJpaRepositories; -import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; -import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter; -import org.springframework.transaction.annotation.EnableTransactionManagement; - -import javax.sql.DataSource; - -/** - * DatabaseConfig.java Purpose: Provide Configuration Generator DatabaseConfig Information - * - * @author Brinda Santh - * @version 1.0 - */ -@Configuration -@EntityScan("org.onap.ccsdk.cds.controllerblueprints.service.domain") -@EnableTransactionManagement -@EnableJpaRepositories("org.onap.ccsdk.cds.controllerblueprints.service.repository") -@EnableJpaAuditing -public class DatabaseConfig { - /** - * This is a entityManagerFactory method - * - * @param dataSource - * @return LocalContainerEntityManagerFactoryBean - */ - - @Bean - public LocalContainerEntityManagerFactoryBean entityManagerFactory(DataSource dataSource) { - HibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter(); - vendorAdapter.setGenerateDdl(true); - vendorAdapter.setShowSql(false); - LocalContainerEntityManagerFactoryBean factory = new LocalContainerEntityManagerFactoryBean(); - factory.setJpaVendorAdapter(vendorAdapter); - factory.setPackagesToScan("org.onap.ccsdk.cds.controllerblueprints.service.domain"); - factory.setDataSource(dataSource); - return factory; - } - -} diff --git a/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/cds/controllerblueprints/WebConfig.java b/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/cds/controllerblueprints/WebConfig.java deleted file mode 100644 index e4799bc84..000000000 --- a/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/cds/controllerblueprints/WebConfig.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright © 2017-2018 AT&T Intellectual Property. - * Modifications Copyright © 2018 IBM. - * 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. - */ - -package org.onap.ccsdk.cds.controllerblueprints; - -import org.springframework.context.annotation.Configuration; -import org.springframework.web.reactive.config.CorsRegistry; -import org.springframework.web.reactive.config.ResourceHandlerRegistry; -import org.springframework.web.reactive.config.WebFluxConfigurationSupport; - -/** - * WebConfig - * - * @author Brinda Santh 8/13/2018 - */ -@Configuration -@SuppressWarnings("unused") -public class WebConfig extends WebFluxConfigurationSupport { - @Override - public void addResourceHandlers(ResourceHandlerRegistry registry) { - registry.addResourceHandler("swagger-ui.html") - .addResourceLocations("classpath:/META-INF/resources/"); - - registry.addResourceHandler("/webjars/**") - .addResourceLocations("classpath:/META-INF/resources/webjars/"); - - } - - @Override - public void addCorsMappings(CorsRegistry corsRegistry) { - corsRegistry.addMapping("/**") - .allowedOrigins("*") - .allowedMethods("*") - .allowedHeaders("DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range") - .maxAge(3600); - } -} diff --git a/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/cds/controllerblueprints/security/ApplicationSecurityConfigurerAdapter.java b/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/cds/controllerblueprints/security/ApplicationSecurityConfigurerAdapter.java deleted file mode 100644 index d992dd945..000000000 --- a/ms/controllerblueprints/application/src/main/java/org/onap/ccsdk/cds/controllerblueprints/security/ApplicationSecurityConfigurerAdapter.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright © 2017-2018 AT&T Intellectual Property. - * - * 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. - */ - -package org.onap.ccsdk.cds.controllerblueprints.security; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Bean; -import org.springframework.security.config.annotation.web.reactive.EnableWebFluxSecurity; -import org.springframework.security.config.web.server.ServerHttpSecurity; -import org.springframework.security.core.userdetails.MapReactiveUserDetailsService; -import org.springframework.security.core.userdetails.User; -import org.springframework.security.core.userdetails.UserDetails; -import org.springframework.security.web.server.SecurityWebFilterChain; - -@SuppressWarnings("unused") -@EnableWebFluxSecurity -public class ApplicationSecurityConfigurerAdapter { - - @Value("${basic-auth.user-name}") - private String userName; - - @Value("${basic-auth.hashed-pwd}") - private String userHashedPassword; - - private static Logger log = LoggerFactory.getLogger(ApplicationSecurityConfigurerAdapter.class); - - @Bean - public SecurityWebFilterChain springWebFilterChain(ServerHttpSecurity http) throws Exception { - - http.csrf().disable(); - http.authorizeExchange() - .pathMatchers("/webjars/**", "/actuator/**").permitAll() - .anyExchange().authenticated() - .and().httpBasic(); - - return http.build(); - } - - @Bean - public MapReactiveUserDetailsService userDetailsService() { - User.UserBuilder userBuilder = User.builder(); - UserDetails defaultUser = userBuilder - .username(userName) - .password(userHashedPassword).roles("USER").build(); - return new MapReactiveUserDetailsService(defaultUser); - } -} \ No newline at end of file -- cgit 1.2.3-korg