Files
calendar/packages/prisma/selects/credential.ts
T
Alex van AndelandGitHub fc9c26e8dd feat: add encryptedKey column to Credential table for calendar integrations (#27154)
Adds encrypted credential storage using a new keyring system:
  - New `encryptedKey` column with AES-256-GCM encryption
  - Decryption in getCalendarsEvents with fallback to legacy `key`
  - buildCredentialCreateData service for credential creation
  - Phase 1: Google Calendar only, other integrations follow
2026-01-30 09:15:13 -03:00

37 lines
679 B
TypeScript

import type { Prisma } from "../client";
export const credentialForCalendarServiceSelect = {
id: true,
appId: true,
type: true,
userId: true,
user: {
select: {
email: true,
},
},
teamId: true,
key: true,
encryptedKey: true,
invalid: true,
delegationCredentialId: true,
} satisfies Prisma.CredentialSelect;
export const safeCredentialSelect = {
id: true,
type: true,
/** Omitting to avoid frontend leaks */
// key: true,
// encryptedKey: true,
userId: true,
user: {
select: {
email: true,
},
},
teamId: true,
appId: true,
invalid: true,
delegationCredentialId: true,
} satisfies Prisma.CredentialSelect;