Browse Source

Make PublicKeyCredentialRequestOptions Serializable

Closes gh-16432

Signed-off-by: Max Batischev <mblancer@mail.ru>
Max Batischev 6 months ago
parent
commit
879b44f9a1
20 changed files with 113 additions and 18 deletions
  1. 46 0
      config/src/test/java/org/springframework/security/SpringSecurityCoreVersionSerializableTests.java
  2. BIN
      config/src/test/resources/serialized/6.4.x/org.springframework.security.web.webauthn.api.AuthenticatorTransport.serialized
  3. BIN
      config/src/test/resources/serialized/6.4.x/org.springframework.security.web.webauthn.api.CredProtectAuthenticationExtensionsClientInput$CredProtect.serialized
  4. BIN
      config/src/test/resources/serialized/6.4.x/org.springframework.security.web.webauthn.api.CredProtectAuthenticationExtensionsClientInput.serialized
  5. BIN
      config/src/test/resources/serialized/6.4.x/org.springframework.security.web.webauthn.api.ImmutableAuthenticationExtensionsClientInput.serialized
  6. BIN
      config/src/test/resources/serialized/6.4.x/org.springframework.security.web.webauthn.api.ImmutableAuthenticationExtensionsClientInputs.serialized
  7. BIN
      config/src/test/resources/serialized/6.4.x/org.springframework.security.web.webauthn.api.PublicKeyCredentialDescriptor.serialized
  8. BIN
      config/src/test/resources/serialized/6.4.x/org.springframework.security.web.webauthn.api.PublicKeyCredentialRequestOptions.serialized
  9. BIN
      config/src/test/resources/serialized/6.4.x/org.springframework.security.web.webauthn.api.PublicKeyCredentialType.serialized
  10. BIN
      config/src/test/resources/serialized/6.4.x/org.springframework.security.web.webauthn.api.UserVerificationRequirement.serialized
  11. 4 2
      web/src/main/java/org/springframework/security/web/webauthn/api/AuthenticationExtensionsClientInput.java
  12. 3 2
      web/src/main/java/org/springframework/security/web/webauthn/api/AuthenticationExtensionsClientInputs.java
  13. 8 2
      web/src/main/java/org/springframework/security/web/webauthn/api/AuthenticatorTransport.java
  14. 11 2
      web/src/main/java/org/springframework/security/web/webauthn/api/CredProtectAuthenticationExtensionsClientInput.java
  15. 6 1
      web/src/main/java/org/springframework/security/web/webauthn/api/ImmutableAuthenticationExtensionsClientInput.java
  16. 5 1
      web/src/main/java/org/springframework/security/web/webauthn/api/ImmutableAuthenticationExtensionsClientInputs.java
  17. 7 2
      web/src/main/java/org/springframework/security/web/webauthn/api/PublicKeyCredentialDescriptor.java
  18. 7 2
      web/src/main/java/org/springframework/security/web/webauthn/api/PublicKeyCredentialRequestOptions.java
  19. 8 2
      web/src/main/java/org/springframework/security/web/webauthn/api/PublicKeyCredentialType.java
  20. 8 2
      web/src/main/java/org/springframework/security/web/webauthn/api/UserVerificationRequirement.java

+ 46 - 0
config/src/test/java/org/springframework/security/SpringSecurityCoreVersionSerializableTests.java

@@ -211,12 +211,23 @@ import org.springframework.security.web.savedrequest.DefaultSavedRequest;
 import org.springframework.security.web.savedrequest.SimpleSavedRequest;
 import org.springframework.security.web.savedrequest.SimpleSavedRequest;
 import org.springframework.security.web.server.firewall.ServerExchangeRejectedException;
 import org.springframework.security.web.server.firewall.ServerExchangeRejectedException;
 import org.springframework.security.web.session.HttpSessionCreatedEvent;
 import org.springframework.security.web.session.HttpSessionCreatedEvent;
