BAEL-315 - reformatting config classes

This commit is contained in:
slavisa-baeldung 2016-10-29 19:25:52 +02:00
parent be45787757
commit e087fc921e
4 changed files with 46 additions and 50 deletions

View File

@ -18,8 +18,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Override @Override
protected void configure(HttpSecurity http) throws Exception { protected void configure(HttpSecurity http) throws Exception {
http http.authorizeRequests()
.authorizeRequests()
.anyRequest().hasRole("SYSTEM") .anyRequest().hasRole("SYSTEM")
.and() .and()
.httpBasic() .httpBasic()

View File

@ -22,8 +22,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Override @Override
protected void configure(HttpSecurity http) throws Exception { protected void configure(HttpSecurity http) throws Exception {
http http.sessionManagement()
.sessionManagement()
.sessionCreationPolicy(SessionCreationPolicy.ALWAYS) .sessionCreationPolicy(SessionCreationPolicy.ALWAYS)
.and() .and()
.requestMatchers() .requestMatchers()

View File

@ -21,8 +21,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Override @Override
protected void configure(HttpSecurity http) throws Exception { protected void configure(HttpSecurity http) throws Exception {
http http.authorizeRequests()
.authorizeRequests()
.antMatchers("/resource/hello/cloud").permitAll() .antMatchers("/resource/hello/cloud").permitAll()
.antMatchers("/eureka/**").hasRole("ADMIN") .antMatchers("/eureka/**").hasRole("ADMIN")
.anyRequest().authenticated() .anyRequest().authenticated()

View File

@ -19,8 +19,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Override @Override
protected void configure(HttpSecurity http) throws Exception { protected void configure(HttpSecurity http) throws Exception {
http http.httpBasic()
.httpBasic()
.disable() .disable()
.authorizeRequests() .authorizeRequests()
.antMatchers("/hello/cloud").permitAll() .antMatchers("/hello/cloud").permitAll()