mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-06-24 13:02:13 +00:00
Format authorizeHttpRequests Blocks
This commit formats authorizeHttpRequests blocks to use the same parameter name and places the reference on the same line as the parameter. Issue gh-13067
This commit is contained in:
parent
cf6b52d6f7
commit
777447e1d9
@ -125,8 +125,7 @@ import org.springframework.web.servlet.handler.HandlerMappingIntrospector;
|
||||
* @Bean
|
||||
* public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
|
||||
* http
|
||||
* .authorizeHttpRequests((authorizeHttpRequests) ->
|
||||
* authorizeHttpRequests
|
||||
* .authorizeHttpRequests((authorize) -> authorize
|
||||
* .requestMatchers("/**").hasRole("USER")
|
||||
* )
|
||||
* .formLogin(withDefaults());
|
||||
@ -785,8 +784,7 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
||||
* @Bean
|
||||
* public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
|
||||
* http
|
||||
* .authorizeHttpRequests((authorizeHttpRequests) ->
|
||||
* authorizeHttpRequests
|
||||
* .authorizeHttpRequests((authorize) -> authorize
|
||||
* .requestMatchers("/**").hasRole("USER")
|
||||
* )
|
||||
* .formLogin(withDefaults());
|
||||
@ -822,8 +820,7 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
||||
* @Bean
|
||||
* public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
|
||||
* http
|
||||
* .authorizeHttpRequests((authorizeHttpRequests) ->
|
||||
* authorizeHttpRequests
|
||||
* .authorizeHttpRequests((authorize) -> authorize
|
||||
* .requestMatchers("/admin/**").hasRole("ADMIN")
|
||||
* .requestMatchers("/**").hasRole("USER")
|
||||
* )
|
||||
@ -860,8 +857,7 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
||||
* @Bean
|
||||
* public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
|
||||
* http
|
||||
* .authorizeHttpRequests((authorizeHttpRequests) ->
|
||||
* authorizeHttpRequests
|
||||
* .authorizeHttpRequests((authorize) -> authorize
|
||||
* .requestMatchers("/**").hasRole("USER")
|
||||
* .requestMatchers("/admin/**").hasRole("ADMIN")
|
||||
* );
|
||||
|
@ -78,7 +78,7 @@ public class DeferHttpSessionJavaConfigTests {
|
||||
DefaultSecurityFilterChain springSecurity(HttpSecurity http) throws Exception {
|
||||
// @formatter:off
|
||||
http
|
||||
.authorizeHttpRequests((requests) -> requests
|
||||
.authorizeHttpRequests((authorize) -> authorize
|
||||
.anyRequest().permitAll()
|
||||
)
|
||||
.sessionManagement((sessions) -> sessions
|
||||
|
@ -524,7 +524,7 @@ public class HttpSecurityConfigurationTests {
|
||||
SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
||||
// @formatter:off
|
||||
return http
|
||||
.authorizeHttpRequests((requests) -> requests
|
||||
.authorizeHttpRequests((authorize) -> authorize
|
||||
.anyRequest().authenticated()
|
||||
)
|
||||
.authorizeRequests((requests) -> requests
|
||||
@ -547,7 +547,7 @@ public class HttpSecurityConfigurationTests {
|
||||
.authorizeRequests((requests) -> requests
|
||||
.anyRequest().authenticated()
|
||||
)
|
||||
.authorizeHttpRequests((requests) -> requests
|
||||
.authorizeHttpRequests((authorize) -> authorize
|
||||
.anyRequest().authenticated()
|
||||
)
|
||||
.build();
|
||||
@ -634,7 +634,7 @@ public class HttpSecurityConfigurationTests {
|
||||
SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
||||
// @formatter:off
|
||||
http
|
||||
.authorizeHttpRequests((requests) -> requests
|
||||
.authorizeHttpRequests((authorize) -> authorize
|
||||
.anyRequest().authenticated()
|
||||
);
|
||||
// @formatter:on
|
||||
|
@ -912,7 +912,7 @@ public class WebSecurityConfigurationTests {
|
||||
// @formatter:off
|
||||
http
|
||||
.securityMatchers((requests) -> requests.requestMatchers(PathPatternRequestMatcher.withDefaults().matcher("/user")))
|
||||
.authorizeHttpRequests((requests) -> requests.anyRequest().hasRole("USER"));
|
||||
.authorizeHttpRequests((authorize) -> authorize.anyRequest().hasRole("USER"));
|
||||
// @formatter:on
|
||||
return http.build();
|
||||
}
|
||||
@ -923,7 +923,7 @@ public class WebSecurityConfigurationTests {
|
||||
// @formatter:off
|
||||
http
|
||||
.securityMatchers((requests) -> requests.requestMatchers(PathPatternRequestMatcher.withDefaults().matcher("/admin")))
|
||||
.authorizeHttpRequests((requests) -> requests.anyRequest().hasRole("ADMIN"));
|
||||
.authorizeHttpRequests((authorize) -> authorize.anyRequest().hasRole("ADMIN"));
|
||||
// @formatter:on
|
||||
return http.build();
|
||||
}
|
||||
@ -931,7 +931,7 @@ public class WebSecurityConfigurationTests {
|
||||
@Bean
|
||||
@Order(Ordered.LOWEST_PRECEDENCE)
|
||||
public SecurityFilterChain permitAll(HttpSecurity http) throws Exception {
|
||||
http.authorizeHttpRequests((requests) -> requests.anyRequest().permitAll());
|
||||
http.authorizeHttpRequests((authorize) -> authorize.anyRequest().permitAll());
|
||||
return http.build();
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -724,7 +724,7 @@ public class FormLoginConfigurerTests {
|
||||
SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
||||
// @formatter:off
|
||||
http
|
||||
.authorizeHttpRequests((requests) -> requests
|
||||
.authorizeHttpRequests((authorize) -> authorize
|
||||
.anyRequest().authenticated()
|
||||
)
|
||||
.formLogin(withDefaults())
|
||||
|
@ -87,7 +87,7 @@ public class HttpSecurityObservationTests {
|
||||
|
||||
@Bean
|
||||
SecurityFilterChain app(HttpSecurity http) throws Exception {
|
||||
http.httpBasic(withDefaults()).authorizeHttpRequests((requests) -> requests.anyRequest().authenticated());
|
||||
http.httpBasic(withDefaults()).authorizeHttpRequests((authorize) -> authorize.anyRequest().authenticated());
|
||||
return http.build();
|
||||
}
|
||||
|
||||
|
@ -123,7 +123,7 @@ public class HttpSecuritySecurityMatchersNoMvcTests {
|
||||
http
|
||||
.securityMatcher("/path")
|
||||
.httpBasic(withDefaults())
|
||||
.authorizeHttpRequests((requests) -> requests
|
||||
.authorizeHttpRequests((authorize) -> authorize
|
||||
.anyRequest().denyAll());
|
||||
// @formatter:on
|
||||
return http.build();
|
||||
|
@ -226,7 +226,7 @@ public class HttpSecuritySecurityMatchersTests {
|
||||
.requestMatchers("/test-1")
|
||||
.requestMatchers("/test-2")
|
||||
.requestMatchers("/test-3"))
|
||||
.authorizeHttpRequests((requests) -> requests
|
||||
.authorizeHttpRequests((authorize) -> authorize
|
||||
.anyRequest().denyAll())
|
||||
.httpBasic(withDefaults());
|
||||
// @formatter:on
|
||||
@ -239,7 +239,7 @@ public class HttpSecuritySecurityMatchersTests {
|
||||
http
|
||||
.securityMatchers((security) -> security
|
||||
.requestMatchers("/test-1"))
|
||||
.authorizeHttpRequests((requests) -> requests
|
||||
.authorizeHttpRequests((authorize) -> authorize
|
||||
.anyRequest().permitAll());
|
||||
// @formatter:on
|
||||
return http.build();
|
||||
@ -269,7 +269,7 @@ public class HttpSecuritySecurityMatchersTests {
|
||||
http
|
||||
.securityMatcher("/path")
|
||||
.httpBasic(withDefaults())
|
||||
.authorizeHttpRequests((requests) -> requests
|
||||
.authorizeHttpRequests((authorize) -> authorize
|
||||
.anyRequest().denyAll());
|
||||
// @formatter:on
|
||||
return http.build();
|
||||
@ -299,7 +299,7 @@ public class HttpSecuritySecurityMatchersTests {
|
||||
http
|
||||
.securityMatcher("/path")
|
||||
.httpBasic(withDefaults())
|
||||
.authorizeHttpRequests((requests) -> requests
|
||||
.authorizeHttpRequests((authorize) -> authorize
|
||||
.anyRequest().denyAll());
|
||||
// @formatter:on
|
||||
return http.build();
|
||||
@ -366,7 +366,7 @@ public class HttpSecuritySecurityMatchersTests {
|
||||
.requestMatchers(mvcMatcherBuilder.pattern("/never-match"))
|
||||
)
|
||||
.httpBasic(withDefaults())
|
||||
.authorizeHttpRequests((requests) -> requests
|
||||
.authorizeHttpRequests((authorize) -> authorize
|
||||
.anyRequest().denyAll());
|
||||
// @formatter:on
|
||||
return http.build();
|
||||
|
@ -350,7 +350,7 @@ public class NamespaceRememberMeTests {
|
||||
// @formatter:off
|
||||
http
|
||||
.securityMatcher(new AntPathRequestMatcher("/without-key/**"))
|
||||
.authorizeHttpRequests((requests) -> requests.anyRequest().authenticated())
|
||||
.authorizeHttpRequests((authorize) -> authorize.anyRequest().authenticated())
|
||||
.formLogin((login) -> login
|
||||
.loginProcessingUrl("/without-key/login"))
|
||||
.rememberMe(withDefaults());
|
||||
|
@ -119,7 +119,7 @@ public class PermitAllSupportTests {
|
||||
SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
||||
// @formatter:off
|
||||
http
|
||||
.authorizeHttpRequests((requests) -> requests
|
||||
.authorizeHttpRequests((authorize) -> authorize
|
||||
.anyRequest().authenticated())
|
||||
.formLogin((login) -> login
|
||||
.loginPage("/xyz").permitAll()
|
||||
@ -140,7 +140,7 @@ public class PermitAllSupportTests {
|
||||
http
|
||||
.authorizeRequests((requests) -> requests
|
||||
.anyRequest().authenticated())
|
||||
.authorizeHttpRequests((requests) -> requests
|
||||
.authorizeHttpRequests((authorize) -> authorize
|
||||
.anyRequest().authenticated())
|
||||
.formLogin((login) -> login
|
||||
.loginPage("/xyz").permitAll()
|
||||
|
@ -393,7 +393,7 @@ public class RequestCacheConfigurerTests {
|
||||
SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
||||
// @formatter:off
|
||||
http
|
||||
.authorizeHttpRequests((requests) -> requests
|
||||
.authorizeHttpRequests((authorize) -> authorize
|
||||
.anyRequest().authenticated()
|
||||
)
|
||||
.formLogin(Customizer.withDefaults())
|
||||
|
@ -253,7 +253,7 @@ public class ServletApiConfigurerTests {
|
||||
SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
||||
// @formatter:off
|
||||
http
|
||||
.authorizeHttpRequests((requests) -> requests
|
||||
.authorizeHttpRequests((authorize) -> authorize
|
||||
.anyRequest().authenticated()
|
||||
)
|
||||
.httpBasic(Customizer.withDefaults())
|
||||
|
@ -1340,8 +1340,7 @@ public class OAuth2LoginConfigurerTests {
|
||||
SecurityFilterChain configureFilterChain(HttpSecurity http) throws Exception {
|
||||
// @formatter:off
|
||||
http
|
||||
.authorizeHttpRequests((authorizeRequests) ->
|
||||
authorizeRequests
|
||||
.authorizeHttpRequests((authorize) -> authorize
|
||||
.anyRequest().authenticated()
|
||||
)
|
||||
.securityContext((securityContext) ->
|
||||
|
@ -240,8 +240,7 @@ public class DPoPAuthenticationConfigurerTests {
|
||||
SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
|
||||
// @formatter:off
|
||||
http
|
||||
.authorizeHttpRequests((authorize) ->
|
||||
authorize
|
||||
.authorizeHttpRequests((authorize) -> authorize
|
||||
.requestMatchers("/resource1").hasAnyAuthority("SCOPE_resource1.read", "SCOPE_resource1.write")
|
||||
.requestMatchers("/resource2").hasAnyAuthority("SCOPE_resource2.read", "SCOPE_resource2.write")
|
||||
.anyRequest().authenticated()
|
||||
|
@ -242,7 +242,7 @@ public class OneTimeTokenLoginConfigurerTests {
|
||||
|
||||
// @formatter:off
|
||||
http
|
||||
.authorizeHttpRequests((authz) -> authz
|
||||
.authorizeHttpRequests((authorize) -> authorize
|
||||
.anyRequest().authenticated()
|
||||
)
|
||||
.oneTimeTokenLogin((ott) -> ott
|
||||
@ -281,7 +281,7 @@ public class OneTimeTokenLoginConfigurerTests {
|
||||
OneTimeTokenGenerationSuccessHandler ottSuccessHandler) throws Exception {
|
||||
// @formatter:off
|
||||
http
|
||||
.authorizeHttpRequests((authz) -> authz
|
||||
.authorizeHttpRequests((authorize) -> authorize
|
||||
.anyRequest().authenticated()
|
||||
)
|
||||
.oneTimeTokenLogin((ott) -> ott
|
||||
@ -308,7 +308,7 @@ public class OneTimeTokenLoginConfigurerTests {
|
||||
OneTimeTokenGenerationSuccessHandler ottSuccessHandler) throws Exception {
|
||||
// @formatter:off
|
||||
http
|
||||
.authorizeHttpRequests((authz) -> authz
|
||||
.authorizeHttpRequests((authorize) -> authorize
|
||||
.anyRequest().authenticated()
|
||||
)
|
||||
.oneTimeTokenLogin((ott) -> ott
|
||||
@ -336,7 +336,7 @@ public class OneTimeTokenLoginConfigurerTests {
|
||||
OneTimeTokenGenerationSuccessHandler ottSuccessHandler) throws Exception {
|
||||
// @formatter:off
|
||||
http
|
||||
.authorizeHttpRequests((authz) -> authz
|
||||
.authorizeHttpRequests((authorize) -> authorize
|
||||
.anyRequest().authenticated()
|
||||
)
|
||||
.oneTimeTokenLogin((ott) -> ott
|
||||
@ -365,7 +365,7 @@ public class OneTimeTokenLoginConfigurerTests {
|
||||
SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
|
||||
// @formatter:off
|
||||
http
|
||||
.authorizeHttpRequests((authz) -> authz
|
||||
.authorizeHttpRequests((authorize) -> authorize
|
||||
.anyRequest().authenticated()
|
||||
)
|
||||
.oneTimeTokenLogin(Customizer.withDefaults());
|
||||
|
@ -630,7 +630,7 @@ public class Saml2LoginConfigurerTests {
|
||||
|
||||
@Bean
|
||||
SecurityFilterChain app(HttpSecurity http) throws Exception {
|
||||
http.authorizeHttpRequests((authz) -> authz.anyRequest().authenticated())
|
||||
http.authorizeHttpRequests((authorize) -> authorize.anyRequest().authenticated())
|
||||
.saml2Login(Customizer.withDefaults());
|
||||
return http.build();
|
||||
}
|
||||
@ -715,7 +715,7 @@ public class Saml2LoginConfigurerTests {
|
||||
SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
|
||||
// @formatter:off
|
||||
http
|
||||
.authorizeHttpRequests((authz) -> authz.anyRequest().authenticated())
|
||||
.authorizeHttpRequests((authorize) -> authorize.anyRequest().authenticated())
|
||||
.saml2Login((saml2) -> saml2.authenticationRequestUriQuery("/custom/auth/sso?entityId={registrationId}"));
|
||||
// @formatter:on
|
||||
return http.build();
|
||||
|
@ -148,7 +148,7 @@ public class SecurityConfig {
|
||||
);
|
||||
|
||||
http
|
||||
.authorizeHttpRequests((authz) -> authz
|
||||
.authorizeHttpRequests((authorize) -> authorize
|
||||
.anyRequest().authenticated()
|
||||
)
|
||||
.saml2Login((saml2) -> saml2
|
||||
@ -211,7 +211,7 @@ public class SecurityConfig {
|
||||
.clockSkew(Duration.ofMinutes(10)).build();
|
||||
authenticationProvider.setAssertionValidator(assertionValidator);
|
||||
http
|
||||
.authorizeHttpRequests((authz) -> authz
|
||||
.authorizeHttpRequests((authorize) -> authorize
|
||||
.anyRequest().authenticated()
|
||||
)
|
||||
.saml2Login((saml2) -> saml2
|
||||
@ -274,7 +274,7 @@ public class SecurityConfig {
|
||||
authenticationProvider.setResponseAuthenticationConverter(this.authenticationConverter);
|
||||
|
||||
http
|
||||
.authorizeHttpRequests((authz) -> authz
|
||||
.authorizeHttpRequests((authorize) -> authorize
|
||||
.anyRequest().authenticated())
|
||||
.saml2Login((saml2) -> saml2
|
||||
.authenticationManager(new ProviderManager(authenticationProvider))
|
||||
@ -409,7 +409,7 @@ public class SecurityConfig {
|
||||
});
|
||||
|
||||
http
|
||||
.authorizeHttpRequests((authz) -> authz
|
||||
.authorizeHttpRequests((authorize) -> authorize
|
||||
.anyRequest().authenticated()
|
||||
)
|
||||
.saml2Login((saml2) -> saml2
|
||||
|
@ -104,7 +104,7 @@ public class AuthenticationTests {
|
||||
DefaultSecurityFilterChain springSecurity(HttpSecurity http) throws Exception {
|
||||
// @formatter:off
|
||||
http
|
||||
.authorizeHttpRequests((requests) -> requests
|
||||
.authorizeHttpRequests((authorize) -> authorize
|
||||
.anyRequest().authenticated()
|
||||
)
|
||||
.sessionManagement((sessions) -> sessions
|
||||
|
Loading…
x
Reference in New Issue
Block a user