+import org.springframework.security.web.webauthn.api.AuthenticationExtensionsClientInputs;
+import org.springframework.security.web.webauthn.api.AuthenticatorTransport;
 import org.springframework.security.web.webauthn.api.Bytes;
 import org.springframework.security.web.webauthn.api.Bytes;
+import org.springframework.security.web.webauthn.api.CredProtectAuthenticationExtensionsClientInput;
+import org.springframework.security.web.webauthn.api.ImmutableAuthenticationExtensionsClientInput;
+import org.springframework.security.web.webauthn.api.ImmutableAuthenticationExtensionsClientInputs;
 import org.springframework.security.web.webauthn.api.ImmutablePublicKeyCredentialUserEntity;
 import org.springframework.security.web.webauthn.api.ImmutablePublicKeyCredentialUserEntity;
+import org.springframework.security.web.webauthn.api.PublicKeyCredentialDescriptor;
+import org.springframework.security.web.webauthn.api.PublicKeyCredentialRequestOptions;
+import org.springframework.security.web.webauthn.api.PublicKeyCredentialType;
 import org.springframework.security.web.webauthn.api.PublicKeyCredentialUserEntity;
 import org.springframework.security.web.webauthn.api.PublicKeyCredentialUserEntity;
 import org.springframework.security.web.webauthn.api.TestBytes;
 import org.springframework.security.web.webauthn.api.TestBytes;
+import org.springframework.security.web.webauthn.api.TestPublicKeyCredentialRequestOptions;
 import org.springframework.security.web.webauthn.api.TestPublicKeyCredentialUserEntity;
 import org.springframework.security.web.webauthn.api.TestPublicKeyCredentialUserEntity;
+import org.springframework.security.web.webauthn.api.UserVerificationRequirement;
 import org.springframework.security.web.webauthn.authentication.WebAuthnAuthentication;
 import org.springframework.security.web.webauthn.authentication.WebAuthnAuthentication;
+import org.springframework.util.ReflectionUtils;
 
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.fail;
 import static org.assertj.core.api.Assertions.fail;
@@ -584,6 +595,41 @@ class SpringSecurityCoreVersionSerializableTests {
 			webAuthnAuthentication.setDetails(details);
 			webAuthnAuthentication.setDetails(details);
 			return webAuthnAuthentication;
 			return webAuthnAuthentication;
 		});
 		});
+
+		// webauthn
+		CredProtectAuthenticationExtensionsClientInput.CredProtect credProtect = new CredProtectAuthenticationExtensionsClientInput.CredProtect(
+				CredProtectAuthenticationExtensionsClientInput.CredProtect.ProtectionPolicy.USER_VERIFICATION_OPTIONAL,
+				true);
+		Bytes id = TestBytes.get();
+		AuthenticationExtensionsClientInputs inputs = new ImmutableAuthenticationExtensionsClientInputs(
+				ImmutableAuthenticationExtensionsClientInput.credProps);
+		// @formatter:off
+		PublicKeyCredentialDescriptor descriptor = PublicKeyCredentialDescriptor.builder()
+				.id(id)
+				.type(PublicKeyCredentialType.PUBLIC_KEY)
+				.transports(Set.of(AuthenticatorTransport.USB))
+				.build();
+		// @formatter:on
+		generatorByClassName.put(AuthenticatorTransport.class, (a) -> AuthenticatorTransport.USB);
+		generatorByClassName.put(PublicKeyCredentialType.class, (k) -> PublicKeyCredentialType.PUBLIC_KEY);
+		generatorByClassName.put(UserVerificationRequirement.class, (r) -> UserVerificationRequirement.REQUIRED);
+		generatorByClassName.put(CredProtectAuthenticationExtensionsClientInput.CredProtect.class, (c) -> credProtect);
+		generatorByClassName.put(CredProtectAuthenticationExtensionsClientInput.class,
+				(c) -> new CredProtectAuthenticationExtensionsClientInput(credProtect));
+		generatorByClassName.put(ImmutableAuthenticationExtensionsClientInputs.class, (i) -> inputs);
+		Field credPropsField = ReflectionUtils.findField(ImmutableAuthenticationExtensionsClientInput.class,
+				"credProps");
+		generatorByClassName.put(credPropsField.getType(),
+				(i) -> ImmutableAuthenticationExtensionsClientInput.credProps);
+		generatorByClassName.put(Bytes.class, (b) -> id);
+		generatorByClassName.put(PublicKeyCredentialDescriptor.class, (d) -> descriptor);
+		// @formatter:off
+		generatorByClassName.put(PublicKeyCredentialRequestOptions.class, (o) -> TestPublicKeyCredentialRequestOptions.create()
+				.extensions(inputs)
+				.allowCredentials(List.of(descriptor))
+				.build()
+		);
+		// @formatter:on
 	}
 	}
 
 
 	@ParameterizedTest
 	@ParameterizedTest

