From 157c17b1fb0e86927a21b7986420a1cf729cdd89 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 15 Dec 2024 12:27:14 +0000 Subject: [PATCH 1/2] chore(deps): bump springBootVersion from 3.3.4 to 3.4.0 Bumps `springBootVersion` from 3.3.4 to 3.4.0. Updates `org.springframework.boot:spring-boot-gradle-plugin` from 3.3.4 to 3.4.0 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.3.4...v3.4.0) Updates `org.springframework.boot:spring-boot-dependencies` from 3.3.4 to 3.4.0 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.3.4...v3.4.0) --- updated-dependencies: - dependency-name: org.springframework.boot:spring-boot-gradle-plugin dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: org.springframework.boot:spring-boot-dependencies dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 68d1e4604..84dc58024 100644 --- a/build.gradle +++ b/build.gradle @@ -17,7 +17,7 @@ buildscript { ext{ //Plugins - springBootVersion = '3.3.4' + springBootVersion = '3.4.0' sonarqubeVersion = '6.0.1.5171' asciidoctorGradleVersion = "4.0.3" From 8e7a6b74592205cbd7f3b5846a18d73e09a91da1 Mon Sep 17 00:00:00 2001 From: Yoshikazu Nojima Date: Sun, 15 Dec 2024 22:05:33 +0900 Subject: [PATCH 2/2] Address deprecated APIs in Spring Boot 3.4.0 --- ...thnAuthenticationProviderConfigurerSpringTest.java | 11 +++++++---- .../WebAuthnLoginConfigurerSpringTest.java | 8 ++++---- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/webauthn4j-spring-security-core/src/test/java/com/webauthn4j/springframework/security/config/configurers/WebAuthnAuthenticationProviderConfigurerSpringTest.java b/webauthn4j-spring-security-core/src/test/java/com/webauthn4j/springframework/security/config/configurers/WebAuthnAuthenticationProviderConfigurerSpringTest.java index 0ccf95bb7..b3d865b02 100644 --- a/webauthn4j-spring-security-core/src/test/java/com/webauthn4j/springframework/security/config/configurers/WebAuthnAuthenticationProviderConfigurerSpringTest.java +++ b/webauthn4j-spring-security-core/src/test/java/com/webauthn4j/springframework/security/config/configurers/WebAuthnAuthenticationProviderConfigurerSpringTest.java @@ -39,6 +39,7 @@ import org.springframework.web.servlet.handler.HandlerMappingIntrospector; import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.Mockito.mock; @RunWith(SpringRunner.class) public class WebAuthnAuthenticationProviderConfigurerSpringTest { @@ -55,8 +56,10 @@ public void test() { @EnableWebSecurity static class Config { - @MockBean - private WebAuthnCredentialRecordService authenticatorService; + @Bean + public WebAuthnCredentialRecordService webAuthnCredentialRecordService(){ + return mock(WebAuthnCredentialRecordService.class); + } @Bean public ChallengeRepository challengeRepository() { @@ -100,8 +103,8 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { } @Bean - public AuthenticationManager authenticationManager(){ - return new ProviderManager(new WebAuthnAuthenticationProvider(authenticatorService, WebAuthnManager.createNonStrictWebAuthnManager())); + public AuthenticationManager authenticationManager(WebAuthnCredentialRecordService webAuthnCredentialRecordService) { + return new ProviderManager(new WebAuthnAuthenticationProvider(webAuthnCredentialRecordService, WebAuthnManager.createNonStrictWebAuthnManager())); } @Bean(name = "mvcHandlerMappingIntrospector") diff --git a/webauthn4j-spring-security-core/src/test/java/com/webauthn4j/springframework/security/config/configurers/WebAuthnLoginConfigurerSpringTest.java b/webauthn4j-spring-security-core/src/test/java/com/webauthn4j/springframework/security/config/configurers/WebAuthnLoginConfigurerSpringTest.java index eeedce0da..4e9910e18 100644 --- a/webauthn4j-spring-security-core/src/test/java/com/webauthn4j/springframework/security/config/configurers/WebAuthnLoginConfigurerSpringTest.java +++ b/webauthn4j-spring-security-core/src/test/java/com/webauthn4j/springframework/security/config/configurers/WebAuthnLoginConfigurerSpringTest.java @@ -98,7 +98,7 @@ public void attestationOptionsEndpointPath_with_anonymous_user_test() throws Exc mvc .perform(get("/webauthn/attestation/options").with(anonymous())) .andExpect(unauthenticated()) - .andExpect(content().json("{\"rp\":{\"id\":\"example.com\",\"name\":\"example\"},\"challenge\":\"aFglXMZdQTKD4krvNzJBzA\",\"pubKeyCredParams\":[{\"type\":\"public-key\",\"alg\":-7},{\"type\":\"public-key\",\"alg\":-65535}],\"timeout\":10000,\"excludeCredentials\":[],\"authenticatorSelection\":{\"authenticatorAttachment\":\"cross-platform\",\"requireResidentKey\":false,\"residentKey\":\"preferred\",\"userVerification\":\"preferred\"},\"attestation\":\"direct\",\"extensions\":{\"uvm\":true,\"credProps\":true,\"extensionProvider\":\"/webauthn/attestation/options\",\"unknown\":true}}", true)) + .andExpect(content().json("{\"rp\":{\"id\":\"example.com\",\"name\":\"example\"},\"challenge\":\"aFglXMZdQTKD4krvNzJBzA\",\"pubKeyCredParams\":[{\"type\":\"public-key\",\"alg\":-7},{\"type\":\"public-key\",\"alg\":-65535}],\"timeout\":10000,\"excludeCredentials\":[],\"authenticatorSelection\":{\"authenticatorAttachment\":\"cross-platform\",\"requireResidentKey\":false,\"residentKey\":\"preferred\",\"userVerification\":\"preferred\"},\"attestation\":\"direct\",\"extensions\":{\"uvm\":true,\"credProps\":true,\"extensionProvider\":\"/webauthn/attestation/options\",\"unknown\":true}}")) .andExpect(status().isOk()); } @@ -111,7 +111,7 @@ public void assertionOptionsEndpointPath_with_anonymous_user_test() throws Excep mvc .perform(get("/webauthn/assertion/options").with(anonymous())) .andExpect(unauthenticated()) - .andExpect(content().json("{\"challenge\":\"aFglXMZdQTKD4krvNzJBzA\",\"timeout\":20000,\"rpId\":\"example.com\",\"allowCredentials\":[],\"userVerification\":\"preferred\",\"extensions\":{\"appid\":\"appid\",\"appidExclude\":\"appidExclude\",\"uvm\":true,\"extensionProvider\":\"/webauthn/assertion/options\",\"unknown\":true}}", true)) + .andExpect(content().json("{\"challenge\":\"aFglXMZdQTKD4krvNzJBzA\",\"timeout\":20000,\"rpId\":\"example.com\",\"allowCredentials\":[],\"userVerification\":\"preferred\",\"extensions\":{\"appid\":\"appid\",\"appidExclude\":\"appidExclude\",\"uvm\":true,\"extensionProvider\":\"/webauthn/assertion/options\",\"unknown\":true}}")) .andExpect(status().isOk()); } @@ -138,7 +138,7 @@ public void attestationOptionsEndpointPath_with_authenticated_user_test() throws mvc .perform(get("/webauthn/attestation/options").with(user("john"))) .andExpect(authenticated()) - .andExpect(content().json("{\"rp\":{\"id\":\"example.com\",\"name\":\"example\"},\"user\":{\"id\":\"am9obg\",\"name\":\"john\",\"displayName\":\"john\"},\"challenge\":\"aFglXMZdQTKD4krvNzJBzA\",\"pubKeyCredParams\":[{\"type\":\"public-key\",\"alg\":-7},{\"type\":\"public-key\",\"alg\":-65535}],\"timeout\":10000,\"excludeCredentials\":[],\"authenticatorSelection\":{\"authenticatorAttachment\":\"cross-platform\",\"requireResidentKey\":false,\"residentKey\":\"preferred\",\"userVerification\":\"preferred\"},\"attestation\":\"direct\",\"extensions\":{\"uvm\":true,\"credProps\":true,\"extensionProvider\":\"/webauthn/attestation/options\",\"unknown\":true}}", true)) + .andExpect(content().json("{\"rp\":{\"id\":\"example.com\",\"name\":\"example\"},\"user\":{\"id\":\"am9obg\",\"name\":\"john\",\"displayName\":\"john\"},\"challenge\":\"aFglXMZdQTKD4krvNzJBzA\",\"pubKeyCredParams\":[{\"type\":\"public-key\",\"alg\":-7},{\"type\":\"public-key\",\"alg\":-65535}],\"timeout\":10000,\"excludeCredentials\":[],\"authenticatorSelection\":{\"authenticatorAttachment\":\"cross-platform\",\"requireResidentKey\":false,\"residentKey\":\"preferred\",\"userVerification\":\"preferred\"},\"attestation\":\"direct\",\"extensions\":{\"uvm\":true,\"credProps\":true,\"extensionProvider\":\"/webauthn/attestation/options\",\"unknown\":true}}")) .andExpect(status().isOk()); } @@ -154,7 +154,7 @@ public void assertionOptionsEndpointPath_with_authenticated_user_test() throws E .andDo(item -> item.getResponse().getContentAsString() ) - .andExpect(content().json("{\"challenge\":\"aFglXMZdQTKD4krvNzJBzA\",\"timeout\":20000,\"rpId\":\"example.com\",\"allowCredentials\":[],\"userVerification\":\"preferred\",\"extensions\":{\"appid\":\"appid\",\"appidExclude\":\"appidExclude\",\"uvm\":true,\"extensionProvider\":\"/webauthn/assertion/options\",\"unknown\":true}}", true)) + .andExpect(content().json("{\"challenge\":\"aFglXMZdQTKD4krvNzJBzA\",\"timeout\":20000,\"rpId\":\"example.com\",\"allowCredentials\":[],\"userVerification\":\"preferred\",\"extensions\":{\"appid\":\"appid\",\"appidExclude\":\"appidExclude\",\"uvm\":true,\"extensionProvider\":\"/webauthn/assertion/options\",\"unknown\":true}}")) .andExpect(status().isOk()); }