aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Becker <christian@dabecka.de>2025-01-22 23:43:08 +0100
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2025-01-31 12:01:09 +0000
commit5b51e1b0dc38260b9514bb4ad73b436def17c613 (patch)
tree00e85e024a35a7b0a43dbd1697a868575c1c57ec
parentd0da4db9751096ff14cdc9b23bffb9ead78fab97 (diff)
downloadnextcloud-server-backport/50514/stable31.tar.gz
nextcloud-server-backport/50514/stable31.zip
feat(S3): add SSE-C support in S3 External Storagebackport/50514/stable31
Just need to add the parameter and fix two calls. All other logic is already implemented and implicitly called through the S3ConnectionTrait fixes #33283 Signed-off-by: Christian Becker <christian@dabecka.de> Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
-rw-r--r--apps/files_external/lib/Lib/Backend/AmazonS3.php3
-rw-r--r--apps/files_external/lib/Lib/Storage/AmazonS3.php6
2 files changed, 6 insertions, 3 deletions
diff --git a/apps/files_external/lib/Lib/Backend/AmazonS3.php b/apps/files_external/lib/Lib/Backend/AmazonS3.php
index e345ed53f70..f71ca40cdfc 100644
--- a/apps/files_external/lib/Lib/Backend/AmazonS3.php
+++ b/apps/files_external/lib/Lib/Backend/AmazonS3.php
@@ -41,6 +41,9 @@ class AmazonS3 extends Backend {
(new DefinitionParameter('useMultipartCopy', $l->t('Enable multipart copy')))
->setType(DefinitionParameter::VALUE_BOOLEAN)
->setDefaultValue(true),
+ (new DefinitionParameter('sse_c_key', $l->t('SSE-C encryption key')))
+ ->setType(DefinitionParameter::VALUE_PASSWORD)
+ ->setFlag(DefinitionParameter::FLAG_OPTIONAL),
])
->addAuthScheme(AccessKey::SCHEME_AMAZONS3_ACCESSKEY)
->addAuthScheme(AuthMechanism::SCHEME_NULL)
diff --git a/apps/files_external/lib/Lib/Storage/AmazonS3.php b/apps/files_external/lib/Lib/Storage/AmazonS3.php
index 03a365fd559..1a866e8c22b 100644
--- a/apps/files_external/lib/Lib/Storage/AmazonS3.php
+++ b/apps/files_external/lib/Lib/Storage/AmazonS3.php
@@ -113,7 +113,7 @@ class AmazonS3 extends Common {
$this->objectCache[$key] = $this->getConnection()->headObject([
'Bucket' => $this->bucket,
'Key' => $key
- ])->toArray();
+ ] + $this->getSSECParameters())->toArray();
} catch (S3Exception $e) {
if ($e->getStatusCode() >= 500) {
throw $e;
@@ -207,7 +207,7 @@ class AmazonS3 extends Common {
'Key' => $path . '/',
'Body' => '',
'ContentType' => FileInfo::MIMETYPE_FOLDER
- ]);
+ ] + $this->getSSECParameters());
$this->testTimeout();
} catch (S3Exception $e) {
$this->logger->error($e->getMessage(), [
@@ -507,7 +507,7 @@ class AmazonS3 extends Common {
'Body' => '',
'ContentType' => $mimeType,
'MetadataDirective' => 'REPLACE',
- ]);
+ ] + $this->getSSECParameters());
$this->testTimeout();
} catch (S3Exception $e) {
$this->logger->error($e->getMessage(), [