File tree Expand file tree Collapse file tree 4 files changed +32
-26
lines changed Expand file tree Collapse file tree 4 files changed +32
-26
lines changed Original file line number Diff line number Diff line change @@ -384,20 +384,21 @@ export const getS3Config = () => {
384
384
throw new Error ( 'S3 storage configuration is missing' )
385
385
}
386
386
387
- let credentials : S3ClientConfig [ 'credentials' ] | undefined
387
+ const s3Config : S3ClientConfig = {
388
+ region : region ,
389
+ endpoint : customURL ,
390
+ forcePathStyle : forcePathStyle
391
+ }
392
+
388
393
if ( accessKeyId && secretAccessKey ) {
389
- credentials = {
390
- accessKeyId,
391
- secretAccessKey
394
+ s3Config . credentials = {
395
+ accessKeyId : accessKeyId ,
396
+ secretAccessKey : secretAccessKey
392
397
}
393
398
}
394
399
395
- const s3Client = new S3Client ( {
396
- credentials,
397
- region,
398
- endpoint : customURL ,
399
- forcePathStyle : forcePathStyle
400
- } )
400
+ const s3Client = new S3Client ( s3Config )
401
+
401
402
return { s3Client, Bucket }
402
403
}
403
404
Original file line number Diff line number Diff line change @@ -27,14 +27,18 @@ if (USE_AWS_SECRETS_MANAGER) {
27
27
const accessKeyId = process . env . SECRETKEY_AWS_ACCESS_KEY
28
28
const secretAccessKey = process . env . SECRETKEY_AWS_SECRET_KEY
29
29
30
- let credentials : SecretsManagerClientConfig [ 'credentials' ] | undefined
30
+ const secretManagerConfig : SecretsManagerClientConfig = {
31
+ region : region
32
+ }
33
+
31
34
if ( accessKeyId && secretAccessKey ) {
32
- credentials = {
35
+ secretManagerConfig . credentials = {
33
36
accessKeyId,
34
37
secretAccessKey
35
38
}
36
39
}
37
- secretsManagerClient = new SecretsManagerClient ( { credentials, region } )
40
+
41
+ secretsManagerClient = new SecretsManagerClient ( secretManagerConfig )
38
42
}
39
43
40
44
/*
Original file line number Diff line number Diff line change @@ -76,14 +76,17 @@ if (USE_AWS_SECRETS_MANAGER) {
76
76
const accessKeyId = process . env . SECRETKEY_AWS_ACCESS_KEY
77
77
const secretAccessKey = process . env . SECRETKEY_AWS_SECRET_KEY
78
78
79
- let credentials : SecretsManagerClientConfig [ 'credentials' ] | undefined
79
+ const secretManagerConfig : SecretsManagerClientConfig = {
80
+ region : region
81
+ }
82
+
80
83
if ( accessKeyId && secretAccessKey ) {
81
- credentials = {
84
+ secretManagerConfig . credentials = {
82
85
accessKeyId,
83
86
secretAccessKey
84
87
}
85
88
}
86
- secretsManagerClient = new SecretsManagerClient ( { credentials , region } )
89
+ secretsManagerClient = new SecretsManagerClient ( secretManagerConfig )
87
90
}
88
91
89
92
export const databaseEntities : IDatabaseEntity = {
Original file line number Diff line number Diff line change @@ -25,19 +25,17 @@ if (process.env.STORAGE_TYPE === 's3') {
25
25
throw new Error ( 'S3 storage configuration is missing' )
26
26
}
27
27
28
- let credentials : S3ClientConfig [ 'credentials' ] | undefined
29
- if ( accessKeyId && secretAccessKey ) {
30
- credentials = {
31
- accessKeyId,
32
- secretAccessKey
33
- }
34
- }
35
-
36
28
const s3Config : S3ClientConfig = {
37
29
region : region ,
38
30
endpoint : customURL ,
39
- forcePathStyle : forcePathStyle ,
40
- credentials : credentials
31
+ forcePathStyle : forcePathStyle
32
+ }
33
+
34
+ if ( accessKeyId && secretAccessKey ) {
35
+ s3Config . credentials = {
36
+ accessKeyId : accessKeyId ,
37
+ secretAccessKey : secretAccessKey
38
+ }
41
39
}
42
40
43
41
s3ServerStream = new S3StreamLogger ( {
You can’t perform that action at this time.
0 commit comments