From 09175e987883a4890bc17367c20a6d82a8eca35d Mon Sep 17 00:00:00 2001 From: Andrej Adamcik Date: Mon, 28 Apr 2025 05:33:29 +0100 Subject: [PATCH 1/2] feat: add encryption option to S3 (#11) --- drivers/s3/driver.ts | 1 + drivers/s3/types.ts | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/s3/driver.ts b/drivers/s3/driver.ts index 7a06cfc..7d498c8 100644 --- a/drivers/s3/driver.ts +++ b/drivers/s3/driver.ts @@ -114,6 +114,7 @@ export class S3Driver implements DriverContract { */ const s3Options: Omit = { Bucket: this.options.bucket, + ServerSideEncryption: this.options.encryption, ...rest, } diff --git a/drivers/s3/types.ts b/drivers/s3/types.ts index 29da1ba..c38a6f2 100644 --- a/drivers/s3/types.ts +++ b/drivers/s3/types.ts @@ -7,7 +7,12 @@ * file that was distributed with this source code. */ -import type { GetObjectAclCommandInput, S3Client, S3ClientConfig } from '@aws-sdk/client-s3' +import type { + GetObjectAclCommandInput, + S3Client, + S3ClientConfig, + ServerSideEncryption, +} from '@aws-sdk/client-s3' import type { ObjectVisibility } from '../../src/types.js' /** @@ -61,6 +66,11 @@ type S3DriverBaseOptions = { client: S3Client ): Promise } + + /** + * Encryption to use when uploading files to S3. + */ + encryption?: ServerSideEncryption } /** From 011621ad4c764522da10acba4bb86ae485a65519 Mon Sep 17 00:00:00 2001 From: thetutlage Date: Mon, 28 Apr 2025 11:56:58 +0000 Subject: [PATCH 2/2] chore(release): 1.2.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a926f8e..de7c7a6 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "flydrive", "description": "File storage library with unified API to manage files across multiple cloud storage providers like S3, GCS, R2 and so on", - "version": "1.1.1", + "version": "1.2.0", "engines": { "node": ">=20.6.0" },