Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions apps/files_external/lib/Lib/Backend/AmazonS3.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ public function __construct(IL10N $l, AccessKey $legacyAuth) {
(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)
Expand Down
6 changes: 3 additions & 3 deletions apps/files_external/lib/Lib/Storage/AmazonS3.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ private function headObject(string $key): array|false {
$this->objectCache[$key] = $this->getConnection()->headObject([
'Bucket' => $this->bucket,
'Key' => $key
])->toArray();
] + $this->getSSECParameters())->toArray();
} catch (S3Exception $e) {
if ($e->getStatusCode() >= 500) {
throw $e;
Expand Down Expand Up @@ -207,7 +207,7 @@ public function mkdir(string $path): bool {
'Key' => $path . '/',
'Body' => '',
'ContentType' => FileInfo::MIMETYPE_FOLDER
]);
] + $this->getSSECParameters());
$this->testTimeout();
} catch (S3Exception $e) {
$this->logger->error($e->getMessage(), [
Expand Down Expand Up @@ -507,7 +507,7 @@ public function touch(string $path, ?int $mtime = null): bool {
'Body' => '',
'ContentType' => $mimeType,
'MetadataDirective' => 'REPLACE',
]);
] + $this->getSSECParameters());
$this->testTimeout();
} catch (S3Exception $e) {
$this->logger->error($e->getMessage(), [
Expand Down
2 changes: 1 addition & 1 deletion lib/private/Files/ObjectStore/S3ConnectionTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ protected function getCertificateBundlePath(): ?string {
}

protected function getSSECKey(): ?string {
if (isset($this->params['sse_c_key'])) {
if (isset($this->params['sse_c_key']) && !empty($this->params['sse_c_key'])) {
return $this->params['sse_c_key'];
}

Expand Down
Loading