diff --git a/src/utils/AwskmsUtils.ts b/src/utils/AwskmsUtils.ts index 356633232..3c21611fd 100644 --- a/src/utils/AwskmsUtils.ts +++ b/src/utils/AwskmsUtils.ts @@ -1,11 +1,12 @@ +/* eslint-disable prettier/prettier */ import { GetObjectCommand, S3Client } from "@aws-sdk/client-s3"; import * as KMS from "@aws-sdk/client-kms"; import fs from "fs"; export interface KeyConfig { keyID: string; - accessKeyId: string; - secretAccessKey: string; + accessKeyId?: string; + secretAccessKey?: string; region: string; bucketName: string; fileKey: string; @@ -22,6 +23,11 @@ interface AwsS3StorageConfig { key: string; } +interface AWSClientConfig { + region: string; + credentials?: { accessKeyId: string; secretAccessKey: string }; +} + const { AWS_S3_STORAGE_CONFIG } = process.env; const storageConfig: AwsS3StorageConfig = AWS_S3_STORAGE_CONFIG ? JSON.parse(AWS_S3_STORAGE_CONFIG) : undefined; @@ -30,13 +36,18 @@ async function downloadEncryptedKey(config: KeyConfig): Promise