Start building against Spring Security 5.4.0-M2 snapshots

See gh-21932
This commit is contained in:
Andy Wilkinson
2020-06-24 11:07:14 +01:00
parent c54918e46d
commit a92d64cb80
3 changed files with 8 additions and 5 deletions

View File

@@ -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<JWSAlgorithm>) algorithms).contains(JWSAlgorithm.RS512));
assertThat(nimbusReactiveJwtDecoder).extracting("jwtProcessor.arg$1.signatureAlgorithms").matches(
(algorithms) -> ((Set<SignatureAlgorithm>) algorithms).contains(SignatureAlgorithm.RS512));
});
}

View File

@@ -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();
});
}

View File

@@ -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"