make protectedKey protectedKeyIV protectedKeyTag nullable

This commit is contained in:
Maidul Islam
2024-01-27 12:40:36 +05:30
committed by Akhil Mohan
parent 86ba6355cf
commit 83bff9ae14
4 changed files with 10 additions and 10 deletions
@@ -12,9 +12,9 @@ export const UserEncryptionKeysSchema = z.object({
clientPublicKey: z.string().nullable().optional(), clientPublicKey: z.string().nullable().optional(),
serverPrivateKey: z.string().nullable().optional(), serverPrivateKey: z.string().nullable().optional(),
encryptionVersion: z.number().default(2).nullable().optional(), encryptionVersion: z.number().default(2).nullable().optional(),
protectedKey: z.string(), protectedKey: z.string().nullable(),
protectedKeyIV: z.string(), protectedKeyIV: z.string().nullable(),
protectedKeyTag: z.string(), protectedKeyTag: z.string().nullable(),
publicKey: z.string(), publicKey: z.string(),
encryptedPrivateKey: z.string(), encryptedPrivateKey: z.string(),
iv: z.string(), iv: z.string(),
@@ -188,7 +188,7 @@ export const registerPasswordRouter = async (server: FastifyZodProvider) => {
); );
if (!backupPrivateKey) throw new Error("Failed to find backup key"); if (!backupPrivateKey) throw new Error("Failed to find backup key");
return { message: "Successfully updated backup private key", backupPrivateKey }; return { message: "Successfully fetched backup private key", backupPrivateKey };
} }
}); });
@@ -56,9 +56,9 @@ export const registerMfaRouter = async (server: FastifyZodProvider) => {
response: { response: {
200: z.object({ 200: z.object({
encryptionVersion: z.number().default(1).nullable().optional(), encryptionVersion: z.number().default(1).nullable().optional(),
protectedKey: z.string(), protectedKey: z.string().nullable(),
protectedKeyIV: z.string(), protectedKeyIV: z.string().nullable(),
protectedKeyTag: z.string(), protectedKeyTag: z.string().nullable(),
publicKey: z.string(), publicKey: z.string(),
encryptedPrivateKey: z.string(), encryptedPrivateKey: z.string(),
iv: z.string(), iv: z.string(),
@@ -52,9 +52,9 @@ export const registerLoginRouter = async (server: FastifyZodProvider) => {
z.object({ z.object({
mfaEnabled: z.literal(false), mfaEnabled: z.literal(false),
encryptionVersion: z.number().default(1).nullable().optional(), encryptionVersion: z.number().default(1).nullable().optional(),
protectedKey: z.string(), protectedKey: z.string().nullable(),
protectedKeyIV: z.string(), protectedKeyIV: z.string().nullable(),
protectedKeyTag: z.string(), protectedKeyTag: z.string().nullable(),
publicKey: z.string(), publicKey: z.string(),
encryptedPrivateKey: z.string(), encryptedPrivateKey: z.string(),
iv: z.string(), iv: z.string(),