\r
<configuration>\r
\r
- <property name="localPattern" value="%d{HH:mm:ss.SSS} %-5level %logger{100} - %msg%n" />\r
+ <property name="localPattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{100} - %msg%n" />\r
\r
<property name="defaultPattern" value="%date{ISO8601,UTC}|%X{RequestID}|%X{ServiceInstanceId}|%thread|%X{VirtualServerName}|%X{ServiceName}|%X{InstanceUUID}|%.-5level|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ServerFQDN}|%X{RemoteHost}|%X{ClassName}|%X{Timer}| %msg%n" />\r
\r
# Basic Authentication
basic-auth.user-name=ccsdkapps
-basic-auth.hashed-pwd=$2a$10$MJxhNiOAffxbyrV9.rrOUewP9Q/ASg5Nit2cmP.yBaXGsVXo8BW3y
+basic-auth.hashed-pwd={bcrypt}$2a$10$MJxhNiOAffxbyrV9.rrOUewP9Q/ASg5Nit2cmP.yBaXGsVXo8BW3y
#logging.pattern.console=%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%5p) %clr($ threadId: {PID:- }){magenta} %clr(---){faint} %clr([ hostname: %X{hostname} serviceName: %X{serviceName} version: %X{version} transactionId: %X{transactionId} requestTimeStamp: %X{requestTimestamp} responseTimeStamp: %X{responseTimestamp} duration: %X{duration}]){yellow} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n%wex
# Basic Authentication
basic-auth.user-name=ccsdkapps
-basic-auth.hashed-pwd=$2a$10$MJxhNiOAffxbyrV9.rrOUewP9Q/ASg5Nit2cmP.yBaXGsVXo8BW3y
+basic-auth.hashed-pwd={bcrypt}$2a$10$MJxhNiOAffxbyrV9.rrOUewP9Q/ASg5Nit2cmP.yBaXGsVXo8BW3y
#logging.pattern.console=%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%5p) %clr($ threadId: {PID:- }){magenta} %clr(---){faint} %clr([ hostname: %X{hostname} serviceName: %X{serviceName} version: %X{version} transactionId: %X{transactionId} requestTimeStamp: %X{requestTimestamp} responseTimeStamp: %X{responseTimestamp} duration: %X{duration}]){yellow} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n%wex
<artifactId>application</artifactId>\r
<name>Controller Blueprints Application</name>\r
<properties>\r
- <swagger.directory>${basedir}/src/main/resources/swagger-ui/dist</swagger.directory>\r
+ <swagger.directory>${basedir}/target/src/main/resources/swagger-ui</swagger.directory>\r
<java.version>1.8</java.version>\r
<name.space>org.onap.ccsdk.apps</name.space> <!-- <name.space>${namespace}</name.space> -->\r
<serviceArtifactName>controllerblueprints</serviceArtifactName>\r
<target>1.8</target>\r
</configuration>\r
</plugin>\r
+ <plugin>\r
+ <groupId>com.github.kongchen</groupId>\r
+ <artifactId>swagger-maven-plugin</artifactId>\r
+ <version>3.1.7</version>\r
+ <configuration>\r
+ <apiSources>\r
+ <apiSource>\r
+ <springmvc>true</springmvc>\r
+ <locations>org.onap.ccsdk.apps.controllerblueprints.service.rs\r
+ </locations>\r
+ <schemes>\r
+ <scheme>http</scheme>\r
+ <scheme>https</scheme>\r
+ </schemes>\r
+ <basePath>/api/v1</basePath>\r
+ <info>\r
+ <title>Controller Blueprints</title>\r
+ <version>${project.version}</version>\r
+ <description>\r
+ Controller blueprints API for VNF Self Service.\r
+ </description>\r
+ <termsOfService>\r
+ Terms of service\r
+ </termsOfService>\r
+ <contact>\r
+ <email>brindasanth@gmail.com</email>\r
+ <name>Brinda Santh</name>\r
+ <url>http://onap.com</url>\r
+ </contact>\r
+ <license>\r
+ <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>\r
+ <name>Apache 2.0</name>\r
+ </license>\r
+ </info>\r
+ <swaggerDirectory>${swagger.directory}</swaggerDirectory>\r
+ </apiSource>\r
+ </apiSources>\r
+ </configuration>\r
+ <executions>\r
+ <execution>\r
+ <phase>compile</phase>\r
+ <goals>\r
+ <goal>generate</goal>\r
+ </goals>\r
+ </execution>\r
+ </executions>\r
+ </plugin>\r
</plugins>\r
</build>\r
- \r
- \r
+\r
+\r
</project>\r
\r
+++ /dev/null
-/*\r
- * Copyright © 2017-2018 AT&T Intellectual Property.\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-package org.onap.ccsdk.apps.controllerblueprints;\r
-\r
-import com.att.eelf.configuration.EELFLogger;\r
-import com.att.eelf.configuration.EELFManager;\r
-import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintException;\r
-import org.onap.ccsdk.apps.controllerblueprints.service.common.ErrorMessage;\r
-import org.springframework.http.HttpStatus;\r
-import org.springframework.http.ResponseEntity;\r
-import org.springframework.http.converter.HttpMessageNotReadableException;\r
-import org.springframework.security.authentication.BadCredentialsException;\r
-import org.springframework.security.web.csrf.InvalidCsrfTokenException;\r
-import org.springframework.web.HttpRequestMethodNotSupportedException;\r
-import org.springframework.web.bind.MethodArgumentNotValidException;\r
-import org.springframework.web.bind.annotation.ControllerAdvice;\r
-import org.springframework.web.bind.annotation.ExceptionHandler;\r
-import org.springframework.web.bind.annotation.ResponseStatus;\r
-import org.springframework.web.bind.annotation.RestController;\r
-import org.springframework.web.context.request.WebRequest;\r
-\r
-import javax.naming.AuthenticationException;\r
-import java.nio.file.AccessDeniedException;\r
-\r
-@ControllerAdvice\r
-@RestController\r
-@SuppressWarnings("unused")\r
-public class ApplicationExceptionHandler {\r
- private static EELFLogger log = EELFManager.getInstance().getLogger(ApplicationExceptionHandler.class);\r
-\r
- @ExceptionHandler(Exception.class)\r
- public final ResponseEntity<ErrorMessage> handleAllExceptions(Exception ex, WebRequest request) {\r
- log.error("Application Exception", ex);\r
- ErrorMessage exceptionResponse = new ErrorMessage(ex.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR.value(), ex.getLocalizedMessage());\r
- return new ResponseEntity<>(exceptionResponse, HttpStatus.INTERNAL_SERVER_ERROR);\r
- }\r
-\r
- @ExceptionHandler({InvalidCsrfTokenException.class, AuthenticationException.class, BadCredentialsException.class, AccessDeniedException.class})\r
- @ResponseStatus(value = HttpStatus.UNAUTHORIZED)\r
- public final ResponseEntity<ErrorMessage> handleAuthenticationRequest(Exception ex, WebRequest request) {\r
- log.error("Authentication Exception", ex);\r
- ErrorMessage exceptionResponse = new ErrorMessage(ex.getMessage(), HttpStatus.UNAUTHORIZED.value(), ex.getLocalizedMessage());\r
- return new ResponseEntity<>(exceptionResponse, HttpStatus.UNAUTHORIZED);\r
- }\r
-\r
- @ExceptionHandler({HttpMessageNotReadableException.class, MethodArgumentNotValidException.class,\r
- HttpRequestMethodNotSupportedException.class})\r
- public final ResponseEntity<ErrorMessage> handleBadRequest(Exception ex, WebRequest request) {\r
- log.error("Bad Request Exception", ex);\r
- ErrorMessage exceptionResponse = new ErrorMessage(ex.getMessage(), HttpStatus.BAD_REQUEST.value(), ex.getLocalizedMessage());\r
- return new ResponseEntity<>(exceptionResponse, HttpStatus.BAD_REQUEST);\r
- }\r
-\r
- @ExceptionHandler(BluePrintException.class)\r
- public final ResponseEntity<ErrorMessage> handleBlueprintException(BluePrintException ex, WebRequest request) {\r
- log.error("Application Blueprint Exception", ex);\r
- ErrorMessage exceptionResponse = new ErrorMessage(ex.getMessage(), ex.getCode(), ex.getLocalizedMessage());\r
- return new ResponseEntity<>(exceptionResponse, HttpStatus.INTERNAL_SERVER_ERROR);\r
- }\r
-}\r
import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintConstants;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.RequestMethod;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.service.ResponseMessage;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
-import springfox.documentation.swagger2.annotations.EnableSwagger2;
import java.util.Collections;
import java.util.HashMap;
*
* @author Brinda Santh 8/13/2018
*/
-@Configuration
-@EnableSwagger2
+@Deprecated
+//@Configuration
+//@EnableSwagger2
@SuppressWarnings("unused")
public class SwaggerConfig {
@Value("${appVersion}")
package org.onap.ccsdk.apps.controllerblueprints;\r
\r
import org.springframework.context.annotation.Configuration;\r
+import org.springframework.web.reactive.config.CorsRegistry;\r
import org.springframework.web.reactive.config.ResourceHandlerRegistry;\r
import org.springframework.web.reactive.config.WebFluxConfigurationSupport;\r
\r
\r
registry.addResourceHandler("/webjars/**")\r
.addResourceLocations("classpath:/META-INF/resources/webjars/");\r
+\r
+ }\r
+\r
+ @Override\r
+ public void addCorsMappings(CorsRegistry corsRegistry) {\r
+ corsRegistry.addMapping("/**")\r
+ .allowedOrigins("*")\r
+ .allowedMethods("*")\r
+ .allowedHeaders("DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range")\r
+ .maxAge(3600);\r
}\r
}\r
import com.google.common.base.Preconditions;\r
import org.apache.commons.lang3.StringUtils;\r
import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintConstants;\r
-import org.onap.logging.ref.slf4j.ONAPLogAdapter;\r
import org.slf4j.Logger;\r
import org.slf4j.LoggerFactory;\r
import org.slf4j.MDC;\r
import org.springframework.beans.factory.annotation.Value;\r
-import org.springframework.core.Ordered;\r
-import org.springframework.core.annotation.Order;\r
-import org.springframework.stereotype.Component;\r
+import org.springframework.context.annotation.Configuration;\r
+import org.springframework.http.HttpHeaders;\r
+import org.springframework.http.server.reactive.ServerHttpRequest;\r
+import org.springframework.http.server.reactive.ServerHttpResponse;\r
+import org.springframework.web.server.ServerWebExchange;\r
+import org.springframework.web.server.WebFilter;\r
+import org.springframework.web.server.WebFilterChain;\r
+import reactor.core.publisher.Mono;\r
\r
-import javax.servlet.*;\r
-import javax.servlet.annotation.WebFilter;\r
-import javax.servlet.http.HttpServletRequest;\r
-import javax.servlet.http.HttpServletResponse;\r
-import java.io.IOException;\r
+import java.time.ZoneOffset;\r
+import java.time.ZonedDateTime;\r
+import java.time.format.DateTimeFormatter;\r
+import java.util.UUID;\r
\r
/**\r
* ApplicationLoggingFilter\r
*\r
* @author Brinda Santh 8/14/2018\r
*/\r
-@Component\r
-@WebFilter(asyncSupported = true, urlPatterns = {"/*"})\r
-@Order(Ordered.HIGHEST_PRECEDENCE)\r
+@Configuration\r
@SuppressWarnings("unused")\r
-public class ApplicationLoggingFilter implements Filter {\r
+public class ApplicationLoggingFilter implements WebFilter {\r
private static Logger log = LoggerFactory.getLogger(ApplicationLoggingFilter.class);\r
\r
@SuppressWarnings("unused")\r
@Value("${appVersion}")\r
private String appVersion;\r
\r
- public void doFilter(ServletRequest request,\r
- ServletResponse response,\r
- FilterChain chain) throws IOException, ServletException {\r
-\r
- HttpServletRequest req = (HttpServletRequest) request;\r
- HttpServletResponse res = (HttpServletResponse) response;\r
-\r
- ONAPLogAdapter onapLogAdapter = new ONAPLogAdapter(log);\r
- onapLogAdapter.entering(req);\r
-\r
- String[] tokens = StringUtils.split(appVersion, '.');\r
- Preconditions.checkNotNull(tokens, "failed to split application versions");\r
- Preconditions.checkArgument(tokens.length == 3, "failed to tokenize application versions");\r
- res.addHeader(BluePrintConstants.RESPONSE_HEADER_TRANSACTION_ID, MDC.get("RequestID"));\r
- res.addHeader(BluePrintConstants.RESPONSE_HEADER_MINOR_VERSION, tokens[1]);\r
- res.addHeader(BluePrintConstants.RESPONSE_HEADER_PATCH_VERSION, tokens[2]);\r
- res.addHeader(BluePrintConstants.RESPONSE_HEADER_LATEST_VERSION, appVersion);\r
- chain.doFilter(request, response);\r
- // Clean the MDC info\r
- onapLogAdapter.exiting();\r
+ @Override\r
+ public Mono<Void> filter(ServerWebExchange serverWebExchange, WebFilterChain webFilterChain) {\r
+ try {\r
+\r
+ ServerHttpRequest request = serverWebExchange.getRequest();\r
+ ServerHttpResponse response = serverWebExchange.getResponse();\r
+\r
+ String[] tokens = StringUtils.split(appVersion, '.');\r
+ Preconditions.checkNotNull(tokens, "failed to split application versions");\r
+ Preconditions.checkArgument(tokens.length == 3, "failed to tokenize application versions");\r
+ HttpHeaders header = response.getHeaders();\r
+\r
+ String requestID = defaultToUUID(request.getHeaders().getFirst("X-ONAP-RequestID"));\r
+ String invocationID = defaultToUUID(request.getHeaders().getFirst("X-ONAP-InvocationID"));\r
+ String partnerName = defaultToEmpty(request.getHeaders().getFirst("X-ONAP-PartnerName"));\r
+ MDC.put("InvokeTimestamp", ZonedDateTime.now(ZoneOffset.UTC).format(DateTimeFormatter.ISO_INSTANT));\r
+ MDC.put("RequestID", requestID);\r
+ MDC.put("InvocationID", invocationID);\r
+ MDC.put("PartnerName", partnerName);\r
+ MDC.put("ClientIPAddress", defaultToEmpty(request.getRemoteAddress().getAddress()));\r
+ MDC.put("ServerFQDN", defaultToEmpty(request.getRemoteAddress().getHostString()));\r
+\r
+ header.add(BluePrintConstants.RESPONSE_HEADER_TRANSACTION_ID, requestID);\r
+ header.add(BluePrintConstants.RESPONSE_HEADER_MINOR_VERSION, tokens[1]);\r
+ header.add(BluePrintConstants.RESPONSE_HEADER_PATCH_VERSION, tokens[2]);\r
+ header.add(BluePrintConstants.RESPONSE_HEADER_LATEST_VERSION, appVersion);\r
+ } catch (Exception e) {\r
+ e.printStackTrace();\r
+ }\r
+\r
+ return webFilterChain.filter(serverWebExchange);\r
+\r
}\r
\r
- @Override\r
- public void init(FilterConfig filterConfig) {\r
- //method does nothing\r
+ private static String defaultToUUID(String in) {\r
+ return in == null ? UUID.randomUUID().toString() : in;\r
}\r
\r
- @Override\r
- public void destroy() {\r
- //method does nothing\r
+ private static String defaultToEmpty(Object in) {\r
+ return in == null ? "" : in.toString();\r
}\r
+\r
+\r
}
\ No newline at end of file
+++ /dev/null
-/*\r
- * Copyright © 2017-2018 AT&T Intellectual Property.\r
- * Modifications Copyright © 2018 IBM.\r
- * \r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-package org.onap.ccsdk.apps.controllerblueprints.filters;\r
-\r
-import org.springframework.http.HttpMethod;\r
-import org.springframework.stereotype.Component;\r
-import javax.servlet.*;\r
-import javax.servlet.annotation.WebFilter;\r
-import javax.servlet.http.HttpServletRequest;\r
-import javax.servlet.http.HttpServletResponse;\r
-import java.io.IOException;\r
-/**\r
- * CorsFilter.java Purpose: Provide Configuration Generator CorsFilter Information\r
- *\r
- * @author Brinda Santh\r
- */\r
-@Component\r
-@WebFilter(asyncSupported = true, urlPatterns = {"/*"})\r
-@SuppressWarnings("unused")\r
-public class CorsFilter implements Filter {\r
-\r
- public void destroy() {\r
- //method does nothing\r
- }\r
-\r
- public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain chain)\r
- throws IOException, ServletException {\r
-\r
- HttpServletRequest request = (HttpServletRequest) servletRequest;\r
- HttpServletResponse response = (HttpServletResponse) servletResponse;\r
-\r
- response.addHeader("Access-Control-Allow-Origin", "*");\r
- response.addHeader("Access-Control-Allow-Methods", "*");\r
- response.addHeader("Access-Control-Allow-Headers",\r
- "DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range");\r
-\r
- if (request.getMethod().equals(HttpMethod.OPTIONS.toString())) {\r
- response.addHeader("Access-Control-Max-Age", "1728000");\r
- response.setStatus(HttpServletResponse.SC_ACCEPTED);\r
- return;\r
- }\r
- chain.doFilter(request, servletResponse);\r
- }\r
-\r
- public void init(FilterConfig fConfig) throws ServletException {\r
- //method does nothing\r
- }\r
-\r
-}
\ No newline at end of file
+++ /dev/null
-/*\r
- * Copyright © 2017-2018 AT&T Intellectual Property.\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-package org.onap.ccsdk.apps.controllerblueprints.security;\r
-\r
-import org.springframework.security.core.AuthenticationException;\r
-import org.springframework.security.web.authentication.www.BasicAuthenticationEntryPoint;\r
-import org.springframework.stereotype.Component;\r
-import javax.servlet.http.HttpServletRequest;\r
-import javax.servlet.http.HttpServletResponse;\r
-import java.io.IOException;\r
-\r
-@Component\r
-public class ApplicationBasicAuthenticationEntryPoint extends BasicAuthenticationEntryPoint {\r
-\r
- @Override\r
- public void commence(final HttpServletRequest request, final HttpServletResponse response, final AuthenticationException authException)\r
- throws IOException {\r
- response.addHeader("WWW-Authenticate", "Basic realm=\"" + getRealmName() + "\"");\r
- response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);\r
- response.sendError(HttpServletResponse.SC_UNAUTHORIZED, "Unauthorized");\r
- }\r
-\r
- @Override\r
- public void afterPropertiesSet() throws Exception {\r
- setRealmName("CCSDK-APPS");\r
- super.afterPropertiesSet();\r
- }\r
-\r
-}
\ No newline at end of file
/*\r
- * Copyright © 2017-2018 AT&T Intellectual Property.\r
+ * Copyright © 2017-2018 AT&T Intellectual Property.\r
*\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
*\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
*\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
*/\r
\r
package org.onap.ccsdk.apps.controllerblueprints.security;\r
\r
import com.att.eelf.configuration.EELFLogger;\r
import com.att.eelf.configuration.EELFManager;\r
-import org.springframework.beans.factory.annotation.Autowired;\r
import org.springframework.beans.factory.annotation.Value;\r
import org.springframework.context.annotation.Bean;\r
-import org.springframework.context.annotation.Configuration;\r
-import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;\r
-import org.springframework.security.config.annotation.web.builders.HttpSecurity;\r
-import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;\r
-import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;\r
-import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;\r
-import org.springframework.security.crypto.password.PasswordEncoder;\r
+import org.springframework.security.config.annotation.web.reactive.EnableWebFluxSecurity;\r
+import org.springframework.security.config.web.server.ServerHttpSecurity;\r
+import org.springframework.security.core.userdetails.MapReactiveUserDetailsService;\r
+import org.springframework.security.core.userdetails.User;\r
+import org.springframework.security.core.userdetails.UserDetails;\r
+import org.springframework.security.web.server.SecurityWebFilterChain;\r
\r
@SuppressWarnings("unused")\r
-@Configuration\r
-@EnableWebSecurity\r
-public class ApplicationSecurityConfigurerAdapter extends WebSecurityConfigurerAdapter {\r
+@EnableWebFluxSecurity\r
+public class ApplicationSecurityConfigurerAdapter {\r
\r
@Value("${basic-auth.user-name}")\r
private String userName;\r
\r
private static EELFLogger log = EELFManager.getInstance().getLogger(ApplicationSecurityConfigurerAdapter.class);\r
\r
- @Autowired\r
- private ApplicationBasicAuthenticationEntryPoint authenticationEntryPoint;\r
-\r
- @Autowired\r
- public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {\r
- log.info("User Id {} and hashed pwd : {}", userName, userHashedPassword);\r
- auth.inMemoryAuthentication()\r
- .withUser(userName).password(userHashedPassword)\r
- .authorities("ROLE_USER");\r
- }\r
-\r
- @Override\r
- protected void configure(HttpSecurity http) throws Exception {\r
- http.authorizeRequests()\r
- .antMatchers("/actuator/health").permitAll()\r
- .antMatchers("/**").authenticated()\r
- .and()\r
- .httpBasic()\r
- .authenticationEntryPoint(authenticationEntryPoint);\r
+ @Bean\r
+ public SecurityWebFilterChain springWebFilterChain(ServerHttpSecurity http) throws Exception {\r
\r
http.csrf().disable();\r
+ http.authorizeExchange()\r
+ .pathMatchers("/webjars/**", "/actuator/**").permitAll()\r
+ .anyExchange().authenticated()\r
+ .and().httpBasic();\r
+\r
+ return http.build();\r
}\r
\r
@Bean\r
- public PasswordEncoder passwordEncoder() {\r
- return new BCryptPasswordEncoder();\r
+ public MapReactiveUserDetailsService userDetailsService() {\r
+ User.UserBuilder userBuilder = User.builder();\r
+ UserDetails defaultUser = userBuilder\r
+ .username(userName)\r
+ .password(userHashedPassword).roles("USER").build();\r
+ return new MapReactiveUserDetailsService(defaultUser);\r
}\r
}
\ No newline at end of file
\r
# Basic Authentication\r
basic-auth.user-name=ccsdkapps\r
-basic-auth.hashed-pwd=$2a$10$MJxhNiOAffxbyrV9.rrOUewP9Q/ASg5Nit2cmP.yBaXGsVXo8BW3y\r
+basic-auth.hashed-pwd={bcrypt}$2a$10$MJxhNiOAffxbyrV9.rrOUewP9Q/ASg5Nit2cmP.yBaXGsVXo8BW3y\r
\r
#To Remove Null in JSON API Response\r
spring.jackson.default-property-inclusion=non_null\r
<groupId>org.springframework.boot</groupId>\r
<artifactId>spring-boot-starter-webflux</artifactId>\r
</dependency>\r
- <dependency>\r
- <groupId>org.springframework.boot</groupId>\r
- <artifactId>spring-boot-starter-web</artifactId>\r
- </dependency>\r
<dependency>\r
<groupId>org.springframework.boot</groupId>\r
<artifactId>spring-boot-starter-data-jpa</artifactId>\r
* @author Brinda Santh
* @version 1.0
*/
-
+@Deprecated
@Component
@ConditionalOnProperty(name = "blueprints.load.initial-data", havingValue = "true")
public class DataBaseInitService {
* @author Brinda Santh\r
* @version 1.0\r
*/\r
-\r
+@Deprecated\r
public class SchemaGeneratorService {\r
private static EELFLogger log = EELFManager.getInstance().getLogger(SchemaGeneratorService.class);\r
\r
@Column(name = "description")\r
private String description;\r
\r
+ @Deprecated\r
@Lob\r
@Column(name = "content", nullable = false)\r
@ApiModelProperty(required=true)\r
* @author Brinda Santh\r
* @version 1.0\r
*/\r
+@Deprecated\r
@Repository\r
public interface ConfigModelContentRepository extends JpaRepository<ConfigModelContent, Long> {\r
\r
/**\r
* {@inheritDoc}\r
*/\r
+@Deprecated\r
@RestController\r
@RequestMapping(value = "/api/v1/config-model")\r
public class ConfigModelRest {\r
/**\r
* {@inheritDoc}\r
*/\r
+@Deprecated\r
@RestController\r
@RequestMapping(value = "/api/v1/model-type")\r
public class ModelTypeRest {\r
/**\r
* {@inheritDoc}\r
*/\r
+@Deprecated\r
@RestController\r
@RequestMapping(value = "/api/v1/dictionary")\r
public class ResourceDictionaryRest {\r
/**\r
* {@inheritDoc}\r
*/\r
+@Deprecated\r
@RestController\r
@RequestMapping(value = "/api/v1/service-template")\r
public class ServiceTemplateRest {\r
import java.util.Arrays;\r
import java.util.List;\r
\r
+@Deprecated\r
public class ConfigModelUtils {\r
\r
private ConfigModelUtils() {\r
<name>Controller Blueprints Parent</name>
<packaging>pom</packaging>
<properties>
- <spring.boot.version>2.0.6.RELEASE</spring.boot.version>
- <spring.version>5.0.10.RELEASE</spring.version>
+ <spring.boot.version>2.1.1.RELEASE</spring.boot.version>
+ <spring.version>5.1.3.RELEASE</spring.version>
<kotlin.version>1.3.10</kotlin.version>
<kotlin.maven.version>1.3.10</kotlin.maven.version>
<kotlin.couroutines.version>1.0.1</kotlin.couroutines.version>
<version>${kotlin.version}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>io.grpc</groupId>
+ <artifactId>grpc-testing</artifactId>
+ <version>${grpc.version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</dependencyManagement>