mirror of
https://github.com/nextcloud/server.git
synced 2026-04-29 01:50:33 -04:00
feat(S3): add SSE-C support in S3 External Storage
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>
This commit is contained in:
parent
baa40e6e19
commit
c25c5bbc00
2 changed files with 6 additions and 3 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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(), [
|
||||
|
|
|
|||
Loading…
Reference in a new issue