-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add prisma-field-encryption to api
- Loading branch information
Showing
7 changed files
with
111 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 15 additions & 8 deletions
23
libs/api/core/data-access/src/lib/api-core-prisma-client.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,20 @@ | ||
import { PrismaClient } from '@prisma/client' | ||
import { pagination } from 'prisma-extension-pagination' | ||
import { fieldEncryptionExtension } from 'prisma-field-encryption' | ||
|
||
export const prismaClient = new PrismaClient().$extends( | ||
pagination({ | ||
pages: { | ||
includePageCount: true, | ||
limit: 10, | ||
}, | ||
}), | ||
) | ||
export const prismaClient = new PrismaClient() | ||
.$extends( | ||
fieldEncryptionExtension({ | ||
encryptionKey: process.env['CLOAK_MASTER_KEY'], | ||
}), | ||
) | ||
.$extends( | ||
pagination({ | ||
pages: { | ||
includePageCount: true, | ||
limit: 10, | ||
}, | ||
}), | ||
) | ||
|
||
export type ApiCorePrismaClient = typeof prismaClient |
2 changes: 1 addition & 1 deletion
2
libs/api/core/data-access/src/lib/api-core-provision.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters