Skip to content

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

Update sanitizedSchemas.ts

Daniel Hougaardfbfe797547c4
diff --git a/backend/src/server/routes/sanitizedSchemas.ts b/backend/src/server/routes/sanitizedSchemas.ts
index cc9dedd458..afc12c0810 100644
--- a/backend/src/server/routes/sanitizedSchemas.ts
+++ b/backend/src/server/routes/sanitizedSchemas.ts
@@ -1,6 +1,6 @@
import { z } from "zod";
-import { IntegrationAuthsSchema, SecretApprovalPoliciesSchema } from "@app/db/schemas";
+import { IntegrationAuthsSchema, SecretApprovalPoliciesSchema, UsersSchema } from "@app/db/schemas";
// sometimes the return data must be santizied to avoid leaking important values
// always prefer pick over omit in zod
@@ -28,6 +28,18 @@ export const sapPubSchema = SecretApprovalPoliciesSchema.merge(
})
);
+export const sanitizedServiceTokenUserSchema = UsersSchema.pick({
+ authMethods: true,
+ id: true,
+ createdAt: true,
+ updatedAt: true,
+ devices: true,
+ email: true,
+ firstName: true,
+ lastName: true,
+ mfaMethods: true
+});
+
export const secretRawSchema = z.object({
id: z.string(),
_id: z.string(),