BIN
config/src/test/resources/serialized/6.4.x/org.springframework.security.web.webauthn.api.AuthenticatorTransport.serialized


BIN
config/src/test/resources/serialized/6.4.x/org.springframework.security.web.webauthn.api.CredProtectAuthenticationExtensionsClientInput$CredProtect.serialized


BIN
config/src/test/resources/serialized/6.4.x/org.springframework.security.web.webauthn.api.CredProtectAuthenticationExtensionsClientInput.serialized


BIN
config/src/test/resources/serialized/6.4.x/org.springframework.security.web.webauthn.api.ImmutableAuthenticationExtensionsClientInput.serialized


BIN
config/src/test/resources/serialized/6.4.x/org.springframework.security.web.webauthn.api.ImmutableAuthenticationExtensionsClientInputs.serialized


BIN
config/src/test/resources/serialized/6.4.x/org.springframework.security.web.webauthn.api.PublicKeyCredentialDescriptor.serialized


BIN
config/src/test/resources/serialized/6.4.x/org.springframework.security.web.webauthn.api.PublicKeyCredentialRequestOptions.serialized


BIN
config/src/test/resources/serialized/6.4.x/org.springframework.security.web.webauthn.api.PublicKeyCredentialType.serialized


BIN
config/src/test/resources/serialized/6.4.x/org.springframework.security.web.webauthn.api.UserVerificationRequirement.serialized


+ 4 - 2
web/src/main/java/org/springframework/security/web/webauthn/api/AuthenticationExtensionsClientInput.java

@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright 2002-2024 the original author or authors.
+ * Copyright 2002-2025 the original author or authors.
  *
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * you may not use this file except in compliance with the License.
@@ -16,6 +16,8 @@
 
 
 package org.springframework.security.web.webauthn.api;
 package org.springframework.security.web.webauthn.api;
 
 
+import java.io.Serializable;
+
 /**
 /**
  * A <a href="https://www.w3.org/TR/webauthn-3/#client-extension-input">client extension
  * A <a href="https://www.w3.org/TR/webauthn-3/#client-extension-input">client extension
  * input</a> entry in the {@link AuthenticationExtensionsClientInputs}.
  * input</a> entry in the {@link AuthenticationExtensionsClientInputs}.
@@ -25,7 +27,7 @@ package org.springframework.security.web.webauthn.api;
  * @since 6.4
  * @since 6.4
  * @see ImmutableAuthenticationExtensionsClientInput
  * @see ImmutableAuthenticationExtensionsClientInput
  */
  */
