The diff can be checked using: git diff --ignore-all-space --ignore-blank-lines
To see only the changes not related to blank lines.
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Replace assertTrue(true), addToAssertionCount(1) and delete-without-assert
patterns with meaningful assertions or proper test removal.
Signed-off-by: Anna Larch <anna@nextcloud.com>
AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Eight test classes overrode tearDown() for custom DB cleanup but never
called parent::tearDown(). TestCase::tearDown() does three things these
tests were silently skipping after every test method:
- ILockingProvider::releaseAll() — unreleased locks bleed into subsequent
tests and can cause deadlocks or unexpected NotFoundException
- Storage::getGlobalCache()->clearCache() — stale filecache entries from
share/storage tests cause unrelated ObjectStore tests to receive false
from fopen() (fseek() then fails with "Argument must be of type resource")
- UserMountCache::flush() — stale mount cache causes share lookups in
later tests to fail with ShareNotFound
AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Anna Larch <anna@nextcloud.com>
AWS SDK PHP v3.339.0+ introduced a breaking change requiring the Content-MD5
header for DeleteObjects operations. This causes 'MissingContentMD5' errors when
using S3-compatible services like MinIO.
Add middleware to automatically calculate and inject the Content-MD5 header on
all DeleteObjects requests. This is applied universally at the S3ConnectionTrait
level, fixing both external storage (AmazonS3) and core ObjectStore (S3) classes.
Fixes: https://github.com/aws/aws-sdk-php/issues/3068
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Add support for Server-Side Encryption with AWS Key Management Service
(SSE-KMS) for S3 object storage. This allows Nextcloud to encrypt data
at rest in S3 using AWS-managed keys.
Key features:
- New config options: sse_kms_enabled and sse_kms_key_id
- Backward compatible with existing SSE-C (customer-provided keys)
- SSE-C takes precedence when both SSE-C and SSE-KMS are configured
Implementation details:
- Added getServerSideEncryptionParameters() method to centralize
encryption parameter logic for both SSE-C and SSE-KMS
- Updated multipart uploads to use unified encryption parameters
- Added comprehensive PHPUnit tests for SSE-KMS scenarios
- Tested with AWS bucket and KMS keys in us-east-1 region
Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Stephen Cuppett <steve@cuppett.com>
Our interface contract (and implementations) in IStorage are:
`public function touch(string $path, ?int $mtime = null): bool {`
This wasn't always the case but it is today, so testTouchFloat() no longer makes sense; it's not testing our code, just PHP.
Signed-off-by: Josh <josh.t.richards@gmail.com>
This has been implicitely deprecated for a while with Share20 containing
the new implementation.
The only use was to determine whether remote sharing was enabled or not,
which we can do much more easily.
Signed-off-by: Carl Schwan <carlschwan@kde.org>
Fix possible dead locks when running the propagator caused by two
requests updating the same amount rows in transactions.
- Lock rows always in the same deterministic order by sorting the
path_hash first
- On all database outside of sqlite, also do first a SELECT FOR UPDATE
to lock all the rows used in batch UPDATE calls, afterward to decrease
the risk of two requests trying to lock the same rows
Signed-off-by: Carl Schwan <carlschwan@kde.org>