Skip to content

Commit

Permalink
Allow overriding requestHandler in BlobStorageS3Storage
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasdax98 committed Nov 4, 2024
1 parent 36808d5 commit 6906be1
Show file tree
Hide file tree
Showing 5 changed files with 564 additions and 547 deletions.
5 changes: 5 additions & 0 deletions .changeset/rotten-donkeys-reply.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@comet/cms-api": patch
---

Allow overriding `requestHandler` in `BlobStorageS3Storage`
4 changes: 2 additions & 2 deletions packages/api/cms-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"test:watch": "jest --watch"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.591.0",
"@aws-sdk/client-s3": "^3.679.0",
"@azure-rest/ai-translation-text": "^1.0.0-beta.1",
"@azure/openai": "1.0.0-beta.11",
"@azure/storage-blob": "^12.23.0",
Expand Down Expand Up @@ -84,7 +84,7 @@
"uuid-by-string": "^4.0.0"
},
"devDependencies": {
"@aws-sdk/types": "^3.47.0",
"@aws-sdk/types": "^3.679.0",
"@comet/eslint-config": "workspace:^7.6.0",
"@golevelup/ts-jest": "^0.4.0",
"@kubernetes/client-node": "^0.18.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { ClientDefaults } from "@aws-sdk/client-s3";

export interface BlobStorageS3Config {
driver: "s3";
s3: {
Expand All @@ -6,5 +8,7 @@ export interface BlobStorageS3Config {
endpoint: string;
region: string;
bucket: string;

requestHandler?: ClientDefaults["requestHandler"];
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export class BlobStorageS3Storage implements BlobStorageBackendInterface {

constructor(config: BlobStorageS3Config["s3"]) {
this.client = new AWS.S3({
requestHandler: config.requestHandler,
credentials: {
accessKeyId: config.accessKeyId,
secretAccessKey: config.secretAccessKey,
Expand Down
Loading

0 comments on commit 6906be1

Please sign in to comment.