Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

1.5 KB
Raw Blame
// Code generated by automation script, DO NOT EDIT.
// Automated by pulling database and generating zod schema
// To update. Just run npm run generate:schema
// Written by akhilmhdh.

import { z } from "zod";

import { TImmutableDBKeys } from "./models";

export const UserEncryptionKeysSchema = z.object({
  id: z.string().uuid(),
  clientPublicKey: z.string().nullable().optional(),
  serverPrivateKey: z.string().nullable().optional(),
  encryptionVersion: z.number().default(2).nullable().optional(),
  protectedKey: z.string().nullable().optional(),
  protectedKeyIV: z.string().nullable().optional(),
  protectedKeyTag: z.string().nullable().optional(),
  publicKey: z.string().nullable().optional(),
  encryptedPrivateKey: z.string().nullable().optional(),
  iv: z.string().nullable().optional(),
  tag: z.string().nullable().optional(),
  salt: z.string().nullable().optional(),
  verifier: z.string().nullable().optional(),
  userId: z.string().uuid(),
  hashedPassword: z.string().nullable().optional(),
  serverEncryptedPrivateKey: z.string().nullable().optional(),
  serverEncryptedPrivateKeyIV: z.string().nullable().optional(),
  serverEncryptedPrivateKeyTag: z.string().nullable().optional(),
  serverEncryptedPrivateKeyEncoding: z.string().nullable().optional()
});

export type TUserEncryptionKeys = z.infer<typeof UserEncryptionKeysSchema>;
export type TUserEncryptionKeysInsert = Omit<z.input<typeof UserEncryptionKeysSchema>, TImmutableDBKeys>;
export type TUserEncryptionKeysUpdate = Partial<Omit<z.input<typeof UserEncryptionKeysSchema>, TImmutableDBKeys>>;