feat: sanitized project schema on routes to avoid exposing encrypted keys

This commit is contained in:
=
2024-07-30 23:19:31 +05:30
parent b37f780c4c
commit 844a4ebc02
5 changed files with 42 additions and 35 deletions
@@ -5,6 +5,7 @@ import {
IdentityProjectAdditionalPrivilegeSchema,
IntegrationAuthsSchema,
ProjectRolesSchema,
ProjectsSchema,
SecretApprovalPoliciesSchema,
UsersSchema
} from "@app/db/schemas";
@@ -141,3 +142,18 @@ export const SanitizedAuditLogStreamSchema = z.object({
createdAt: z.date(),
updatedAt: z.date()
});
export const SanitizedProjectSchema = ProjectsSchema.pick({
id: true,
name: true,
slug: true,
autoCapitalization: true,
orgId: true,
createdAt: true,
updatedAt: true,
version: true,
upgradeStatus: true,
pitVersionLimit: true,
kmsCertificateKeyId: true,
auditLogsRetentionDays: true
});