summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cps-application/src/main/java/org/onap/cps/config/WebSecurityConfig.java16
-rw-r--r--cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/events/EventsPublisher.java9
2 files changed, 11 insertions, 14 deletions
diff --git a/cps-application/src/main/java/org/onap/cps/config/WebSecurityConfig.java b/cps-application/src/main/java/org/onap/cps/config/WebSecurityConfig.java
index 9b726ba75d..120e0f3658 100644
--- a/cps-application/src/main/java/org/onap/cps/config/WebSecurityConfig.java
+++ b/cps-application/src/main/java/org/onap/cps/config/WebSecurityConfig.java
@@ -27,6 +27,7 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
+import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer;
import org.springframework.security.core.userdetails.User;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.provisioning.InMemoryUserDetailsManager;
@@ -76,20 +77,19 @@ public class WebSecurityConfig {
@SuppressWarnings("squid:S4502")
public SecurityFilterChain filterChain(final HttpSecurity http) throws Exception {
http
- .httpBasic()
- .and()
- .authorizeHttpRequests()
- .requestMatchers(permitUris).permitAll()
- .anyRequest().authenticated()
- .and()
- .csrf().disable();
+ .httpBasic(httpBasicCustomizer -> {})
+ .authorizeHttpRequests(authorizeHttpRequestsCustomizer -> {
+ authorizeHttpRequestsCustomizer.requestMatchers(permitUris).permitAll();
+ authorizeHttpRequestsCustomizer.anyRequest().authenticated();
+ })
+ .csrf(AbstractHttpConfigurer::disable);
return http.build();
}
/**
* In memory user authentication details.
*
- * @return in memory authetication
+ * @return in memory authentication
*/
@Bean
public InMemoryUserDetailsManager userDetailsService() {
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/events/EventsPublisher.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/events/EventsPublisher.java
index 355e5cdf79..dddad63923 100644
--- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/events/EventsPublisher.java
+++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/events/EventsPublisher.java
@@ -43,11 +43,9 @@ import org.springframework.util.SerializationUtils;
public class EventsPublisher<T> {
/**
- * KafaTemplate for legacy (non-cloud) events.
- *
- * @deprecated Cloud events should be used. Will address soon as part of https://jira.onap.org/browse/CPS-1717
+ * KafkaTemplate for legacy (non-cloud) events.
+ * Note: Cloud events should be used. This will be addressed as part of https://jira.onap.org/browse/CPS-1717.
*/
- @Deprecated(forRemoval = true)
private final KafkaTemplate<String, T> legacyKafkaEventTemplate;
private final KafkaTemplate<String, CloudEvent> cloudEventKafkaTemplate;
@@ -75,13 +73,12 @@ public class EventsPublisher<T> {
/**
* Generic Event publisher.
+ * Note: Cloud events should be used. This will be addressed as part of https://jira.onap.org/browse/CPS-1717.
*
* @param topicName valid topic name
* @param eventKey message key
* @param event message payload
- * @deprecated Cloud events should be used. Will address soon as part of https://jira.onap.org/browse/CPS-1717
*/
- @Deprecated(forRemoval = true)
public void publishEvent(final String topicName, final String eventKey, final T event) {
final CompletableFuture<SendResult<String, T>> eventFuture =
legacyKafkaEventTemplate.send(topicName, eventKey, event);