Fixes for webauthn tests after JSpecify
Issue gh-17839
This commit is contained in:
+39
-8
@@ -300,7 +300,15 @@ public class WebAuthnConfigurerTests {
|
||||
|
||||
@Bean
|
||||
SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
|
||||
return http.formLogin(Customizer.withDefaults()).webAuthn(Customizer.withDefaults()).build();
|
||||
// @formatter:off
|
||||
http
|
||||
.formLogin(Customizer.withDefaults())
|
||||
.webAuthn((authn) -> authn
|
||||
.rpId("spring.io")
|
||||
.rpName("spring")
|
||||
);
|
||||
// @formatter:on
|
||||
return http.build();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -316,7 +324,14 @@ public class WebAuthnConfigurerTests {
|
||||
|
||||
@Bean
|
||||
SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
|
||||
return http.webAuthn(Customizer.withDefaults()).build();
|
||||
// @formatter:off
|
||||
http
|
||||
.webAuthn((authn) -> authn
|
||||
.rpId("spring.io")
|
||||
.rpName("spring")
|
||||
);
|
||||
// @formatter:on
|
||||
return http.build();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -332,9 +347,16 @@ public class WebAuthnConfigurerTests {
|
||||
|
||||
@Bean
|
||||
SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
|
||||
return http.formLogin(Customizer.withDefaults())
|
||||
.webAuthn((webauthn) -> webauthn.disableDefaultRegistrationPage(true))
|
||||
.build();
|
||||
// @formatter:off
|
||||
http
|
||||
.formLogin(Customizer.withDefaults())
|
||||
.webAuthn((authn) -> authn
|
||||
.rpId("spring.io")
|
||||
.rpName("spring")
|
||||
.disableDefaultRegistrationPage(true)
|
||||
);
|
||||
// @formatter:on
|
||||
return http.build();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -350,9 +372,18 @@ public class WebAuthnConfigurerTests {
|
||||
|
||||
@Bean
|
||||
SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
|
||||
return http.formLogin((login) -> login.loginPage("/custom-login-page"))
|
||||
.webAuthn((webauthn) -> webauthn.disableDefaultRegistrationPage(true))
|
||||
.build();
|
||||
// @formatter:off
|
||||
http
|
||||
.formLogin((login) -> login
|
||||
.loginPage("/custom-login-page")
|
||||
)
|
||||
.webAuthn((authn) -> authn
|
||||
.rpId("spring.io")
|
||||
.rpName("spring")
|
||||
.disableDefaultRegistrationPage(true)
|
||||
);
|
||||
// @formatter:on
|
||||
return http.build();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+7
-1
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
|
||||
* Copyright 2004-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -125,6 +126,8 @@ class WebAuthnDslTests {
|
||||
http{
|
||||
formLogin { }
|
||||
webAuthn {
|
||||
rpId = "spring.io"
|
||||
rpName = "spring"
|
||||
disableDefaultRegistrationPage = true
|
||||
}
|
||||
}
|
||||
@@ -144,7 +147,10 @@ class WebAuthnDslTests {
|
||||
open fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
||||
http{
|
||||
formLogin { }
|
||||
webAuthn { }
|
||||
webAuthn {
|
||||
rpId = "spring.io"
|
||||
rpName = "spring"
|
||||
}
|
||||
}
|
||||
return http.build()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user