Skip to content

Commit

Permalink
Allow overriding requestHandler in BlobStorageS3Storage (#2704)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasdax98 authored and Markus Fichtner committed Nov 7, 2024
1 parent d856f10 commit cc29953
Show file tree
Hide file tree
Showing 5 changed files with 457 additions and 434 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`
9 changes: 7 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.645.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 All @@ -44,6 +44,7 @@
"@nestjs/mapped-types": "^1.2.2",
"@nestjs/passport": "^9.0.0",
"@opentelemetry/api": "^1.9.0",
"@smithy/node-http-handler": "3.1.4",
"@types/get-image-colors": "^4.0.0",
"base64url": "^3.0.0",
"class-transformer": "^0.5.0",
Expand Down Expand Up @@ -84,7 +85,7 @@
"uuid-by-string": "^4.0.0"
},
"devDependencies": {
"@aws-sdk/types": "^3.47.0",
"@aws-sdk/types": "3.609.0",
"@comet/eslint-config": "workspace:^7.6.0",
"@golevelup/ts-jest": "^0.4.0",
"@kubernetes/client-node": "^0.18.1",
Expand Down Expand Up @@ -152,5 +153,9 @@
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org"
},
"dependenciesComments": {
"@aws-sdk/client-s3": "Fixed version necessary because of issue https://github.com/smithy-lang/smithy-typescript/issues/1443",
"@smithy/node-http-handler": "Fixed version necessary because of issue https://github.com/smithy-lang/smithy-typescript/issues/1443"
}
}
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 cc29953

Please sign in to comment.