From a92d64cb804742f61ac9a7b4ff4ce0c539ba53a5 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Wed, 24 Jun 2020 11:07:14 +0100 Subject: [PATCH] Start building against Spring Security 5.4.0-M2 snapshots See gh-21932 --- .../ReactiveOAuth2ResourceServerAutoConfigurationTests.java | 5 +++-- .../servlet/OAuth2ResourceServerAutoConfigurationTests.java | 6 ++++-- spring-boot-project/spring-boot-dependencies/build.gradle | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/reactive/ReactiveOAuth2ResourceServerAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/reactive/ReactiveOAuth2ResourceServerAutoConfigurationTests.java index cf25c54444..7f7186f090 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/reactive/ReactiveOAuth2ResourceServerAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/reactive/ReactiveOAuth2ResourceServerAutoConfigurationTests.java @@ -47,6 +47,7 @@ import org.springframework.security.config.web.server.ServerHttpSecurity; import org.springframework.security.core.userdetails.MapReactiveUserDetailsService; import org.springframework.security.oauth2.core.DelegatingOAuth2TokenValidator; import org.springframework.security.oauth2.core.OAuth2TokenValidator; +import org.springframework.security.oauth2.jose.jws.SignatureAlgorithm; import org.springframework.security.oauth2.jwt.Jwt; import org.springframework.security.oauth2.jwt.JwtIssuerValidator; import org.springframework.security.oauth2.jwt.NimbusReactiveJwtDecoder; @@ -105,8 +106,8 @@ class ReactiveOAuth2ResourceServerAutoConfigurationTests { "spring.security.oauth2.resourceserver.jwt.jws-algorithm=RS512") .run((context) -> { NimbusReactiveJwtDecoder nimbusReactiveJwtDecoder = context.getBean(NimbusReactiveJwtDecoder.class); - assertThat(nimbusReactiveJwtDecoder).extracting("jwtProcessor.arg$2") - .matches((algorithms) -> ((Set) algorithms).contains(JWSAlgorithm.RS512)); + assertThat(nimbusReactiveJwtDecoder).extracting("jwtProcessor.arg$1.signatureAlgorithms").matches( + (algorithms) -> ((Set) algorithms).contains(SignatureAlgorithm.RS512)); }); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/servlet/OAuth2ResourceServerAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/servlet/OAuth2ResourceServerAutoConfigurationTests.java index e6f666513a..1d95ffbf67 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/servlet/OAuth2ResourceServerAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/servlet/OAuth2ResourceServerAutoConfigurationTests.java @@ -99,7 +99,8 @@ class OAuth2ResourceServerAutoConfigurationTests { JwtDecoder jwtDecoder = context.getBean(JwtDecoder.class); Object processor = ReflectionTestUtils.getField(jwtDecoder, "jwtProcessor"); Object keySelector = ReflectionTestUtils.getField(processor, "jwsKeySelector"); - assertThat(keySelector).hasFieldOrPropertyWithValue("jwsAlg", JWSAlgorithm.RS256); + assertThat(keySelector).hasFieldOrPropertyWithValue("jwsAlgs", + Collections.singleton(JWSAlgorithm.RS256)); }); } @@ -112,7 +113,8 @@ class OAuth2ResourceServerAutoConfigurationTests { JwtDecoder jwtDecoder = context.getBean(JwtDecoder.class); Object processor = ReflectionTestUtils.getField(jwtDecoder, "jwtProcessor"); Object keySelector = ReflectionTestUtils.getField(processor, "jwsKeySelector"); - assertThat(keySelector).hasFieldOrPropertyWithValue("jwsAlg", JWSAlgorithm.RS384); + assertThat(keySelector).hasFieldOrPropertyWithValue("jwsAlgs", + Collections.singleton(JWSAlgorithm.RS384)); assertThat(getBearerTokenFilter(context)).isNotNull(); }); } diff --git a/spring-boot-project/spring-boot-dependencies/build.gradle b/spring-boot-project/spring-boot-dependencies/build.gradle index a201e94fd3..866fc595d6 100644 --- a/spring-boot-project/spring-boot-dependencies/build.gradle +++ b/spring-boot-project/spring-boot-dependencies/build.gradle @@ -1712,7 +1712,7 @@ bom { ] } } - library("Spring Security", "5.3.2.RELEASE") { + library("Spring Security", "5.4.0-SNAPSHOT") { group("org.springframework.security") { imports = [ "spring-security-bom"