Fix WebAuthn unknown transport deserialization#19369
Open
xfocus3 wants to merge 1 commit into
Open
Conversation
Signed-off-by: Ahmed El amraouiyine <amraouiyine@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes gh-19366
AuthenticatorTransportalready preserves unknown transport names, but the Jackson deserializers returnednullfor transport strings outside the built-in constants. Registration payloads that include values such as"cable"could then fail later when the registration flow reads the transport value.This updates both Jackson 3 and Jackson 2 deserializers to delegate to
AuthenticatorTransport.valueOf(...), preserving unknown transport values while still returning the existing constants for known values.Tests:
./gradlew :spring-security-webauthn:test --tests org.springframework.security.web.webauthn.jackson.JacksonTests.readAuthenticatorTransportWhenUnknownThenPreservesValue --tests org.springframework.security.web.webauthn.jackson.Jackson2Tests.readAuthenticatorTransportWhenUnknownThenPreservesValue --no-daemon./gradlew :spring-security-webauthn:test --tests org.springframework.security.web.webauthn.jackson.JacksonTests.readAuthenticatorTransportWhenUnknownThenPreservesValue --tests org.springframework.security.web.webauthn.jackson.Jackson2Tests.readAuthenticatorTransportWhenUnknownThenPreservesValue --no-daemon./gradlew :spring-security-webauthn:test --tests org.springframework.security.web.webauthn.jackson.JacksonTests --tests org.springframework.security.web.webauthn.jackson.Jackson2Tests --no-daemon./gradlew :spring-security-webauthn:test --no-daemongit diff --check HEAD^ HEAD