-public interface AuthenticationExtensionsClientInput<T> {
+public interface AuthenticationExtensionsClientInput<T> extends Serializable {
 
 
 	/**
 	/**
 	 * Gets the <a href="https://www.w3.org/TR/webauthn-3/#extension-identifier">extension
 	 * Gets the <a href="https://www.w3.org/TR/webauthn-3/#extension-identifier">extension

+ 3 - 2
web/src/main/java/org/springframework/security/web/webauthn/api/AuthenticationExtensionsClientInputs.java

@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright 2002-2024 the original author or authors.
+ * Copyright 2002-2025 the original author or authors.
  *
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * you may not use this file except in compliance with the License.
@@ -16,6 +16,7 @@
 
 
 package org.springframework.security.web.webauthn.api;
 package org.springframework.security.web.webauthn.api;
 
 
+import java.io.Serializable;
 import java.util.List;
 import java.util.List;
 
 
 /**
 /**
@@ -31,7 +32,7 @@ import java.util.List;
  * @since 6.4
  * @since 6.4
  * @see PublicKeyCredentialCreationOptions#getExtensions()
  * @see PublicKeyCredentialCreationOptions#getExtensions()
  */
  */
-public interface AuthenticationExtensionsClientInputs {
+public interface AuthenticationExtensionsClientInputs extends Serializable {
 
 
 	/**
 	/**
 	 * Gets all of the {@link AuthenticationExtensionsClientInput}.
 	 * Gets all of the {@link AuthenticationExtensionsClientInput}.

+ 8 - 2
web/src/main/java/org/springframework/security/web/webauthn/api/AuthenticatorTransport.java

@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright 2002-2024 the original author or authors.
+ * Copyright 2002-2025 the original author or authors.
  *
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * you may not use this file except in compliance with the License.
@@ -16,6 +16,9 @@
 
 
 package org.springframework.security.web.webauthn.api;
 package org.springframework.security.web.webauthn.api;
 
 
+import java.io.Serial;
+import java.io.Serializable;
+
 /**
 /**
  * <a href=
  * <a href=
  * "https://www.w3.org/TR/webauthn-3/#enumdef-authenticatortransport">AuthenticatorTransport</a>
  * "https://www.w3.org/TR/webauthn-3/#enumdef-authenticatortransport">AuthenticatorTransport</a>
@@ -25,7 +28,10 @@ package org.springframework.security.web.webauthn.api;
  * @author Rob Winch
  * @author Rob Winch
  * @since 6.4
  * @since 6.4
  */
  */
-public final class AuthenticatorTransport {
+public final class AuthenticatorTransport implements Serializable {
+
+	@Serial
+	private static final long serialVersionUID = -5617945441117386982L;
 
 
 	/**
 	/**
 	 * <a href="https://www.w3.org/TR/webauthn-3/#dom-authenticatortransport-usb">usbc</a>
 	 * <a href="https://www.w3.org/TR/webauthn-3/#dom-authenticatortransport-usb">usbc</a>

+ 11 - 2
web/src/main/java/org/springframework/security/web/webauthn/api/CredProtectAuthenticationExtensionsClientInput.java

@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright 2002-2024 the original author or authors.
+ * Copyright 2002-2025 the original author or authors.
  *
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * you may not use this file except in compliance with the License.
@@ -16,6 +16,9 @@
 
 
 package org.springframework.security.web.webauthn.api;
 package org.springframework.security.web.webauthn.api;
 
 
+import java.io.Serial;
+import java.io.Serializable;
+
 /**
 /**
  * Implements <a href=
  * Implements <a href=
  * "https://fidoalliance.org/specs/fido-v2.2-rd-20230321/fido-client-to-authenticator-protocol-v2.2-rd-20230321.html#sctn-credProtect-extension">
  * "https://fidoalliance.org/specs/fido-v2.2-rd-20230321/fido-client-to-authenticator-protocol-v2.2-rd-20230321.html#sctn-credProtect-extension">
@@ -27,6 +30,9 @@ package org.springframework.security.web.webauthn.api;
 public class CredProtectAuthenticationExtensionsClientInput
 public class CredProtectAuthenticationExtensionsClientInput
 		implements AuthenticationExtensionsClientInput<CredProtectAuthenticationExtensionsClientInput.CredProtect> {
 		implements AuthenticationExtensionsClientInput<CredProtectAuthenticationExtensionsClientInput.CredProtect> {
 
 
+	@Serial
+	private static final long serialVersionUID = -6418175591005843455L;
+
 	private final CredProtect input;
 	private final CredProtect input;
 
 
 	public CredProtectAuthenticationExtensionsClientInput(CredProtect input) {
 	public CredProtectAuthenticationExtensionsClientInput(CredProtect input) {
@@ -43,7 +49,10 @@ public class CredProtectAuthenticationExtensionsClientInput
 		return this.input;
 		return this.input;
 	}
 	}
 
 
-	public static class CredProtect {
+	public static class CredProtect implements Serializable {
+
+		@Serial
+		private static final long serialVersionUID = 109597301115842688L;
 
 
 		private final ProtectionPolicy credProtectionPolicy;
 		private final ProtectionPolicy credProtectionPolicy;
 
 

+ 6 - 1
web/src/main/java/org/springframework/security/web/webauthn/api/ImmutableAuthenticationExtensionsClientInput.java

@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright 2002-2024 the original author or authors.
+ * Copyright 2002-2025 the original author or authors.
  *
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * you may not use this file except in compliance with the License.
@@ -16,6 +16,8 @@
 
 
 package org.springframework.security.web.webauthn.api;
 package org.springframework.security.web.webauthn.api;
 
 
+import java.io.Serial;
+
 /**
 /**
  * An immutable {@link AuthenticationExtensionsClientInput}.
  * An immutable {@link AuthenticationExtensionsClientInput}.
  *
  *
@@ -26,6 +28,9 @@ package org.springframework.security.web.webauthn.api;
  */
  */
 public class ImmutableAuthenticationExtensionsClientInput<T> implements AuthenticationExtensionsClientInput<T> {
 public class ImmutableAuthenticationExtensionsClientInput<T> implements AuthenticationExtensionsClientInput<T> {
 
 
+	@Serial
+	private static final long serialVersionUID = -1738152485672656808L;
+
 	/**
 	/**
 	 * https://www.w3.org/TR/webauthn-3/#sctn-authenticator-credential-properties-extension
 	 * https://www.w3.org/TR/webauthn-3/#sctn-authenticator-credential-properties-extension
 	 */
 	 */

+ 5 - 1
web/src/main/java/org/springframework/security/web/webauthn/api/ImmutableAuthenticationExtensionsClientInputs.java

@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright 2002-2024 the original author or authors.
+ * Copyright 2002-2025 the original author or authors.
  *
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * you may not use this file except in compliance with the License.
@@ -16,6 +16,7 @@
 
 
 package org.springframework.security.web.webauthn.api;
 package org.springframework.security.web.webauthn.api;
 
 
+import java.io.Serial;
 import java.util.Arrays;
 import java.util.Arrays;
 import java.util.List;
 import java.util.List;
 
 
@@ -27,6 +28,9 @@ import java.util.List;
  */
  */
 public class ImmutableAuthenticationExtensionsClientInputs implements AuthenticationExtensionsClientInputs {
 public class ImmutableAuthenticationExtensionsClientInputs implements AuthenticationExtensionsClientInputs {
 
 
+	@Serial
+	private static final long serialVersionUID = 4277817521578485720L;
+
 	private final List<AuthenticationExtensionsClientInput> inputs;
 	private final List<AuthenticationExtensionsClientInput> inputs;
 
 
 	public ImmutableAuthenticationExtensionsClientInputs(List<AuthenticationExtensionsClientInput> inputs) {
 	public ImmutableAuthenticationExtensionsClientInputs(List<AuthenticationExtensionsClientInput> inputs) {

+ 7 - 2
web/src/main/java/org/springframework/security/web/webauthn/api/PublicKeyCredentialDescriptor.java

@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright 2002-2024 the original author or authors.
+ * Copyright 2002-2025 the original author or authors.
  *
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * you may not use this file except in compliance with the License.
@@ -16,6 +16,8 @@
 
 
 package org.springframework.security.web.webauthn.api;
 package org.springframework.security.web.webauthn.api;
 
 
+import java.io.Serial;
+import java.io.Serializable;
 import java.util.Set;
 import java.util.Set;
 
 
 /**
 /**
@@ -29,7 +31,10 @@ import java.util.Set;
  * @author Rob Winch
  * @author Rob Winch
  * @since 6.4
  * @since 6.4
  */
  */
-public final class PublicKeyCredentialDescriptor {
+public final class PublicKeyCredentialDescriptor implements Serializable {
+
+	@Serial
+	private static final long serialVersionUID = 8793385059692676240L;
 
 
 	private final PublicKeyCredentialType type;
 	private final PublicKeyCredentialType type;
 
 

+ 7 - 2
web/src/main/java/org/springframework/security/web/webauthn/api/PublicKeyCredentialRequestOptions.java

@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright 2002-2024 the original author or authors.
+ * Copyright 2002-2025 the original author or authors.
  *
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * you may not use this file except in compliance with the License.
@@ -16,6 +16,8 @@
 
 
 package org.springframework.security.web.webauthn.api;
 package org.springframework.security.web.webauthn.api;
 
 
+import java.io.Serial;
+import java.io.Serializable;
 import java.time.Duration;
 import java.time.Duration;
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Collections;
@@ -32,7 +34,10 @@ import org.springframework.util.Assert;
  * @author Rob Winch
  * @author Rob Winch
  * @since 6.4
  * @since 6.4
  */
  */
-public final class PublicKeyCredentialRequestOptions {
+public final class PublicKeyCredentialRequestOptions implements Serializable {
+
+	@Serial
+	private static final long serialVersionUID = -2970057592835694354L;
 
 
 	private final Bytes challenge;
 	private final Bytes challenge;
 
 

+ 8 - 2
web/src/main/java/org/springframework/security/web/webauthn/api/PublicKeyCredentialType.java

@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright 2002-2024 the original author or authors.
+ * Copyright 2002-2025 the original author or authors.
  *
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * you may not use this file except in compliance with the License.
@@ -16,6 +16,9 @@
 
 
 package org.springframework.security.web.webauthn.api;
 package org.springframework.security.web.webauthn.api;
 
 
+import java.io.Serial;
+import java.io.Serializable;
+
 /**
 /**
  * The <a href=
  * The <a href=
  * "https://www.w3.org/TR/webauthn-3/#enum-credentialType">PublicKeyCredentialType</a>
  * "https://www.w3.org/TR/webauthn-3/#enum-credentialType">PublicKeyCredentialType</a>
@@ -24,7 +27,10 @@ package org.springframework.security.web.webauthn.api;
  * @author Rob Winch
  * @author Rob Winch
  * @since 6.4
  * @since 6.4
  */
  */
-public final class PublicKeyCredentialType {
+public final class PublicKeyCredentialType implements Serializable {
+
+	@Serial
+	private static final long serialVersionUID = 7025333122210061679L;
 
 
 	/**
 	/**
 	 * The only credential type that currently exists.
 	 * The only credential type that currently exists.

+ 8 - 2
web/src/main/java/org/springframework/security/web/webauthn/api/UserVerificationRequirement.java

@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright 2002-2024 the original author or authors.
+ * Copyright 2002-2025 the original author or authors.
  *
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * you may not use this file except in compliance with the License.
@@ -16,6 +16,9 @@
 
 
 package org.springframework.security.web.webauthn.api;
 package org.springframework.security.web.webauthn.api;
 
 
+import java.io.Serial;
+import java.io.Serializable;
+
 /**
 /**
  * <a href=
  * <a href=
  * "https://www.w3.org/TR/webauthn-3/#enumdef-userverificationrequirement">UserVerificationRequirement</a>
  * "https://www.w3.org/TR/webauthn-3/#enumdef-userverificationrequirement">UserVerificationRequirement</a>
@@ -24,7 +27,10 @@ package org.springframework.security.web.webauthn.api;
  * @author Rob Winch
  * @author Rob Winch
  * @since 6.4
  * @since 6.4
  */
  */
-public final class UserVerificationRequirement {
+public final class UserVerificationRequirement implements Serializable {
+
+	@Serial
+	private static final long serialVersionUID = -2801001231345540040L;
 
 
 	/**
 	/**
 	 * The <a href=
 	 * The <a href=