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
This commit is contained in:
Alex van Andel authored and GitHub committed 2026-01-30 09:15:13 -03:00
1 parent 80e4b1af1f
commit fc9c26e8dd
36 files changed
+308 -34

No files matched your search

@@ -41,6 +41,7 @@ export const calendarOverlayHandler = async ({ ctx, input }: ListOptions) => {
id: true,
type: true,
key: true,
encryptedKey: true,
userId: true,
teamId: true,
appId: true,
@@ -127,6 +127,7 @@ export const getHostsWithLocationOptionsHandler = async ({
credentials: host.user.credentials.map((cred) => ({
...cred,
key: {} as Prisma.JsonValue,
encryptedKey: null,
})),
}));