Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions lib/api/apiUtils/bucket/updateEncryption.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ function updateBucketEncryption(bucket, log, cb) {
const masterKey = sse.masterKeyId;
const configuredKey = sse.configuredMasterKeyId;

// Note: if migration is from an external to an external, absence of arn is not enough
// a comparison of arn will be necessary but config validation blocks this for now
const updateMaster = masterKey && !isScalityKmsArn(masterKey);
const updateConfigured = configuredKey && !isScalityKmsArn(configuredKey);
// Replace keys of the KMS that SSE migration moves away from
const updateMaster = masterKey && kms.isMigrationSourceKey(masterKey);
const updateConfigured = configuredKey && kms.isMigrationSourceKey(configuredKey);

if (!updateMaster && !updateConfigured) {
return cb(null, bucket);
Expand Down Expand Up @@ -87,8 +86,7 @@ function updateObjectEncryption(bucket, objMD, objectKey, log, keyArnPrefix, opt
if (opts.skipObjectUpdate) {
return cb(null, bucket, objMD);
}
return metadata.putObjectMD(bucket.getName(), objectKey, objMD, params,
log, err => cb(err, bucket, objMD));
return metadata.putObjectMD(bucket.getName(), objectKey, objMD, params, log, err => cb(err, bucket, objMD));
}

/**
Expand Down
Loading
Loading