This commit is contained in:
David Nguyen
2025-01-31 14:09:02 +11:00
parent f7a98180d7
commit d7d0fca501
146 changed files with 1250 additions and 1263 deletions

View File

@ -1,5 +1,7 @@
import { match } from 'ts-pattern';
import { env } from '@documenso/lib/utils/env';
import { signWithGoogleCloudHSM } from './transports/google-cloud-hsm';
import { signWithLocalCert } from './transports/local-cert';
@ -8,7 +10,7 @@ export type SignOptions = {
};
export const signPdf = async ({ pdf }: SignOptions) => {
const transport = process.env.NEXT_PRIVATE_SIGNING_TRANSPORT || 'local';
const transport = env('NEXT_PRIVATE_SIGNING_TRANSPORT') || 'local';
return await match(transport)
.with('local', async () => signWithLocalCert({ pdf }))