@@ -44,6 +44,7 @@ trait S3ObjectTrait {
4444 abstract protected function getConnection ();
4545
4646 abstract protected function getCertificateBundlePath (): ?string ;
47+ abstract protected function getSSECParameters (): array ;
4748
4849 /**
4950 * @param string $urn the unified resource name used to identify the object
@@ -57,7 +58,7 @@ public function readObject($urn) {
5758 'Bucket ' => $ this ->bucket ,
5859 'Key ' => $ urn ,
5960 'Range ' => 'bytes= ' . $ range ,
60- ]);
61+ ] + $ this -> getSSECParameters () );
6162 $ request = \Aws \serialize ($ command );
6263 $ headers = [];
6364 foreach ($ request ->getHeaders () as $ key => $ values ) {
@@ -100,7 +101,7 @@ protected function writeSingle(string $urn, StreamInterface $stream, string $mim
100101 'Body ' => $ stream ,
101102 'ACL ' => 'private ' ,
102103 'ContentType ' => $ mimetype ,
103- ]);
104+ ] + $ this -> getSSECParameters () );
104105 }
105106
106107
@@ -119,7 +120,7 @@ protected function writeMultiPart(string $urn, StreamInterface $stream, string $
119120 'part_size ' => $ this ->uploadPartSize ,
120121 'params ' => [
121122 'ContentType ' => $ mimetype
122- ],
123+ ] + $ this -> getSSECParameters () ,
123124 ]);
124125
125126 try {
@@ -174,10 +175,10 @@ public function deleteObject($urn) {
174175 }
175176
176177 public function objectExists ($ urn ) {
177- return $ this ->getConnection ()->doesObjectExist ($ this ->bucket , $ urn );
178+ return $ this ->getConnection ()->doesObjectExist ($ this ->bucket , $ urn, $ this -> getSSECParameters () );
178179 }
179180
180181 public function copyObject ($ from , $ to ) {
181- $ this ->getConnection ()->copy ($ this ->getBucket (), $ from , $ this ->getBucket (), $ to );
182+ $ this ->getConnection ()->copy ($ this ->getBucket (), $ from , $ this ->getBucket (), $ to, ' private ' , $ this -> getSSECParameters () );
182183 }
183184}
0 commit comments