|
212 | 212 | import org.springframework.security.web.server.firewall.ServerExchangeRejectedException; |
213 | 213 | import org.springframework.security.web.session.HttpSessionCreatedEvent; |
214 | 214 | import org.springframework.security.web.webauthn.api.AuthenticationExtensionsClientInputs; |
| 215 | +import org.springframework.security.web.webauthn.api.AuthenticationExtensionsClientOutputs; |
| 216 | +import org.springframework.security.web.webauthn.api.AuthenticatorAssertionResponse; |
215 | 217 | import org.springframework.security.web.webauthn.api.AuthenticatorTransport; |
216 | 218 | import org.springframework.security.web.webauthn.api.Bytes; |
217 | 219 | import org.springframework.security.web.webauthn.api.CredProtectAuthenticationExtensionsClientInput; |
| 220 | +import org.springframework.security.web.webauthn.api.CredentialPropertiesOutput; |
218 | 221 | import org.springframework.security.web.webauthn.api.ImmutableAuthenticationExtensionsClientInput; |
219 | 222 | import org.springframework.security.web.webauthn.api.ImmutableAuthenticationExtensionsClientInputs; |
| 223 | +import org.springframework.security.web.webauthn.api.ImmutableAuthenticationExtensionsClientOutputs; |
220 | 224 | import org.springframework.security.web.webauthn.api.ImmutablePublicKeyCredentialUserEntity; |
| 225 | +import org.springframework.security.web.webauthn.api.PublicKeyCredential; |
221 | 226 | import org.springframework.security.web.webauthn.api.PublicKeyCredentialDescriptor; |
222 | 227 | import org.springframework.security.web.webauthn.api.PublicKeyCredentialRequestOptions; |
223 | 228 | import org.springframework.security.web.webauthn.api.PublicKeyCredentialType; |
224 | 229 | import org.springframework.security.web.webauthn.api.PublicKeyCredentialUserEntity; |
| 230 | +import org.springframework.security.web.webauthn.api.TestAuthenticationAssertionResponses; |
225 | 231 | import org.springframework.security.web.webauthn.api.TestBytes; |
| 232 | +import org.springframework.security.web.webauthn.api.TestPublicKeyCredential; |
226 | 233 | import org.springframework.security.web.webauthn.api.TestPublicKeyCredentialRequestOptions; |
227 | 234 | import org.springframework.security.web.webauthn.api.TestPublicKeyCredentialUserEntity; |
228 | 235 | import org.springframework.security.web.webauthn.api.UserVerificationRequirement; |
229 | 236 | import org.springframework.security.web.webauthn.authentication.WebAuthnAuthentication; |
| 237 | +import org.springframework.security.web.webauthn.authentication.WebAuthnAuthenticationRequestToken; |
| 238 | +import org.springframework.security.web.webauthn.management.RelyingPartyAuthenticationRequest; |
230 | 239 | import org.springframework.util.ReflectionUtils; |
231 | 240 |
|
232 | 241 | import static org.assertj.core.api.Assertions.assertThat; |
@@ -629,6 +638,26 @@ class SpringSecurityCoreVersionSerializableTests { |
629 | 638 | .allowCredentials(List.of(descriptor)) |
630 | 639 | .build() |
631 | 640 | ); |
| 641 | + |
| 642 | + CredentialPropertiesOutput credentialOutput = new CredentialPropertiesOutput(false); |
| 643 | + AuthenticationExtensionsClientOutputs outputs = new ImmutableAuthenticationExtensionsClientOutputs(credentialOutput); |
| 644 | + AuthenticatorAssertionResponse response = TestAuthenticationAssertionResponses.createAuthenticatorAssertionResponse() |
| 645 | + .build(); |
| 646 | + PublicKeyCredential<AuthenticatorAssertionResponse> credential = TestPublicKeyCredential.createPublicKeyCredential( |
| 647 | + response, outputs) |
| 648 | + .build(); |
| 649 | + RelyingPartyAuthenticationRequest authRequest = new RelyingPartyAuthenticationRequest( |
| 650 | + TestPublicKeyCredentialRequestOptions.create().build(), |
| 651 | + credential |
| 652 | + ); |
| 653 | + WebAuthnAuthenticationRequestToken requestToken = new WebAuthnAuthenticationRequestToken(authRequest); |
| 654 | + requestToken.setDetails(details); |
| 655 | + generatorByClassName.put(CredentialPropertiesOutput.class, (o) -> credentialOutput); |
| 656 | + generatorByClassName.put(ImmutableAuthenticationExtensionsClientOutputs.class, (o) -> outputs); |
| 657 | + generatorByClassName.put(AuthenticatorAssertionResponse.class, (r) -> response); |
| 658 | + generatorByClassName.put(RelyingPartyAuthenticationRequest.class, (r) -> authRequest); |
| 659 | + generatorByClassName.put(PublicKeyCredential.class, (r) -> credential); |
| 660 | + generatorByClassName.put(WebAuthnAuthenticationRequestToken.class, (r) -> requestToken); |
632 | 661 | // @formatter:on |
633 | 662 | } |
634 | 663 |
|
|
0 commit comments