@@ -43,6 +43,8 @@ trait S3ObjectTrait {
43
43
*/
44
44
abstract protected function getConnection ();
45
45
46
+ abstract protected function getSSECParameters (): array ;
47
+
46
48
/**
47
49
* @param string $urn the unified resource name used to identify the object
48
50
* @return resource stream with the read data
@@ -55,7 +57,7 @@ public function readObject($urn) {
55
57
'Bucket ' => $ this ->bucket ,
56
58
'Key ' => $ urn ,
57
59
'Range ' => 'bytes= ' . $ range ,
58
- ]);
60
+ ] + $ this -> getSSECParameters () );
59
61
$ request = \Aws \serialize ($ command );
60
62
$ headers = [];
61
63
foreach ($ request ->getHeaders () as $ key => $ values ) {
@@ -95,7 +97,7 @@ protected function writeSingle(string $urn, StreamInterface $stream, string $mim
95
97
'Body ' => $ stream ,
96
98
'ACL ' => 'private ' ,
97
99
'ContentType ' => $ mimetype ,
98
- ]);
100
+ ] + $ this -> getSSECParameters () );
99
101
}
100
102
101
103
@@ -114,7 +116,7 @@ protected function writeMultiPart(string $urn, StreamInterface $stream, string $
114
116
'part_size ' => $ this ->uploadPartSize ,
115
117
'params ' => [
116
118
'ContentType ' => $ mimetype
117
- ],
119
+ ] + $ this -> getSSECParameters () ,
118
120
]);
119
121
120
122
try {
@@ -169,10 +171,10 @@ public function deleteObject($urn) {
169
171
}
170
172
171
173
public function objectExists ($ urn ) {
172
- return $ this ->getConnection ()->doesObjectExist ($ this ->bucket , $ urn );
174
+ return $ this ->getConnection ()->doesObjectExist ($ this ->bucket , $ urn, $ this -> getSSECParameters () );
173
175
}
174
176
175
177
public function copyObject ($ from , $ to ) {
176
- $ this ->getConnection ()->copy ($ this ->getBucket (), $ from , $ this ->getBucket (), $ to );
178
+ $ this ->getConnection ()->copy ($ this ->getBucket (), $ from , $ this ->getBucket (), $ to, ' private ' , $ this -> getSSECParameters () );
177
179
}
178
180
}
0 commit comments