Commit graph

6524 commits

Author SHA1 Message Date
Kate
8948e923e8
Merge pull request #61169 from nextcloud/test/parent-setup
test: Add missing calls to the parent setUp method
2026-06-10 22:12:55 +02:00
provokateurin
405d250aef
test: Add missing calls to the parent setUp method
Signed-off-by: provokateurin <kate@provokateurin.de>
2026-06-10 18:07:52 +02:00
Louis
250635a9a8
Merge pull request #61150 from nextcloud/carl/speedup-tests
Speedup tests execution
2026-06-10 17:23:13 +02:00
Louis Chmn
6bb9ad60f2
test(View): Setup users and groups once
Signed-off-by: Louis Chmn <louis@chmn.me>
2026-06-10 15:48:24 +02:00
Carl Schwan
8bff1b4968
perf(UserConfigTest): Don't recreate database between invocation
Signed-off-by: Carl Schwan <carlschwan@kde.org>
2026-06-10 15:48:24 +02:00
Louis Chmn
442777762d
test(App): Setup users and groups once
Signed-off-by: Louis Chmn <louis@chmn.me>
2026-06-10 15:48:24 +02:00
Carl Schwan
3b7ca63f43
perf(AppConfigIntegrationTest): Avoid creating too many times AppConfig
Reuse instance by merging some tests based on DataProviders

Signed-off-by: Carl Schwan <carlschwan@kde.org>
2026-06-10 12:17:08 +02:00
Carl Schwan
0fee41df7c
perf: Test chunking with a lower amount of entries
Use a lower array_chunk values when running the code in the tests for
the comment manager.

Signed-off-by: Carl Schwan <carlschwan@kde.org>
2026-06-10 11:49:29 +02:00
Carl Schwan
84a8b7e50e
perf(tests): Cache encryption result in UserConfigTest
So that we don't need to encrypt stuff all the time.

Signed-off-by: Carl Schwan <carlschwan@kde.org>
2026-06-10 11:22:59 +02:00
Carl Schwan
126df9c170
perf(tests): Don't encrypt the same value each time
We have a static class, so we can save the results accross the > 100
tests cases in this class.

Signed-off-by: Carl Schwan <carlschwan@kde.org>
2026-06-10 11:19:22 +02:00
Stephan Orbaugh
9fe944199b
Merge pull request #60709 from nextcloud/test-speedup
Speedup share tests
2026-06-09 16:23:41 +02:00
Anna
d45d1d6bff
Merge pull request #60735 from nextcloud/fix/noid/crypto-decrypt-fallback-valueerror
fix(security): don't propagate ValueError from Crypto::decrypt() fallback
2026-06-09 15:14:44 +02:00
Robin Appelman
1f96118ef9 test: cleanup users before userbackend test
Signed-off-by: Robin Appelman <robin@icewind.nl>
2026-06-08 15:40:03 +02:00
Robin Appelman
6100590516 fix: remove trait property conflict
Signed-off-by: Robin Appelman <robin@icewind.nl>
2026-06-08 15:35:08 +02:00
Robin Appelman
9651860720 test: add test trait for creating temporary groups
Signed-off-by: Robin Appelman <robin@icewind.nl>
2026-06-08 15:35:08 +02:00
Tobias Kaminsky
3279c40632
Merge pull request #60953 from nextcloud/carl/IInstanceFactory
chore: Remove unused and long deprecated Remote components
2026-06-03 14:50:19 +02:00
Carl Schwan
8b56c4c93d
chore: Remove unused and long deprecated Remote components
Signed-off-by: Carl Schwan <carlschwan@kde.org>
2026-06-03 10:36:41 +02:00
Ferdinand Thiessen
b27e4956d1 refactor(NavigationManager): move navigation definitions into apps
The manager itself does not need to know what hardcoded-things an app provides,
instead the apps itself should handle this.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2026-06-02 22:51:05 +02:00
Carl Schwan
bbbdf47f36
Merge pull request #60881 from nextcloud/jtr/test-fix-cache-ordering-assumption
test(cache): avoid ordering assumptions in testExtended
2026-06-02 13:56:23 +02:00
Benjamin Gaussorgues
a8428f883d
Merge pull request #59002 from nextcloud/fix/remove-static-vars
Remove usage of static vars or properties
2026-06-02 11:28:20 +02:00
Carl Schwan
b7ee8e7545
Merge pull request #59813 from nextcloud/fix/noid/fix-owncloud-group-share-rename
fix(sharing): set STATUS_ACCEPTED when creating USERGROUP subshare on…
2026-06-02 11:14:13 +02:00
Côme Chilliet
a62bff17f2
fix: Fix suppressing ImpureStaticProperty and suppress it in a few places
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2026-06-02 09:46:18 +02:00
Côme Chilliet
2ef982d402
fix: Fix TemplateLayout tests
The behaviour of getAppNameFromPath is really different from what was
 mocked, so I’m not sure whether the class behaves as initially
 intended. I adapted the test to match the class behavior for now.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2026-06-02 09:46:17 +02:00
