-/*\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 com.att.eelf.configuration.EELFLogger;\r
-import com.att.eelf.configuration.EELFManager;\r
-import org.springframework.beans.factory.annotation.Value;\r
-import org.springframework.context.annotation.Bean;\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
-@EnableWebFluxSecurity\r
-public class ApplicationSecurityConfigurerAdapter {\r
-\r
- @Value("${basic-auth.user-name}")\r
- private String userName;\r
-\r
- @Value("${basic-auth.hashed-pwd}")\r
- private String userHashedPassword;\r
-\r
- private static EELFLogger log = EELFManager.getInstance().getLogger(ApplicationSecurityConfigurerAdapter.class);\r
-\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 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
+/*
+ * 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 com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+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 EELFLogger log = EELFManager.getInstance().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