Commit Graph

300 Commits

Author SHA1 Message Date
Louis da706223e4 Merge pull request #61140 from nextcloud/fix/fix-deprecations-in-tests
Fix deprecations in tests
2026-06-11 14:48:10 +02:00
Louis 8f93d51354 Merge pull request #60029 from icarta-l/fix/missing-early-fail-for-basic-auth-without-credentials
Fix: missing early fail for basic auth without credentials
2026-06-11 10:22:07 +02:00
Côme Chilliet d881bca11f chore(tests): Adapt tests to IUser strict typing
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
2026-06-11 09:45:31 +02:00
Stephan Orbaugh d3b8521ee3 Merge pull request #60453 from nextcloud/jtr/fix-dav-put-bookkeeping-consistency
fix(dav): finalize upload metadata before post-write hooks
2026-06-08 14:16:51 +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
Idan 4b2c371ee7 Fix: missing early fail for basic auth without credentials
Make "validateUserPass" method of OCA\DAV\Connector\Sabre\Auth
class return false after checking if user is logged in if
empty username or password have been passed to it

Fixes #59849

Signed-off-by: Idan <cartaidan@gmail.com>
2026-05-21 13:51:04 +07:00
Josh 106f53e53c chore(FileTest): fixup formatting
Signed-off-by: Josh <josh.t.richards@gmail.com>
2026-05-18 08:43:59 -04:00
Josh b08338d124 test(dav): make sure FileInfo is constructed with checksum
At least where likely to be needed. Also fixed object type.

Signed-off-by: Josh <josh.t.richards@gmail.com>
2026-05-17 11:22:23 -04:00
Josh 2d524128c5 test(dav): add clarifying comments to testPutLocking test
Signed-off-by: Josh <josh.t.richards@gmail.com>
2026-05-17 10:49:00 -04:00
Côme Chilliet 028719b514 chore: Fix deprecation notice in dav application tests
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2026-05-11 16:22:22 +02:00
Ferdinand Thiessen e0c1b74419 test: resolve PHPUnit deprecation warning about addMethods
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2026-04-01 01:12:52 +02:00
Robin Appelman c08592de28 fix: properly expose rename permissions over dav
Signed-off-by: Robin Appelman <robin@icewind.nl>
2026-03-26 18:18:55 +01:00
nextcloud-command 1ed0769d4c refactor: Apply rector changes
Signed-off-by: GitHub <noreply@github.com>
2026-03-22 14:45:16 +00:00
John Molakvoæ 3d0234bb2e Merge branch 'master' into 54088-providePermissionsAndOwnerIdInPut
Signed-off-by: John Molakvoæ <skjnldsv@users.noreply.github.com>
2026-03-19 09:13:45 +01:00
provokateurin e40d6b1c6b refactor(dav): Modernize Node
Signed-off-by: provokateurin <kate@provokateurin.de>
2026-02-17 06:43:16 +01:00
Salvatore Martire 101819821a feat: add oc-ownerid and oc-permissions headers on PUT DAV requests
Signed-off-by: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com>
2026-02-09 10:47:57 +01:00
Salvatore Martire 62ab29960f refactor: extract logic to hide mounts and share information
The permission string for directories and files can contain M or S
depending if they are respectively coming from a mount or a share. This
information is not to be disclosed when the share is a public one.

Signed-off-by: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com>
2026-02-09 10:47:57 +01:00
Carl Schwan c96ece0bcb refactor: Add more typing
- repairs job
- database
- redis

