@ -793,7 +793,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
@@ -793,7 +793,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
SecurityFilterChain filterChain ( HttpSecurity http ) throws Exception {
// @formatter:off
http
. authorizeHttpRequests ( ( requests ) - > requests
. authorizeHttpRequests ( ( autho riz e) - > autho riz e
. anyRequest ( ) ) ;
// @formatter:on
@ -810,7 +810,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
@@ -810,7 +810,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
SecurityFilterChain filterChain ( HttpSecurity http ) throws Exception {
// @formatter:off
return http
. authorizeHttpRequests ( ( requests ) - > requests
. authorizeHttpRequests ( ( autho riz e) - > autho riz e
. anyRequest ( ) . authenticated ( )
. requestMatchers ( "/path" ) . hasRole ( "USER" )
)
@ -830,7 +830,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
@@ -830,7 +830,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
SecurityFilterChain filterChain ( HttpSecurity http ) throws Exception {
// @formatter:off
return http
. authorizeHttpRequests ( ( requests ) - > requests
. authorizeHttpRequests ( ( autho riz e) - > autho riz e
. anyRequest ( ) . access ( authorizationManager )
)
. build ( ) ;
@ -849,7 +849,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
@@ -849,7 +849,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
SecurityFilterChain filterChain ( HttpSecurity http ) throws Exception {
// @formatter:off
http
. authorizeHttpRequests ( ( requests ) - > requests
. authorizeHttpRequests ( ( autho riz e) - > autho riz e
. anyRequest ( ) . access ( authorizationManager ) ) ;
// @formatter:on
@ -868,7 +868,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
@@ -868,7 +868,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
SecurityFilterChain filterChain ( HttpSecurity http ) throws Exception {
// @formatter:off
return http
. authorizeHttpRequests ( ( requests ) - > requests
. authorizeHttpRequests ( ( autho riz e) - > autho riz e
. anyRequest ( ) . authenticated ( )
)
. build ( ) ;
@ -900,7 +900,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
@@ -900,7 +900,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
// @formatter:off
return http
. httpBasic ( withDefaults ( ) )
. authorizeHttpRequests ( ( requests ) - > requests
. authorizeHttpRequests ( ( autho riz e) - > autho riz e
. anyRequest ( ) . hasAnyAuthority ( "ROLE_USER" )
)
. build ( ) ;
@ -918,7 +918,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
@@ -918,7 +918,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
// @formatter:off
return http
. httpBasic ( withDefaults ( ) )
. authorizeHttpRequests ( ( requests ) - > requests
. authorizeHttpRequests ( ( autho riz e) - > autho riz e
. anyRequest ( ) . hasAuthority ( "ROLE_USER" )
)
. build ( ) ;
@ -936,7 +936,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
@@ -936,7 +936,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
// @formatter:off
return http
. httpBasic ( withDefaults ( ) )
. authorizeHttpRequests ( ( requests ) - > requests
. authorizeHttpRequests ( ( autho riz e) - > autho riz e
. anyRequest ( ) . hasAnyAuthority ( "ROLE_USER" , "ROLE_ADMIN" )
)
. build ( ) ;
@ -953,7 +953,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
@@ -953,7 +953,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
SecurityFilterChain filterChain ( HttpSecurity http ) throws Exception {
// @formatter:off
return http
. authorizeHttpRequests ( ( requests ) - > requests
. authorizeHttpRequests ( ( autho riz e) - > autho riz e
. anyRequest ( ) . hasRole ( "USER" )
)
. build ( ) ;
@ -970,7 +970,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
@@ -970,7 +970,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
SecurityFilterChain filterChain ( HttpSecurity http ) throws Exception {
// @formatter:off
return http
. authorizeHttpRequests ( ( requests ) - > requests
. authorizeHttpRequests ( ( autho riz e) - > autho riz e
. anyRequest ( ) . hasRole ( "USER" )
)
. build ( ) ;
@ -994,7 +994,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
@@ -994,7 +994,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
SecurityFilterChain filterChain ( HttpSecurity http ) throws Exception {
// @formatter:off
return http
. authorizeHttpRequests ( ( requests ) - > requests
. authorizeHttpRequests ( ( autho riz e) - > autho riz e
. anyRequest ( ) . hasAnyRole ( "USER" , "ADMIN" )
)
. build ( ) ;
@ -1012,7 +1012,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
@@ -1012,7 +1012,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
// @formatter:off
return http
. httpBasic ( withDefaults ( ) )
. authorizeHttpRequests ( ( requests ) - > requests
. authorizeHttpRequests ( ( autho riz e) - > autho riz e
. anyRequest ( ) . denyAll ( )
)
. build ( ) ;
@ -1029,7 +1029,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
@@ -1029,7 +1029,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
SecurityFilterChain filterChain ( HttpSecurity http ) throws Exception {
// @formatter:off
return http
. authorizeHttpRequests ( ( requests ) - > requests
. authorizeHttpRequests ( ( autho riz e) - > autho riz e
. anyRequest ( ) . permitAll ( )
)
. build ( ) ;
@ -1047,7 +1047,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
@@ -1047,7 +1047,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
// @formatter:off
return http
. httpBasic ( withDefaults ( ) )
. authorizeHttpRequests ( ( requests ) - > requests
. authorizeHttpRequests ( ( autho riz e) - > autho riz e
. anyRequest ( ) . authenticated ( )
)
. authorizeHttpRequests ( withDefaults ( ) )
@ -1068,7 +1068,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
@@ -1068,7 +1068,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
. servletPath ( "/spring" ) ;
// @formatter:off
return http
. authorizeHttpRequests ( ( requests ) - > requests
. authorizeHttpRequests ( ( autho riz e) - > autho riz e
. requestMatchers ( mvcMatcherBuilder . pattern ( "/" ) ) . hasRole ( "ADMIN" )
)
. build ( ) ;
@ -1086,7 +1086,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
@@ -1086,7 +1086,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
// @formatter:off
return http
. httpBasic ( withDefaults ( ) )
. authorizeHttpRequests ( ( requests ) - > requests
. authorizeHttpRequests ( ( autho riz e) - > autho riz e
. anyRequest ( ) . authenticated ( )
)
. build ( ) ;
@ -1109,7 +1109,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
@@ -1109,7 +1109,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
SecurityFilterChain filterChain ( HttpSecurity http ) throws Exception {
// @formatter:off
return http
. authorizeHttpRequests ( ( requests ) - > requests
. authorizeHttpRequests ( ( autho riz e) - > autho riz e
. anyRequest ( ) . access ( new WebExpressionAuthorizationManager ( "hasRole('USER')" ) )
)
. build ( ) ;
@ -1126,7 +1126,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
@@ -1126,7 +1126,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
SecurityFilterChain filterChain ( HttpSecurity http ) throws Exception {
// @formatter:off
return http
. authorizeHttpRequests ( ( requests ) - > requests
. authorizeHttpRequests ( ( autho riz e) - > autho riz e
. anyRequest ( ) . access ( new WebExpressionAuthorizationManager ( "hasRole('USER') or hasRole('ADMIN')" ) )
)
. build ( ) ;
@ -1143,7 +1143,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
@@ -1143,7 +1143,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
SecurityFilterChain filterChain ( HttpSecurity http ) throws Exception {
// @formatter:off
return http
. authorizeHttpRequests ( ( requests ) - > requests
. authorizeHttpRequests ( ( autho riz e) - > autho riz e
. anyRequest ( ) . access ( new WebExpressionAuthorizationManager ( "hasIpAddress('127.0.0.1')" ) )
)
. build ( ) ;
@ -1162,7 +1162,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
@@ -1162,7 +1162,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
// @formatter:off
http
. httpBasic ( withDefaults ( ) )
. authorizeHttpRequests ( ( requests ) - > requests
. authorizeHttpRequests ( ( autho riz e) - > autho riz e
. requestMatchers ( "/user/{username}" ) . access ( new WebExpressionAuthorizationManager ( "#username == 'user'" ) )
. requestMatchers ( "/v2/user/{username}" ) . hasVariable ( "username" ) . equalTo ( Authentication : : getName )
) ;
@ -1197,7 +1197,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
@@ -1197,7 +1197,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
http
. httpBasic ( withDefaults ( ) )
. rememberMe ( withDefaults ( ) )
. authorizeHttpRequests ( ( requests ) - > requests
. authorizeHttpRequests ( ( autho riz e) - > autho riz e
. anyRequest ( ) . fullyAuthenticated ( )
) ;
// @formatter:on
@ -1221,7 +1221,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
@@ -1221,7 +1221,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
http
. httpBasic ( withDefaults ( ) )
. rememberMe ( withDefaults ( ) )
. authorizeHttpRequests ( ( requests ) - > requests
. authorizeHttpRequests ( ( autho riz e) - > autho riz e
. anyRequest ( ) . rememberMe ( )
) ;
// @formatter:on
@ -1244,7 +1244,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
@@ -1244,7 +1244,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
// @formatter:off
http
. httpBasic ( withDefaults ( ) )
. authorizeHttpRequests ( ( requests ) - > requests
. authorizeHttpRequests ( ( autho riz e) - > autho riz e
. anyRequest ( ) . anonymous ( )
) ;
// @formatter:on
@ -1262,7 +1262,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
@@ -1262,7 +1262,7 @@ public class AuthorizeHttpRequestsConfigurerTests {
// @formatter:off
http
. httpBasic ( withDefaults ( ) )
. authorizeHttpRequests ( ( requests ) - > requests
. authorizeHttpRequests ( ( autho riz e) - > autho riz e
. anyRequest ( ) . not ( ) . authenticated ( )
) ;
// @formatter:on