provokateurin
80ec3b1b0a
fix(MailPlugin): Stop applying the offset twice and the limit per wide/exact
Signed-off-by: provokateurin <kate@provokateurin.de>
2026-06-01 14:24:01 +02:00
provokateurin
5c21fb5062
perf(MailPlugin): Optimize checking group memberships
Signed-off-by: provokateurin <kate@provokateurin.de>
2026-06-01 14:22:45 +02:00
provokateurin
d92aac8f7d
fix(MailPlugin): Use correct type for exact id match
Signed-off-by: provokateurin <kate@provokateurin.de>
2026-06-01 14:22:45 +02:00
Josh
c7fabc4654 test(cache): avoid ordering assumptions in testExtended
Signed-off-by: Josh <josh.t.richards@gmail.com>
2026-06-01 14:22:30 +02:00
Côme Chilliet
1ab09ec753
chore: Apply new coding standard to all files
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>
2026-06-01 13:46:39 +02:00
Benjamin Gaussorgues
d67eae3501
feat(jobs): add command to list executed background jobs
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
2026-05-29 14:09:06 +02:00
Benjamin Gaussorgues
4ee75168d5
feat(jobs): allow to keep track of job executions
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
2026-05-29 09:14:49 +02:00
Benjamin Gaussorgues
8db8776f2d
feat(jobs): introduce background job classes registry
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
2026-05-29 09:14:48 +02:00
Anna
e29038414d
Merge pull request #59677 from nextcloud/fix/57340/owncloud-migration-appconfig-userconfig
fix(appconfig,userconfig): restore pre-migration fallback for ownCloud migration
2026-05-28 20:42:29 +02:00
Anna
781eb630c4
Merge pull request #60751 from nextcloud/fix/noid/checkbox-tests-share20
test(share20): replace addToAssertionCount checkbox tests in Share20 ManagerTest
2026-05-28 15:59:35 +02:00
Stephan Orbaugh
72f5eea531
Merge pull request #60734 from nextcloud/feat/user/avatar-url-getters
feat(UserManager): Add getters for avatar URLs
2026-05-28 15:51:42 +02:00
Stephan Orbaugh
4cad192bcd
Merge pull request #60102 from nextcloud/automated/noid/rector-changes 2026-05-28 12:31:17 +02:00
Anna Larch
b2c9273e5f fix(appconfig,userconfig): restore pre-migration fallback for ownCloud migration
AppConfig and UserConfig unconditionally queried NC-only columns (type,
lazy, flags, indexed) that don't exist in ownCloud's database schema,
breaking ownCloud → Nextcloud upgrades entirely before the schema
migration steps could run.

Restore the fallback pattern in both classes: on first loadConfig() call,
if a DBException with REASON_INVALID_FIELD_NAME is thrown, set
$migrationCompleted = false and retry selecting only the columns present
in ownCloud's schema. INSERT and UPDATE statements also omit NC-only
columns when $migrationCompleted is false.

The catch block also guards against infinite recursion: if $migrationCompleted
is already false when the exception fires, the exception is re-thrown
instead of triggering another recursive call.

Fixes: https://github.com/nextcloud/server/issues/57340