And remove Helpertest which was unused outside of some tests.

Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2026-02-06 13:55:39 +01:00
Carl Schwan 11cf69d8ba fix(psalm): Fix static analysis issues in apps/*/tests
There are still 1200 more to fix before we can enable static analysis
for the tests.

Signed-off-by: Carl Schwan <carlschwan@kde.org>
2026-01-16 12:00:51 +01:00
Carl Schwan ea40ade012 refactor(dav): Remove dead property
The user folder is no longer used.

Signed-off-by: Carl Schwan <carlschwan@kde.org>
2026-01-13 14:09:05 +01:00
Benjamin Gaussorgues 5403284b23 Merge pull request #55293 from nextcloud/jtr/refactor-dav-quotaplugin 2026-01-08 11:18:02 +01:00
Stephan Orbaugh 97ba753e09 Merge pull request #57230 from nextcloud/fix/inodebypath-forbidden-responses
fix: drop readable check
2026-01-02 11:07:45 +01:00
Andy Scherzinger 32327c6285 Merge pull request #56773 from nextcloud/carl/remove-sciencemesh
refactor(share): Remove code related to science mesh integration
2025-12-30 14:18:53 +01:00
Salvatore Martire 678bf538bf fix: drop readable check
This check was introduced in a previous PR, causing disruptive
changes in PROPFIND responses in some cases.

Signed-off-by: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com>
2025-12-22 18:48:10 +01:00
Salvatore Martire 2a4ee2df9f fix: add INodeByPath to Directory
Signed-off-by: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com>
2025-12-10 18:30:44 +01:00
Carl Schwan cc7655136c refactor(share): Remove code related to science mesh integration
The app was not updated for the past 2 years.

Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2025-12-03 14:11:58 +01:00
Salvatore Martire 4ac0fcf02e fix: check instance of storage using helper function
instanceof cannot be used to check the instance of a storage, doing so
breaks the check in certain cases. In this case, enabling the
`files_accesscontrol` app breaks the check.

Signed-off-by: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com>
2025-12-01 18:09:25 +01:00
Ferdinand Thiessen d6d6747a73 refactor: apply rector rules for PHPUnit 10
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-10-27 21:56:04 +01:00
skjnldsv 9c98b722f4 fix(dav): allow multiple link shares token in session
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
2025-10-23 13:10:39 +02:00
provokateurin 6a12fbc4f3 refactor: Run rector
Signed-off-by: provokateurin <kate@provokateurin.de>
2025-09-27 18:52:58 +02:00
Josh 04f30cad62 chore: drop buildFileViewMock cast and give it a docblock
Updated the buildFileViewMock method to accept int, float, or false as quota type.

Signed-off-by: Josh <josh.t.richards@gmail.com>
2025-09-24 20:53:57 -04:00
Josh 23546013e1 fix(dav): test hint time in buildFileViewMock method wrong
Doesn't match current interface.

Signed-off-by: Josh <josh.t.richards@gmail.com>
2025-09-24 20:46:39 -04:00
Louis Chemineau 634e8d2587 fix: Dispatch favorite event with an actual path
The `$path` argument was added in https://github.com/nextcloud/server/pull/48612, but was never actually used by the callers. The path was therefore missing in the favorite/unfavorite events, which lead to a broken activity information.

I also added a fallback to handle `addToFavorites` and `removeFromFavorites`, which are part of a public API, and are calling `tagAs` and `untag` without `$path`.

Fix https://github.com/nextcloud/activity/issues/2134

Signed-off-by: Louis Chemineau <louis@chmn.me>
2025-09-15 15:04:00 +02:00
Côme Chilliet bc5e29f9f2 fix(tests): Fix type issues and other problems with encryption tests
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-09-09 11:46:18 +02:00
Carl Schwan f60e7b93e7 Merge pull request #54507 from nextcloud/fix/54501/removeListener
fix: propfind query monitor breaking removeListener and removeAllList…
2025-09-03 18:51:03 +02:00
Salvatore Martire 5d028cfaf8 fix: propfind query monitor breaking removeListener and removeAllListeners
Signed-off-by: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com>
2025-08-21 11:59:36 +02:00
Carl Schwan 94e2af0302 perf(comments): Also cache the comments count
Since we now have an easy way to fetch the comments count.

Signed-off-by: Carl Schwan <carl.schwan@nextclound.com>
2025-08-21 11:30:56 +02:00
Salvatore Martire 75d9aaa3b5 Merge pull request #54318 from nextcloud/feat/54115/emitPreloadCollectionEvent
Emits a `preloadCollection` event in the DAV server, so that plugins can listen to it and preload DAV properties for files inside a collection, to avoid the N+1 issue that would follow if loading properties on a per-file basis.
2025-08-15 11:06:48 +02:00
Salvatore Martire bdcd583045 feat: make use of preloadCollection in core apps
Signed-off-by: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com>
2025-08-15 10:46:43 +02:00
Salvatore Martire 9bbebd6034 feat: emit preloadCollection event in DAV
This allows plugins to preload the content of a Collection to speed-up
subsequent per-node PROPFINDs and reduce database load.

Signed-off-by: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com>
2025-08-15 10:46:43 +02:00
Carl Schwan 46f0c6ebb5 perf(caldav): Cache calendars in CustomPropertiesBackend
We already do that for files, we are now also doing for calendars.
With relatively small amount of calendars, I managed to reduce the
number of DB requests by 35% and from 23 DB requests touching the
oc_properties table to only 3.

Signed-off-by: Carl Schwan <carl.schwan@nextclound.com>
2025-08-15 09:57:58 +02:00
Salvatore Martire ec176a933a feat(dav): report inefficient DAV plugins in logs
Signed-off-by: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com>
2025-08-13 19:46:18 +02:00
John Molakvoæ 2b50d9b2c5 Revert "perf(base): Stop setting up the FS for every basic auth request" 2025-07-11 17:07:44 +02:00
provokateurin 689a853dc6 fix(dav): Initialize the FS for the user right after authenticating
Signed-off-by: provokateurin <kate@provokateurin.de>
2025-07-08 11:38:58 +02:00
Robin Appelman aa15f9d16d chore: run rector
Signed-off-by: Robin Appelman <robin@icewind.nl>
2025-07-01 22:45:52 +02:00
Ferdinand Thiessen 5981b7eb51 chore: apply new CSFixer rules
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>

# Conflicts:
#	apps/settings/lib/SetupChecks/PhpOpcacheSetup.php
2025-07-01 16:26:50 +02:00
Joas Schilling 76e6ab1dff test: Migrate remaining DAV tests to PHPUnit 10
Signed-off-by: Joas Schilling <coding@schilljs.com>
2025-05-28 09:25:47 +02:00
Louis Chemineau 009d0c550c fix: Move CSRF check from base to PublicAuth for public.php
This currently prevent directly accessing a ressource when clicking on a link on a third party site. Example, clicking on `https://example.com/public.php/dav/files/pqLWcA269zfzXez/?accept=zip` in a GitHub comment.

Skipping the check is an issue with password protected shares, as it allows third party sites to request the ressource when the user already entered the password, aka CSRF.  So after removing the check from `base.php`, we need to add the it again in the `PublicAuth` plugin.

We also add a redirect to be helpful to the user.

**Warning**: this adds the limitation that clicking on a direct download link for password protected shares will redirect you to the password form, and then to the main share view.

Fix #52482

Signed-off-by: Louis Chemineau <louis@chmn.me>
2025-05-21 16:01:36 +02:00
provokateurin 78a175fc74 refactor: Apply rector refactorings
Signed-off-by: provokateurin <kate@provokateurin.de>
2025-05-14 15:29:02 +02:00
provokateurin 7f0953d520 refactor(dav): Replace baseuri manipulation with RootCollection for public shares
Signed-off-by: provokateurin <kate@provokateurin.de>
2025-05-05 13:23:11 +02:00