Skip to content

Commit e7ed145

Browse files
CLDSRV-636: Hardcode outscale config for container
1 parent 9cd6ec0 commit e7ed145

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

lib/Config.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,20 @@ class Config extends EventEmitter {
419419
}
420420
let kmsAWS = {};
421421

422+
if (config.kmsAWS
423+
&& !config.kmsAWS.providerName
424+
&& config.kmsAWS.endpoint
425+
&& config.kmsAWS.ak
426+
&& config.kmsAWS.sk
427+
) {
428+
// eslint-disable-next-line no-param-reassign
429+
config.kmsAWS.providerName = 'okms';
430+
}
431+
if (config.kmsAWS) {
432+
// eslint-disable-next-line no-param-reassign
433+
config.kmsAWS.noAwsArn = true;
434+
}
435+
422436
const { providerName, region, endpoint, ak, sk, tls, noAwsArn } = config.kmsAWS;
423437

424438
assert(providerName, 'Configuration Error: providerName must be defined in kmsAWS');
@@ -1518,6 +1532,14 @@ class Config extends EventEmitter {
15181532
}
15191533

15201534
_sseMigration(config) {
1535+
if (!config.sseMigration) {
1536+
// eslint-disable-next-line no-param-reassign
1537+
config.sseMigration = {
1538+
previousKeyType: KmsType.int,
1539+
previousKeyProtocol: KmsProtocol.file,
1540+
previousKeyProvider: 'scality',
1541+
};
1542+
}
15211543
if (config.sseMigration) {
15221544
/**
15231545
* For data that was encrypted internally by default and a new external provider is setup.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "s3",
3-
"version": "7.70.21-12",
3+
"version": "7.70.21-12-outscale",
44
"description": "S3 connector",
55
"main": "index.js",
66
"engines": {

tests/unit/testConfigs/parseKmsAWS.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ describe('parseKmsAWS Function', () => {
4848
endpoint: 'https://example.com',
4949
ak: 'accessKey',
5050
sk: 'secretKey',
51+
noAwsArn: true,
5152
});
5253
});
5354

@@ -68,6 +69,7 @@ describe('parseKmsAWS Function', () => {
6869
ak: 'accessKey',
6970
sk: 'secretKey',
7071
region: 'us-west-2',
72+
noAwsArn: true,
7173
});
7274
});
7375

@@ -91,6 +93,7 @@ describe('parseKmsAWS Function', () => {
9193
endpoint: 'https://example.com',
9294
ak: 'accessKey',
9395
sk: 'secretKey',
96+
noAwsArn: true,
9497
tls: {
9598
rejectUnauthorized: true,
9699
minVersion: 'TLSv1.2',

0 commit comments

Comments
 (0)