X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=ves-nf-oam-adopter%2Fves-nf-oam-adopter-app%2Fsrc%2Fmain%2Fjava%2Forg%2Fo%2Fran%2Foam%2Fnf%2Foam%2Fadopter%2Fapp%2Fconfig%2FSecurityConfiguration.java;h=de317f37d8435a7b1cf38f62ad2b5a91648d3308;hb=2b8bb7bfd6f3586ecdf914ce4ed95f21dd0ee46b;hp=18101a431e150260ab114055473e1c6315d12dab;hpb=e4d3cdf5d8679fdad10e12d16d0913b9754049a4;p=oam%2Fnf-oam-adopter.git diff --git a/ves-nf-oam-adopter/ves-nf-oam-adopter-app/src/main/java/org/o/ran/oam/nf/oam/adopter/app/config/SecurityConfiguration.java b/ves-nf-oam-adopter/ves-nf-oam-adopter-app/src/main/java/org/o/ran/oam/nf/oam/adopter/app/config/SecurityConfiguration.java index 18101a4..de317f3 100644 --- a/ves-nf-oam-adopter/ves-nf-oam-adopter-app/src/main/java/org/o/ran/oam/nf/oam/adopter/app/config/SecurityConfiguration.java +++ b/ves-nf-oam-adopter/ves-nf-oam-adopter-app/src/main/java/org/o/ran/oam/nf/oam/adopter/app/config/SecurityConfiguration.java @@ -19,8 +19,7 @@ package org.o.ran.oam.nf.oam.adopter.app.config; -import org.o.ran.oam.nf.oam.adopter.app.ServerProperties; -import org.o.ran.oam.nf.oam.adopter.app.SslProperties; +import org.o.ran.oam.nf.oam.adopter.app.properties.ServerProperties; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; @@ -43,15 +42,16 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter { @Override protected void configure(final HttpSecurity http) throws Exception { - final SslProperties ssl = properties.getSsl(); - if (ssl != null && ssl.getEnabled() != null && ssl.getEnabled()) { - http.requiresChannel().anyRequest().requiresSecure(); - } - http.csrf().disable().antMatcher("/adapters/**").authorizeRequests().anyRequest().hasRole(ADMIN_ROLE).and() + http.requiresChannel().anyRequest().requiresSecure(); + http.csrf().disable() + .antMatcher("/adapters/**") + .authorizeRequests().anyRequest() + .hasRole(ADMIN_ROLE).and() .httpBasic(); } @Bean + @Autowired public AuthenticationManager authenticationManagerBean() throws Exception { return super.authenticationManagerBean(); }