Skip to content

Commit 407a34c

Browse files
CLDSRV-636: Allow previous KMS for MPU parts
1 parent cd71f01 commit 407a34c

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

lib/api/objectPutPart.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,9 @@ function objectPutPart(authInfo, request, streamingV4Params, log,
209209
return next(err, destinationBucket);
210210
}
211211
return next(null, destinationBucket, objectLocationConstraint, res, splitter);
212-
});
212+
// Allow KMS to use a key from previous provider (if sseMigration configured)
213+
// Because ongoing MPU started before sseMigration is no migrated
214+
}, { previousOk: true });
213215
}
214216
// The MPU does not have server-side encryption, so pass `null`
215217
return next(null, destinationBucket, objectLocationConstraint, null, splitter);

lib/kms/wrapper.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,11 +319,13 @@ class KMS {
319319
* true for mandatory encryption
320320
* @param {object} log - logger object
321321
* @param {function} cb - cb from external call
322+
* @param {object} [opts] - additional options
323+
* @param {boolean} [opts.previousOk] - allow usage of previous KMS (for ongoing MPU not migrated)
322324
* @returns {undefined}
323325
* @callback called with (err, cipherBundle)
324326
*/
325327
static createCipherBundle(serverSideEncryptionInfo,
326-
log, cb) {
328+
log, cb, opts) {
327329
const { algorithm, configuredMasterKeyId, masterKeyId: bucketMasterKeyId } = serverSideEncryptionInfo;
328330

329331
let masterKeyId = bucketMasterKeyId;
@@ -341,6 +343,7 @@ class KMS {
341343
if (previousIdentifier
342344
&& clientIdentifier === previousIdentifier
343345
&& clientIdentifier !== currentIdentifier
346+
&& (opts && !opts.previousOk)
344347
) {
345348
return cb(errors.InvalidArgument
346349
.customizeDescription(

0 commit comments

Comments
 (0)