Use authorizeHttpRequests
Issue gh-15174
This commit is contained in:
+1
-1
@@ -133,7 +133,7 @@ public class Sec2935Tests {
|
||||
SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
||||
// @formatter:off
|
||||
http
|
||||
.authorizeRequests((requests) -> requests
|
||||
.authorizeHttpRequests((requests) -> requests
|
||||
.requestMatchers("/admin/**").hasRole("ADMIN")
|
||||
.anyRequest().authenticated())
|
||||
.httpBasic(withDefaults());
|
||||
|
||||
+1
-1
@@ -181,7 +181,7 @@ public class SecurityMockMvcRequestPostProcessorsOAuth2ClientTests {
|
||||
SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
||||
// @formatter:off
|
||||
http
|
||||
.authorizeRequests((authz) -> authz
|
||||
.authorizeHttpRequests((authz) -> authz
|
||||
.anyRequest().permitAll()
|
||||
)
|
||||
.oauth2Client(withDefaults());
|
||||
|
||||
+1
-1
@@ -158,7 +158,7 @@ public class SecurityMockMvcRequestPostProcessorsOAuth2LoginTests {
|
||||
SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
||||
// @formatter:off
|
||||
http
|
||||
.authorizeRequests((authorize) -> authorize
|
||||
.authorizeHttpRequests((authorize) -> authorize
|
||||
.requestMatchers("/admin/**").hasAuthority("SCOPE_admin")
|
||||
.anyRequest().hasAuthority("SCOPE_read")
|
||||
).oauth2Login(withDefaults());
|
||||
|
||||
+1
-1
@@ -156,7 +156,7 @@ public class SecurityMockMvcRequestPostProcessorsOidcLoginTests {
|
||||
SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
||||
// @formatter:off
|
||||
http
|
||||
.authorizeRequests((requests) -> requests
|
||||
.authorizeHttpRequests((requests) -> requests
|
||||
.requestMatchers("/admin/**").hasAuthority("SCOPE_admin")
|
||||
.anyRequest().hasAuthority("SCOPE_read"))
|
||||
.oauth2Login(withDefaults());
|
||||
|
||||
+1
-1
@@ -130,7 +130,7 @@ public class SecurityMockMvcRequestPostProcessorsOpaqueTokenTests {
|
||||
SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
||||
// @formatter:off
|
||||
http
|
||||
.authorizeRequests((requests) -> requests
|
||||
.authorizeHttpRequests((requests) -> requests
|
||||
.requestMatchers("/admin/**").hasAuthority("SCOPE_admin")
|
||||
.anyRequest().hasAuthority("SCOPE_read"))
|
||||
.oauth2ResourceServer((server) -> server
|
||||
|
||||
+1
-1
@@ -99,7 +99,7 @@ public class Gh3409Tests {
|
||||
SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
||||
// @formatter:off
|
||||
http
|
||||
.authorizeRequests((requests) -> requests
|
||||
.authorizeHttpRequests((requests) -> requests
|
||||
.requestMatchers("/public/**").permitAll()
|
||||
.anyRequest().authenticated())
|
||||
.formLogin(withDefaults())
|
||||
|
||||
+1
-1
@@ -99,7 +99,7 @@ public class CustomConfigAuthenticationTests {
|
||||
SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
||||
// @formatter:off
|
||||
http
|
||||
.authorizeRequests((requests) -> requests
|
||||
.authorizeHttpRequests((requests) -> requests
|
||||
.anyRequest().authenticated())
|
||||
.securityContext((context) -> context
|
||||
.securityContextRepository(securityContextRepository()))
|
||||
|
||||
+1
-1
@@ -90,7 +90,7 @@ public class CustomLoginRequestBuilderAuthenticationTests {
|
||||
SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
||||
// @formatter:off
|
||||
http
|
||||
.authorizeRequests((requests) -> requests
|
||||
.authorizeHttpRequests((requests) -> requests
|
||||
.anyRequest().authenticated())
|
||||
.formLogin((login) -> login
|
||||
.usernameParameter("user")
|
||||
|
||||
+1
-1
@@ -98,7 +98,7 @@ public class DefaultfSecurityRequestsTests {
|
||||
SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
||||
// @formatter:off
|
||||
http
|
||||
.authorizeRequests((requests) -> requests
|
||||
.authorizeHttpRequests((requests) -> requests
|
||||
.requestMatchers("/admin/**").hasRole("ADMIN")
|
||||
.anyRequest().authenticated())
|
||||
.httpBasic(withDefaults());
|
||||
|
||||
+1
-1
@@ -113,7 +113,7 @@ public class SecurityRequestsTests {
|
||||
SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
||||
// @formatter:off
|
||||
http
|
||||
.authorizeRequests((requests) -> requests
|
||||
.authorizeHttpRequests((requests) -> requests
|
||||
.requestMatchers("/admin/**").hasRole("ADMIN")
|
||||
.anyRequest().authenticated())
|
||||
.formLogin(withDefaults());
|
||||
|
||||
+1
-1
@@ -98,7 +98,7 @@ public class WithUserAuthenticationTests {
|
||||
SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
||||
// @formatter:off
|
||||
http
|
||||
.authorizeRequests((requests) -> requests
|
||||
.authorizeHttpRequests((requests) -> requests
|
||||
.requestMatchers("/admin/**").hasRole("ADMIN")
|
||||
.anyRequest().authenticated())
|
||||
.formLogin(withDefaults());
|
||||
|
||||
+1
-1
@@ -97,7 +97,7 @@ public class WithUserClassLevelAuthenticationTests {
|
||||
SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
||||
// @formatter:off
|
||||
http
|
||||
.authorizeRequests((requests) -> requests
|
||||
.authorizeHttpRequests((requests) -> requests
|
||||
.requestMatchers("/admin/**").hasRole("ADMIN")
|
||||
.anyRequest().authenticated())
|
||||
.httpBasic(withDefaults());
|
||||
|
||||
+1
-1
@@ -88,7 +88,7 @@ public class WithUserDetailsAuthenticationTests {
|
||||
SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
||||
// @formatter:off
|
||||
http
|
||||
.authorizeRequests((requests) -> requests
|
||||
.authorizeHttpRequests((requests) -> requests
|
||||
.requestMatchers("/admin/**").hasRole("ADMIN")
|
||||
.anyRequest().authenticated())
|
||||
.formLogin(withDefaults());
|
||||
|
||||
+1
-1
@@ -87,7 +87,7 @@ public class WithUserDetailsClassLevelAuthenticationTests {
|
||||
SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
||||
// @formatter:off
|
||||
http
|
||||
.authorizeRequests((requests) -> requests
|
||||
.authorizeHttpRequests((requests) -> requests
|
||||
.requestMatchers("/admin/**").hasRole("ADMIN")
|
||||
.anyRequest().authenticated())
|
||||
.formLogin(withDefaults());
|
||||
|
||||
Reference in New Issue
Block a user