From e4106ecf683336a98163f844c997e93bb5be441b Mon Sep 17 00:00:00 2001 From: Rob Winch <362503+rwinch@users.noreply.github.com> Date: Fri, 14 Nov 2025 14:58:22 -0600 Subject: [PATCH] Add Webauthn4JRelyingPartyOperations.setObjectConverter Simplifies testing of Webauthn4JRelyingPartyOperations Issue gh-18158 --- .../management/Webauthn4JRelyingPartyOperations.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/webauthn/src/main/java/org/springframework/security/web/webauthn/management/Webauthn4JRelyingPartyOperations.java b/webauthn/src/main/java/org/springframework/security/web/webauthn/management/Webauthn4JRelyingPartyOperations.java index f9db52cd31..5621ee68e9 100644 --- a/webauthn/src/main/java/org/springframework/security/web/webauthn/management/Webauthn4JRelyingPartyOperations.java +++ b/webauthn/src/main/java/org/springframework/security/web/webauthn/management/Webauthn4JRelyingPartyOperations.java @@ -95,7 +95,7 @@ public class Webauthn4JRelyingPartyOperations implements WebAuthnRelyingPartyOpe private final PublicKeyCredentialRpEntity rp; - private final ObjectConverter objectConverter = new ObjectConverter(); + private ObjectConverter objectConverter = new ObjectConverter(); private final AuthenticationTrustResolver trustResolver = new AuthenticationTrustResolverImpl(); @@ -137,6 +137,15 @@ public class Webauthn4JRelyingPartyOperations implements WebAuthnRelyingPartyOpe this.webAuthnManager = webAuthnManager; } + /** + * Sets the {@link ObjectConverter} to use. + * @param objectConverter the {@link ObjectConverter} to use. Cannot be null. + */ + void setObjectConverter(ObjectConverter objectConverter) { + Assert.notNull(objectConverter, "objectConverter cannot be null"); + this.objectConverter = objectConverter; + } + /** * Sets a {@link Consumer} used to customize the * {@link PublicKeyCredentialCreationOptionsBuilder} for