Signed-off-by: Anna Larch <anna@nextcloud.com>
AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 09:46:49 +02:00
Anna
f67b908c42
Merge pull request #60742 from nextcloud/test/noid/remove-checkbox-tests
Some checks are pending
Integration sqlite / changes (push) Waiting to run
Integration sqlite / integration-sqlite (master, main, 8.4, main, --tags ~@large files_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, main, 8.4, main, capabilities_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, main, 8.4, main, collaboration_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, main, 8.4, main, comments_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, main, 8.4, main, dav_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, main, 8.4, main, features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, main, 8.4, main, federation_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, main, 8.4, main, file_conversions) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, main, 8.4, main, files_reminders) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, main, 8.4, main, filesdrop_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, main, 8.4, main, guests_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, main, 8.4, main, ldap_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, main, 8.4, main, openldap_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, main, 8.4, main, openldap_numerical_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, main, 8.4, main, remoteapi_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, main, 8.4, main, routing_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, main, 8.4, main, setup_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, main, 8.4, main, sharees_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, main, 8.4, main, sharing_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, main, 8.4, main, theming_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, main, 8.4, main, videoverification_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite-summary (push) Blocked by required conditions
Psalm static code analysis / changes (push) Waiting to run
Psalm static code analysis / static-code-analysis (push) Blocked by required conditions
Psalm static code analysis / static-code-analysis-security (push) Blocked by required conditions
Psalm static code analysis / static-code-analysis-ocp (push) Blocked by required conditions
Psalm static code analysis / static-code-analysis-ncu (push) Blocked by required conditions
Psalm static code analysis / static-code-analysis-strict (push) Blocked by required conditions
Psalm static code analysis / static-code-analysis-summary (push) Blocked by required conditions
test: replace checkbox assertions with real assertions or DoesNotPerformAssertions
2026-05-27 19:47:57 +02:00
Micke Nordin
5ffde0370b
Merge pull request #60136 from nextcloud/kano-dual-stack-rfc-9421-http-sig
Some checks are pending
Integration sqlite / changes (push) Waiting to run
Integration sqlite / integration-sqlite (master, main, 8.4, main, --tags ~@large files_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, main, 8.4, main, capabilities_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, main, 8.4, main, collaboration_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, main, 8.4, main, comments_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, main, 8.4, main, dav_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, main, 8.4, main, features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, main, 8.4, main, federation_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, main, 8.4, main, file_conversions) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, main, 8.4, main, files_reminders) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, main, 8.4, main, filesdrop_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, main, 8.4, main, guests_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, main, 8.4, main, ldap_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, main, 8.4, main, openldap_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, main, 8.4, main, openldap_numerical_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, main, 8.4, main, remoteapi_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, main, 8.4, main, routing_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, main, 8.4, main, setup_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, main, 8.4, main, sharees_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, main, 8.4, main, sharing_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, main, 8.4, main, theming_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (master, main, 8.4, main, videoverification_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite-summary (push) Blocked by required conditions
Psalm static code analysis / changes (push) Waiting to run
Psalm static code analysis / static-code-analysis (push) Blocked by required conditions
Psalm static code analysis / static-code-analysis-security (push) Blocked by required conditions
Psalm static code analysis / static-code-analysis-ocp (push) Blocked by required conditions
Psalm static code analysis / static-code-analysis-ncu (push) Blocked by required conditions
Psalm static code analysis / static-code-analysis-strict (push) Blocked by required conditions
Psalm static code analysis / static-code-analysis-summary (push) Blocked by required conditions
feat(http-sig): Dual stack http-sig
2026-05-27 15:59:52 +02:00
Anna Larch
0bb8081842 test(share20): replace addToAssertionCount checkbox tests in Share20 ManagerTest
Signed-off-by: Anna Larch <anna@nextcloud.com>
AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 12:22:02 +02:00
Anna Larch
18c5c0711e test: remove no-op checkbox assertions
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>
2026-05-27 12:12:44 +02:00
Kate
f1915e0dd4
Merge pull request #60744 from nextcloud/test/noid/phpunit-db-test-isolation
test(db): call parent::tearDown() in DB test classes that skipped it
2026-05-27 11:37:51 +02:00
Micke Nordin
cc9e0ba582 fix(http-sig): make setSignature public and skip third-party-dependent test
Two CI failures introduced by the test additions in this PR:

1. testEd25519VerifyAcceptedWhenSodiumLoaded calls setSignature() to inject
   an externally-produced Ed25519 signature (since Algorithm::sign() rejects
   Ed25519 by design). setSignature was declared protected, so the test
   couldn't call it from outside the class hierarchy. Make it public —
   SignedRequest lives in the OC\ private namespace, so this widens
   internal-only visibility, not the public API surface.

2. testParseKeyRejectsContradictoryAlg expected firebase/php-jwt's
   JWK::parseKey() to throw on a kty=OKP/crv=Ed25519/alg=ES256 key. The
   current firebase/php-jwt version does not validate that coherence at
   parse time, so the test now fails to see any throwable. The actual
   security check happens at Algorithm::verify() time and is covered by
   testVerifyEd25519KeyAgainstES256Alg right above it. Skip the parse-time
   test with a comment pointing at the verify-time coverage.

Signed-off-by: Micke Nordin <kano@sunet.se>
2026-05-27 11:03:55 +02:00
Micke Nordin
1bad4fe238 fix: Make sodium optional
This commit switches the default signature algorithm to
ecdsa-p256-sha256 instead of Ed25519. This allows us to make sodium
optional again, and we only pull it in to use it for verifying incomming
signatures. If sodium is not installed, we throw on Ed25519 signatures
instead. At least it is easy for most people to make their Nextcloud
install fully RFC compliant by installing sodium.

I also renamed all the Ed25519 function names to be more precis, using
Jwks for the JSON Web Keys, and RFC9421 for the http-signature code,
where it is needed to distinguish from draft-cavage signatures.

Signed-off-by: Micke Nordin <kano@sunet.se>
2026-05-27 11:03:55 +02:00
Micke Nordin
3b5107bc96 feat(http-sig): OCM Ed25519 keys, JWKS endpoint, http-sig capability
OCM dual-stack integration of RFC 9421 alongside the existing cavage
publicKey path:

- OCMSignatoryManager: Ed25519 active/pending/retiring slot rotation
  backed by numbered pool appkeys, getRemoteKey for inbound JWK lookup
  with per-origin cache + cache-miss refetch, and getLocalEd25519Jwks
  for the JWKS endpoint.
- Rfc9421SignatoryManager: per-call wrapper that swaps in the Ed25519
  signatory and toggles `rfc9421.format`.
- OCMJwksHandler: serves /.well-known/jwks.json (RFC 7517) when signing
  is enabled.
- OCMDiscoveryService: advertises `http-sig` in capabilities when
  signing is enabled, and picks the signature scheme on outbound based
  on the remote's advertised capabilities.
- Application.php: register the JWKS well-known handler.

Signed-off-by: Micke Nordin <kano@sunet.se>
2026-05-27 11:03:55 +02:00
Micke Nordin
0eb927e617 feat(http-sig): RFC 9421 protocol primitives
Add the RFC 9421 (HTTP Message Signatures) sign/verify path alongside
the existing draft-cavage implementation:

- Algorithm: sodium for Ed25519, JWT::sign for RSA / ECDSA, ecdsaRawToDer
  for the ECDSA wire format. JWK parsing via JWK::parseKey.
- SignatureBase: RFC 9421 §2.5 base construction for the derived
  components OCM uses plus plain HTTP fields.
- ContentDigest: RFC 9530 helpers used as a covered component.
- Rfc9421IncomingSignedRequest / Rfc9421OutgoingSignedRequest:
  request models. Parsing of Signature-Input / Signature delegates
  to gapple\\StructuredFields\\Parser.
- IJwkResolvingSignatoryManager: capability bit signatory managers
  advertise to participate in RFC 9421 verification.
- OcmProfile: OCM-mandated dictionary label.
- SignatureManager: dispatch to RFC 9421 inbound when Signature-Input
  is present, outbound when rfc9421.format is set.

Plus tests for each primitive and a full round-trip across the model.

Signed-off-by: Micke Nordin <kano@sunet.se>
2026-05-27 11:03:55 +02:00
provokateurin
3ce12c83e1
feat(UserManager): Add getters for avatar URLs
Signed-off-by: provokateurin <kate@provokateurin.de>
2026-05-27 06:44:36 +02:00
provokateurin
bf2043ea6d
test(UserManager): Create manager in setUp
Signed-off-by: provokateurin <kate@provokateurin.de>
2026-05-27 06:44:02 +02:00
Anna Larch
d30f3c491d test: replace checkbox assertions with DoesNotPerformAssertions (middleware)
Signed-off-by: Anna Larch <anna@nextcloud.com>
AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-26 23:18:55 +02:00
Anna Larch
a9f177e743 test(db): call parent::tearDown() in DB test classes that skipped it
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>
2026-05-26 21:20:57 +02:00
Anna Larch
29f43d8e7a fix(security): don't propagate ValueError from Crypto::decrypt() fallback
When decrypting a v3 ciphertext with a mismatched secret, the first
attempt throws an Exception (HMAC mismatch). The fallback then calls
decryptWithoutSecret() with an empty string, which causes hash_hkdf()
to throw a ValueError. Since ValueError extends \Error rather than
\Exception, it bypassed the catch block and propagated as an unhandled
error, crashing the whole request.

Wrap the fallback in its own try/catch(\Throwable) and rethrow the
original Exception so callers get a meaningful HMAC mismatch error.

Signed-off-by: Anna Larch <anna@nextcloud.com>
AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-26 21:20:41 +02:00