Reduce sending of kms key to minimum in requests
Signed-off-by: Bernd.Rederlechner@t-systems.com <bernd.rederlechner@t-systems.com>
This commit is contained in:
parent
f9c92477b9
commit
5809f7a7ac
|
@ -108,10 +108,12 @@ trait S3ConnectionTrait {
|
|||
if (!empty($this->sseKmsBucketKeyId)) {
|
||||
return [
|
||||
'ServerSideEncryption' => 'aws:kms',
|
||||
'BucketKeyEnabled' => true,
|
||||
];
|
||||
} elseif (!empty($this->sseKmsKeyId)) {
|
||||
return [
|
||||
'ServerSideEncryption' => 'aws:kms',
|
||||
'BucketKeyEnabled' => false,
|
||||
'SSEKMSKeyId' => $this->sseKmsKeyId,
|
||||
];
|
||||
} else {
|
||||
|
@ -127,15 +129,10 @@ trait S3ConnectionTrait {
|
|||
* @return array with encryption parameters
|
||||
*/
|
||||
public function getSseKmsGetParameters(): array {
|
||||
if (!empty($this->sseKmsBucketKeyId)) {
|
||||
if (!empty($this->sseKmsBucketKeyId) ||
|
||||
!empty($this->sseKmsKeyId)) {
|
||||
return [
|
||||
'ServerSideEncryption' => 'aws:kms',
|
||||
'SSEKMSKeyId' => $this->sseKmsBucketKeyId,
|
||||
];
|
||||
} elseif (!empty($this->sseKmsKeyId)) {
|
||||
return [
|
||||
'ServerSideEncryption' => 'aws:kms',
|
||||
'SSEKMSKeyId' => $this->sseKmsKeyId,
|
||||
];
|
||||
} else {
|
||||
return [];
|
||||
|
|
|
@ -132,7 +132,7 @@ abstract class ObjectStoreTest extends TestCase
|
|||
|
||||
$this->assertEquals('foobar', stream_get_contents($instance->readObject('target')));
|
||||
|
||||
$instance->deleteObject('source');
|
||||
$instance->deleteObject('target');
|
||||
//$instance->deleteObject('source');
|
||||
//$instance->deleteObject('target');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue