@@ -44,6 +44,7 @@ trait S3ObjectTrait {
44
44
abstract protected function getConnection ();
45
45
46
46
abstract protected function getCertificateBundlePath (): ?string ;
47
+ abstract protected function getSSECParameters (): array ;
47
48
48
49
/**
49
50
* @param string $urn the unified resource name used to identify the object
@@ -57,7 +58,7 @@ public function readObject($urn) {
57
58
'Bucket ' => $ this ->bucket ,
58
59
'Key ' => $ urn ,
59
60
'Range ' => 'bytes= ' . $ range ,
60
- ]);
61
+ ] + $ this -> getSSECParameters () );
61
62
$ request = \Aws \serialize ($ command );
62
63
$ headers = [];
63
64
foreach ($ request ->getHeaders () as $ key => $ values ) {
@@ -103,7 +104,7 @@ protected function writeSingle(string $urn, StreamInterface $stream, string $mim
103
104
'Body ' => $ stream ,
104
105
'ACL ' => 'private ' ,
105
106
'ContentType ' => $ mimetype ,
106
- ]);
107
+ ] + $ this -> getSSECParameters () );
107
108
}
108
109
109
110
@@ -122,7 +123,7 @@ protected function writeMultiPart(string $urn, StreamInterface $stream, string $
122
123
'part_size ' => $ this ->uploadPartSize ,
123
124
'params ' => [
124
125
'ContentType ' => $ mimetype
125
- ],
126
+ ] + $ this -> getSSECParameters () ,
126
127
]);
127
128
128
129
try {
@@ -177,10 +178,10 @@ public function deleteObject($urn) {
177
178
}
178
179
179
180
public function objectExists ($ urn ) {
180
- return $ this ->getConnection ()->doesObjectExist ($ this ->bucket , $ urn );
181
+ return $ this ->getConnection ()->doesObjectExist ($ this ->bucket , $ urn, $ this -> getSSECParameters () );
181
182
}
182
183
183
184
public function copyObject ($ from , $ to ) {
184
- $ this ->getConnection ()->copy ($ this ->getBucket (), $ from , $ this ->getBucket (), $ to );
185
+ $ this ->getConnection ()->copy ($ this ->getBucket (), $ from , $ this ->getBucket (), $ to, ' private ' , $ this -> getSSECParameters () );
185
186
}
186
187
}
0 commit comments