fix(schema): preserve WebAuthn payloads and align fixtures (#2710)

This commit is contained in:
Hampus authored and GitHub committed 2026-09-12 00:19:44 +02:00
1 parent de1fd95a99
commit adab646d1e
8 files changed
+193 -15

No files matched your search

+1
View File
@@ -18,6 +18,7 @@ interface SchemaMetadata {
openEnum?: boolean;
bitflagValues?: Array<BitflagEntry>;
format?: string;
preserveEmptyValues?: boolean;
}
export const schemaMetadata = z.registry<SchemaMetadata>();
@@ -1,3 +1,4 @@
import {schemaMetadata} from '@fluxer/schema/src/SchemaMetadata';
import type {
AuthenticationResponseJSON,
PublicKeyCredentialRequestOptionsJSON,
@@ -26,7 +27,7 @@ export const WebAuthnAuthenticationResponse = WebAuthnCredentialBase.extend({
signature: z.string(),
userHandle: z.string().optional(),
}),
}) satisfies z.ZodType<AuthenticationResponseJSON>;
}).register(schemaMetadata, {preserveEmptyValues: true}) satisfies z.ZodType<AuthenticationResponseJSON>;
export const WebAuthnRegistrationResponse = WebAuthnCredentialBase.extend({
response: z.looseObject({
@@ -37,7 +38,7 @@ export const WebAuthnRegistrationResponse = WebAuthnCredentialBase.extend({
publicKeyAlgorithm: z.number().int().optional(),
publicKey: z.string().optional(),
}),
}) satisfies z.ZodType<RegistrationResponseJSON>;
}).register(schemaMetadata, {preserveEmptyValues: true}) satisfies z.ZodType<RegistrationResponseJSON>;
export const WebAuthnAuthenticationOptions = z.looseObject({
challenge: z.string(),