Skip to content

Commit 7f75fd6

Browse files
committed
Test Jackson 3 deserializer with unknown obj/arr WebAuthn ext
Signed-off-by: Ziqin Wang <ziqin@wangziqin.net>
1 parent a013bfa commit 7f75fd6

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

  • webauthn/src/test/java/org/springframework/security/web/webauthn/jackson

webauthn/src/test/java/org/springframework/security/web/webauthn/jackson/JacksonTests.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,30 @@ void readCredPropsWhenAuthenticatorDisplayName() throws Exception {
121121
assertThat(outputs).usingRecursiveComparison().isEqualTo(credProps);
122122
}
123123

124+
@Test
125+
void readAuthenticationExtensionsClientOutputsWhenUnknownExtension() {
126+
String json = """
127+
{
128+
"unknownObject1": {
129+
"key": "value"
130+
},
131+
"unknownArray": [
132+
{ "key": "value1" },
133+
{ "key": "value2" }
134+
],
135+
"credProps": {
136+
"rk": false
137+
},
138+
"unknownObject2": {}
139+
}
140+
""";
141+
CredentialPropertiesOutput credProps = new CredentialPropertiesOutput(false);
142+
143+
AuthenticationExtensionsClientOutputs outputs = this.mapper.readValue(json,
144+
AuthenticationExtensionsClientOutputs.class);
145+
assertThat(outputs.getOutputs()).usingRecursiveFieldByFieldElementComparator().contains(credProps);
146+
}
147+
124148
@Test
125149
void readAuthenticationExtensionsClientOutputsWhenFieldAfter() throws Exception {
126150
String json = """

0 commit comments

Comments
 (0)