From ca32d8e45dc48edcedf1cecf6e70e43022acd4dd Mon Sep 17 00:00:00 2001 From: Josh Cummings Date: Wed, 10 Nov 2021 10:20:09 -0700 Subject: [PATCH] Update authorizeHttpRequests Closes gh-49 --- .../preauth/src/main/java/example/SecurityConfiguration.java | 2 +- .../x509/src/main/java/example/SecurityConfiguration.java | 2 +- .../src/main/java/example/SecurityConfiguration.java | 2 +- .../src/main/java/example/SecurityConfiguration.java | 2 +- .../src/main/java/example/SecurityConfiguration.java | 2 +- .../login/src/main/java/example/SecurityConfiguration.java | 2 +- .../src/main/java/example/SecurityConfiguration.java | 2 +- .../java/jwt/login/src/main/java/example/RestConfig.java | 2 +- .../example/OAuth2AuthorizationServerSecurityConfiguration.java | 2 +- .../src/integTest/java/example/OAuth2LoginApplicationTests.java | 2 +- .../java/example/OAuth2ResourceServerSecurityConfiguration.java | 2 +- .../java/example/OAuth2ResourceServerSecurityConfiguration.java | 2 +- .../java/example/OAuth2ResourceServerSecurityConfiguration.java | 2 +- .../java/example/OAuth2ResourceServerSecurityConfiguration.java | 2 +- .../java/example/OAuth2ResourceServerSecurityConfiguration.java | 2 +- .../webclient/src/main/java/example/SecurityConfiguration.java | 2 +- .../src/main/java/example/SecurityConfiguration.java | 2 +- .../login/src/main/java/example/SecurityConfiguration.java | 2 +- .../src/main/java/example/SecurityConfiguration.java | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-) diff --git a/servlet/java-configuration/authentication/preauth/src/main/java/example/SecurityConfiguration.java b/servlet/java-configuration/authentication/preauth/src/main/java/example/SecurityConfiguration.java index 0657feb..72b2b24 100644 --- a/servlet/java-configuration/authentication/preauth/src/main/java/example/SecurityConfiguration.java +++ b/servlet/java-configuration/authentication/preauth/src/main/java/example/SecurityConfiguration.java @@ -31,7 +31,7 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Exception { http - .authorizeRequests((authorize) -> authorize + .authorizeHttpRequests((authorize) -> authorize .antMatchers("/login", "/resources/**").permitAll() .anyRequest().authenticated() ) diff --git a/servlet/java-configuration/authentication/x509/src/main/java/example/SecurityConfiguration.java b/servlet/java-configuration/authentication/x509/src/main/java/example/SecurityConfiguration.java index 30e993e..11554d6 100644 --- a/servlet/java-configuration/authentication/x509/src/main/java/example/SecurityConfiguration.java +++ b/servlet/java-configuration/authentication/x509/src/main/java/example/SecurityConfiguration.java @@ -33,7 +33,7 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter { // @formatter:off protected void configure(HttpSecurity http) throws Exception { http - .authorizeRequests((authorize) -> authorize + .authorizeHttpRequests((authorize) -> authorize .anyRequest().authenticated() ) .x509(withDefaults()); diff --git a/servlet/java-configuration/hello-mvc-security/src/main/java/example/SecurityConfiguration.java b/servlet/java-configuration/hello-mvc-security/src/main/java/example/SecurityConfiguration.java index e96b4c5..039e3fb 100644 --- a/servlet/java-configuration/hello-mvc-security/src/main/java/example/SecurityConfiguration.java +++ b/servlet/java-configuration/hello-mvc-security/src/main/java/example/SecurityConfiguration.java @@ -33,7 +33,7 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter { // @formatter:off protected void configure(HttpSecurity http) throws Exception { http - .authorizeRequests((authorize) -> authorize + .authorizeHttpRequests((authorize) -> authorize .anyRequest().authenticated() ) .httpBasic(withDefaults()) diff --git a/servlet/java-configuration/hello-security-explicit/src/main/java/example/SecurityConfiguration.java b/servlet/java-configuration/hello-security-explicit/src/main/java/example/SecurityConfiguration.java index e96b4c5..039e3fb 100644 --- a/servlet/java-configuration/hello-security-explicit/src/main/java/example/SecurityConfiguration.java +++ b/servlet/java-configuration/hello-security-explicit/src/main/java/example/SecurityConfiguration.java @@ -33,7 +33,7 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter { // @formatter:off protected void configure(HttpSecurity http) throws Exception { http - .authorizeRequests((authorize) -> authorize + .authorizeHttpRequests((authorize) -> authorize .anyRequest().authenticated() ) .httpBasic(withDefaults()) diff --git a/servlet/java-configuration/max-sessions/src/main/java/example/SecurityConfiguration.java b/servlet/java-configuration/max-sessions/src/main/java/example/SecurityConfiguration.java index 3e54c4e..e8e41ad 100644 --- a/servlet/java-configuration/max-sessions/src/main/java/example/SecurityConfiguration.java +++ b/servlet/java-configuration/max-sessions/src/main/java/example/SecurityConfiguration.java @@ -48,7 +48,7 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Exception { http - .authorizeRequests((authorize) -> authorize + .authorizeHttpRequests((authorize) -> authorize .anyRequest().authenticated() ) .formLogin(withDefaults()) diff --git a/servlet/java-configuration/saml2/login/src/main/java/example/SecurityConfiguration.java b/servlet/java-configuration/saml2/login/src/main/java/example/SecurityConfiguration.java index 50daa56..ab2311c 100644 --- a/servlet/java-configuration/saml2/login/src/main/java/example/SecurityConfiguration.java +++ b/servlet/java-configuration/saml2/login/src/main/java/example/SecurityConfiguration.java @@ -44,7 +44,7 @@ public class SecurityConfiguration { SecurityFilterChain app(HttpSecurity http) throws Exception { // @formatter:off http - .authorizeRequests((authorize) -> authorize + .authorizeHttpRequests((authorize) -> authorize .anyRequest().authenticated() ) .saml2Login(Customizer.withDefaults()) diff --git a/servlet/spring-boot/java/hello-security-explicit/src/main/java/example/SecurityConfiguration.java b/servlet/spring-boot/java/hello-security-explicit/src/main/java/example/SecurityConfiguration.java index 72515e8..d8c65b8 100644 --- a/servlet/spring-boot/java/hello-security-explicit/src/main/java/example/SecurityConfiguration.java +++ b/servlet/spring-boot/java/hello-security-explicit/src/main/java/example/SecurityConfiguration.java @@ -40,7 +40,7 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter { // @formatter:off protected void configure(HttpSecurity http) throws Exception { http - .authorizeRequests((authorize) -> authorize + .authorizeHttpRequests((authorize) -> authorize .anyRequest().authenticated() ) .httpBasic(withDefaults()) diff --git a/servlet/spring-boot/java/jwt/login/src/main/java/example/RestConfig.java b/servlet/spring-boot/java/jwt/login/src/main/java/example/RestConfig.java index cd5b74a..7f7de48 100644 --- a/servlet/spring-boot/java/jwt/login/src/main/java/example/RestConfig.java +++ b/servlet/spring-boot/java/jwt/login/src/main/java/example/RestConfig.java @@ -62,7 +62,7 @@ public class RestConfig extends WebSecurityConfigurerAdapter { protected void configure(HttpSecurity http) throws Exception { // @formatter:off http - .authorizeRequests((authorize) -> authorize + .authorizeHttpRequests((authorize) -> authorize .anyRequest().authenticated() ) .csrf((csrf) -> csrf.ignoringAntMatchers("/token")) diff --git a/servlet/spring-boot/java/oauth2/authorization-server/src/main/java/example/OAuth2AuthorizationServerSecurityConfiguration.java b/servlet/spring-boot/java/oauth2/authorization-server/src/main/java/example/OAuth2AuthorizationServerSecurityConfiguration.java index 82685eb..a914566 100644 --- a/servlet/spring-boot/java/oauth2/authorization-server/src/main/java/example/OAuth2AuthorizationServerSecurityConfiguration.java +++ b/servlet/spring-boot/java/oauth2/authorization-server/src/main/java/example/OAuth2AuthorizationServerSecurityConfiguration.java @@ -72,7 +72,7 @@ public class OAuth2AuthorizationServerSecurityConfiguration { public SecurityFilterChain standardSecurityFilterChain(HttpSecurity http) throws Exception { // @formatter:off http - .authorizeRequests((authorize) -> authorize + .authorizeHttpRequests((authorize) -> authorize .anyRequest().authenticated() ) .formLogin(Customizer.withDefaults()); diff --git a/servlet/spring-boot/java/oauth2/login/src/integTest/java/example/OAuth2LoginApplicationTests.java b/servlet/spring-boot/java/oauth2/login/src/integTest/java/example/OAuth2LoginApplicationTests.java index ace74c3..ddbfe89 100644 --- a/servlet/spring-boot/java/oauth2/login/src/integTest/java/example/OAuth2LoginApplicationTests.java +++ b/servlet/spring-boot/java/oauth2/login/src/integTest/java/example/OAuth2LoginApplicationTests.java @@ -334,7 +334,7 @@ public class OAuth2LoginApplicationTests { @Override protected void configure(HttpSecurity http) throws Exception { http - .authorizeRequests((authorize) -> authorize + .authorizeHttpRequests((authorize) -> authorize .anyRequest().authenticated() ) .oauth2Login((oauth2) -> oauth2 diff --git a/servlet/spring-boot/java/oauth2/resource-server/hello-security/src/main/java/example/OAuth2ResourceServerSecurityConfiguration.java b/servlet/spring-boot/java/oauth2/resource-server/hello-security/src/main/java/example/OAuth2ResourceServerSecurityConfiguration.java index b90d479..973752f 100644 --- a/servlet/spring-boot/java/oauth2/resource-server/hello-security/src/main/java/example/OAuth2ResourceServerSecurityConfiguration.java +++ b/servlet/spring-boot/java/oauth2/resource-server/hello-security/src/main/java/example/OAuth2ResourceServerSecurityConfiguration.java @@ -40,7 +40,7 @@ public class OAuth2ResourceServerSecurityConfiguration extends WebSecurityConfig protected void configure(HttpSecurity http) throws Exception { // @formatter:off http - .authorizeRequests((authorize) -> authorize + .authorizeHttpRequests((authorize) -> authorize .antMatchers(HttpMethod.GET, "/message/**").hasAuthority("SCOPE_message:read") .antMatchers(HttpMethod.POST, "/message/**").hasAuthority("SCOPE_message:write") .anyRequest().authenticated() diff --git a/servlet/spring-boot/java/oauth2/resource-server/jwe/src/main/java/example/OAuth2ResourceServerSecurityConfiguration.java b/servlet/spring-boot/java/oauth2/resource-server/jwe/src/main/java/example/OAuth2ResourceServerSecurityConfiguration.java index dc5d624..5ce1aa2 100644 --- a/servlet/spring-boot/java/oauth2/resource-server/jwe/src/main/java/example/OAuth2ResourceServerSecurityConfiguration.java +++ b/servlet/spring-boot/java/oauth2/resource-server/jwe/src/main/java/example/OAuth2ResourceServerSecurityConfiguration.java @@ -72,7 +72,7 @@ public class OAuth2ResourceServerSecurityConfiguration extends WebSecurityConfig protected void configure(HttpSecurity http) throws Exception { // @formatter:off http - .authorizeRequests((authorize) -> authorize + .authorizeHttpRequests((authorize) -> authorize .antMatchers("/message/**").hasAuthority("SCOPE_message:read") .anyRequest().authenticated() ) diff --git a/servlet/spring-boot/java/oauth2/resource-server/multi-tenancy/src/main/java/example/OAuth2ResourceServerSecurityConfiguration.java b/servlet/spring-boot/java/oauth2/resource-server/multi-tenancy/src/main/java/example/OAuth2ResourceServerSecurityConfiguration.java index a0c9b12..0841bdd 100644 --- a/servlet/spring-boot/java/oauth2/resource-server/multi-tenancy/src/main/java/example/OAuth2ResourceServerSecurityConfiguration.java +++ b/servlet/spring-boot/java/oauth2/resource-server/multi-tenancy/src/main/java/example/OAuth2ResourceServerSecurityConfiguration.java @@ -47,7 +47,7 @@ public class OAuth2ResourceServerSecurityConfiguration { AuthenticationManagerResolver authenticationManagerResolver) throws Exception { // @formatter:off http - .authorizeRequests((authorize) -> authorize + .authorizeHttpRequests((authorize) -> authorize .mvcMatchers("/**/message/**").hasAuthority("SCOPE_message:read") .anyRequest().authenticated() ) diff --git a/servlet/spring-boot/java/oauth2/resource-server/opaque/src/main/java/example/OAuth2ResourceServerSecurityConfiguration.java b/servlet/spring-boot/java/oauth2/resource-server/opaque/src/main/java/example/OAuth2ResourceServerSecurityConfiguration.java index 8d498f0..b3cee2f 100644 --- a/servlet/spring-boot/java/oauth2/resource-server/opaque/src/main/java/example/OAuth2ResourceServerSecurityConfiguration.java +++ b/servlet/spring-boot/java/oauth2/resource-server/opaque/src/main/java/example/OAuth2ResourceServerSecurityConfiguration.java @@ -42,7 +42,7 @@ public class OAuth2ResourceServerSecurityConfiguration extends WebSecurityConfig protected void configure(HttpSecurity http) throws Exception { // @formatter:off http - .authorizeRequests((authorize) -> authorize + .authorizeHttpRequests((authorize) -> authorize .mvcMatchers(HttpMethod.GET, "/message/**").hasAuthority("SCOPE_message:read") .mvcMatchers(HttpMethod.POST, "/message/**").hasAuthority("SCOPE_message:write") .anyRequest().authenticated() diff --git a/servlet/spring-boot/java/oauth2/resource-server/static/src/main/java/example/OAuth2ResourceServerSecurityConfiguration.java b/servlet/spring-boot/java/oauth2/resource-server/static/src/main/java/example/OAuth2ResourceServerSecurityConfiguration.java index bb7074d..bcaa99d 100644 --- a/servlet/spring-boot/java/oauth2/resource-server/static/src/main/java/example/OAuth2ResourceServerSecurityConfiguration.java +++ b/servlet/spring-boot/java/oauth2/resource-server/static/src/main/java/example/OAuth2ResourceServerSecurityConfiguration.java @@ -40,7 +40,7 @@ public class OAuth2ResourceServerSecurityConfiguration extends WebSecurityConfig protected void configure(HttpSecurity http) throws Exception { // @formatter:off http - .authorizeRequests((authorize) -> authorize + .authorizeHttpRequests((authorize) -> authorize .mvcMatchers("/message/**").hasAuthority("SCOPE_message:read") .anyRequest().authenticated() ) diff --git a/servlet/spring-boot/java/oauth2/webclient/src/main/java/example/SecurityConfiguration.java b/servlet/spring-boot/java/oauth2/webclient/src/main/java/example/SecurityConfiguration.java index c029fa3..238fc89 100644 --- a/servlet/spring-boot/java/oauth2/webclient/src/main/java/example/SecurityConfiguration.java +++ b/servlet/spring-boot/java/oauth2/webclient/src/main/java/example/SecurityConfiguration.java @@ -38,7 +38,7 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter { protected void configure(HttpSecurity http) throws Exception { // @formatter:off http - .authorizeRequests((authorize) -> authorize + .authorizeHttpRequests((authorize) -> authorize .mvcMatchers("/", "/public/**").permitAll() .anyRequest().authenticated() ) diff --git a/servlet/spring-boot/java/saml2/login-single-tenant/src/main/java/example/SecurityConfiguration.java b/servlet/spring-boot/java/saml2/login-single-tenant/src/main/java/example/SecurityConfiguration.java index e93a39e..7898c30 100644 --- a/servlet/spring-boot/java/saml2/login-single-tenant/src/main/java/example/SecurityConfiguration.java +++ b/servlet/spring-boot/java/saml2/login-single-tenant/src/main/java/example/SecurityConfiguration.java @@ -36,7 +36,7 @@ public class SecurityConfiguration { SecurityFilterChain app(HttpSecurity http) throws Exception { // @formatter:off http - .authorizeRequests((authorize) -> authorize + .authorizeHttpRequests((authorize) -> authorize .anyRequest().authenticated() ) .saml2Login((saml2) -> saml2.loginProcessingUrl("/login/saml2/sso")) diff --git a/servlet/spring-boot/java/saml2/login/src/main/java/example/SecurityConfiguration.java b/servlet/spring-boot/java/saml2/login/src/main/java/example/SecurityConfiguration.java index d69fb7d..1214b95 100644 --- a/servlet/spring-boot/java/saml2/login/src/main/java/example/SecurityConfiguration.java +++ b/servlet/spring-boot/java/saml2/login/src/main/java/example/SecurityConfiguration.java @@ -35,7 +35,7 @@ public class SecurityConfiguration { SecurityFilterChain app(HttpSecurity http) throws Exception { // @formatter:off http - .authorizeRequests((authorize) -> authorize + .authorizeHttpRequests((authorize) -> authorize .anyRequest().authenticated() ) .saml2Login(Customizer.withDefaults()) diff --git a/servlet/spring-boot/java/saml2/refreshable-metadata/src/main/java/example/SecurityConfiguration.java b/servlet/spring-boot/java/saml2/refreshable-metadata/src/main/java/example/SecurityConfiguration.java index dc3a840..1145289 100644 --- a/servlet/spring-boot/java/saml2/refreshable-metadata/src/main/java/example/SecurityConfiguration.java +++ b/servlet/spring-boot/java/saml2/refreshable-metadata/src/main/java/example/SecurityConfiguration.java @@ -30,7 +30,7 @@ public class SecurityConfiguration { SecurityFilterChain app(HttpSecurity http) throws Exception { // @formatter:off http - .authorizeRequests((authorize) -> authorize + .authorizeHttpRequests((authorize) -> authorize .anyRequest().authenticated() ) .saml2Login(withDefaults())