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