Skip to content

Commit

Permalink
Merge pull request #1574 from webauthn4j/dependabot/gradle/springBoot…
Browse files Browse the repository at this point in the history
…Version-3.4.0

chore(deps): bump springBootVersion from 3.3.4 to 3.4.0
  • Loading branch information
github-actions[bot] authored Dec 15, 2024
2 parents dec24ed + 8e7a6b7 commit 6730ed1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
buildscript {
ext{
//Plugins
springBootVersion = '3.3.4'
springBootVersion = '3.4.0'
sonarqubeVersion = '6.0.1.5171'
asciidoctorGradleVersion = "4.0.3"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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() {
Expand Down Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

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

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

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

Expand Down

0 comments on commit 6730ed1

Please sign in to comment.