Commit Graph

5979 Commits

Author SHA1 Message Date
Joas Schilling aa651fd629
Merge pull request #26259 from nextcloud/feature/noid/validate-website-to-be-valid
Validate the website field input to be a valid URL
2021-04-26 13:56:01 +02:00
Morris Jobke 012f791c8f
Merge pull request #26375 from nextcloud/techdebt/noid/symfony-component-translation-pluralization-rules-is-deprecated
"Symfony\Component\Translation\PluralizationRules" is deprecated
2021-04-22 21:20:16 +02:00
Joas Schilling d80cc76ee7
Validate the website field input to be a valid URL
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-04-22 16:34:13 +02:00
John Molakvoæ 3da956bcdc
Merge pull request #23529 from Simounet/feat/23397-settings-new-user-modal
Settings: new user row replaced by a modal
2021-04-21 16:38:46 +02:00
Robin Appelman effb7dc8ba
set mimetype for objects uploaded to object storages
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-04-21 15:25:58 +02:00
Simounet 45c3b2a478
Settings: new user row replaced by a modal
Signed-off-by: Simounet <contact@simounet.net>
2021-04-21 14:42:46 +02:00
Morris Jobke d2ea068552
Merge pull request #26669 from nextcloud/nickvergessen-patch-1
Fix PHP CS
2021-04-21 14:07:17 +02:00
John Molakvoæ 31d88209f7
Merge pull request #25991 from nextcloud/update-acceptance-tests-to-selenium3 2021-04-21 09:31:29 +02:00
Joas Schilling 2a11713337 Update CredentialsManagerTest.php
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2021-04-21 08:33:10 +02:00
Morris Jobke 9e8690d912
Merge pull request #26654 from nextcloud/bugfix/noid/fix-security-credentials-manager-test
Fix security credentials manager test
2021-04-20 22:03:52 +02:00
Roeland Jago Douma 5ee9e1f784 Move 2FA registration to IBootstrap
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2021-04-20 21:01:16 +02:00
Joas Schilling 7f70f3e182
Fix support tests
2) Test\Support\Subscription\RegistryTest::testDelegateIsHardUserLimitReachedWithoutSupportAppAndUserCount with data set #0 (35, 15, 2, false)
Cannot stub or mock class or interface "Test\Support\Subscription\UserInterface" which does not exist

3) Test\Support\Subscription\RegistryTest::testDelegateIsHardUserLimitReachedWithoutSupportAppAndUserCount with data set #1 (35, 45, 15, false)
Cannot stub or mock class or interface "Test\Support\Subscription\UserInterface" which does not exist

4) Test\Support\Subscription\RegistryTest::testDelegateIsHardUserLimitReachedWithoutSupportAppAndUserCount with data set #2 (35, 45, 5, true)
Cannot stub or mock class or interface "Test\Support\Subscription\UserInterface" which does not exist

5) Test\Support\Subscription\RegistryTest::testDelegateIsHardUserLimitReachedWithoutSupportAppAndUserCount with data set #3 (35, 45, 55, false)
Cannot stub or mock class or interface "Test\Support\Subscription\UserInterface" which does not exist

Had to use the Database user backend, as using multiple interfaces is deprecated:
https://github.com/sebastianbergmann/phpunit/issues/3955
> This functionality should be deprecated as "having to use it" is almost always a symptom of bad design.
> More importantly, though, the support for the creation of test doubles that implement multiple interfaces
> resulted in code that is hard to maintain.

Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-04-20 17:36:15 +02:00
Joas Schilling c6978bac80
Fix security credentials manager test
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-04-20 17:04:24 +02:00
Joas Schilling 79ebc7f24c
Fix test by defining plurals
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-04-20 16:43:43 +02:00
Joas Schilling 5a514a9a41
Correctly replace all PHP placeholders with the parameters
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-04-20 16:42:05 +02:00
blizzz 92ca49d21d
save a whitespace today
Co-authored-by: Joas Schilling <213943+nickvergessen@users.noreply.github.com>
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2021-04-20 14:03:01 +02:00
Arthur Schiwon f8d1ee5cfa
ignore mail shares of related remote share results
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2021-04-20 14:02:35 +02:00
Daniel Calviño Sánchez 4b376a107b Add automatic handling of "ElementNotInteractable" exceptions
In the WebDriver protocol, when a command fails because it can not
interact with the target element, an "element not interactable" error is
generated. It can be a transitive issue (for example, due to an
animation), so when the error is received the command should be tried
again, just like done, for example, with "ElementNotVisible" exceptions.

However, the last version of the "instaclick/php-webdriver" library
compatible with the Selenium Driver of Mink did not support yet that
WebDriver error. And even if Chrome is run using the old protocol an
unknown "element not interactable" error can be received anyway in some
cases. When an unknown error is received by the
"instaclick/php-webdriver" library it is thrown as a generic Exception
so, until the library can be updated, the message of generic exceptions
is checked and the command is retried if it matched.

For the time being "element not interactable" errors are handled like
"ElementNotVisible" exceptions; this may need to change once the error
is better understood.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2021-04-19 16:35:11 +02:00
Joas Schilling 751be29c73
Merge pull request #26555 from nextcloud/techdebt/noid/run-migrator-tests-on-OCI
Run migrator tests on OCI
2021-04-19 08:57:41 +02:00
Daniel Calviño Sánchez 9e1246eba5 Update acceptance tests to Selenium 3
The acceptance tests used the last Selenium 2 Docker container
available, which provides a rather old Firefox version (Firefox 47).
Nevertheless, despite some rendering issues, most things still worked as
expected due to the JavaScript files being built with support for older
browsers. However, now that support for Internet Explorer 11 and older
browsers will be dropped things could start to fail, so a newer browser
(and thus a newer Selenium version) should be used in the acceptance
tests.

Selenium has been standardized by the W3C, and the protocol to
communicate between the Selenium server and the browser has changed due
to that. Firefox >= 48 only supports the new W3C protocol, but the
Selenium driver for Mink does not support it yet.

The old protocol can still be used in recent Chromium/Chrome versions by
explicitly forcing it, so for the time being the acceptance tests will
need to be run on Chrome instead (although Firefox provides some
interesting features like the fake streams that would be needed to test
calls in Talk, so they should be moved again to Firefox once possible).

Finally, the default shm size of Docker is 64 MiB. This does not seem
enough to run newer Chrome releases and causes the browser to randomly
crash during the tests ("unknown error: session deleted because of page
crash" is shown in the logs). Due to this "disable-dev-shm-usage" needs
to be used so Chrome writes shared memory files into "/tmp" instead of
"/dev/shm" (the default shm size of Docker could have been increased
instead using "docker run --shm-size...", but that seems to be
problematic when the container is run in current Drone releases).

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2021-04-16 20:00:15 +02:00
Daniel Calviño Sánchez 14b85f4eec Replace carriage return with WebDriver "ENTER" constant
When the value is set in some input fields a carriage return was sent to
simulate pressing the enter key and thus confirming the input. However,
different browsers use different keys (Firefox uses "\r", but Chrome
uses "\n"), so the carriage return was replaced with the WebDriver
"ENTER" constant which is common to both browsers.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2021-04-16 20:00:15 +02:00
Daniel Calviño Sánchez 38b88422a8 Do not send "enter" key when not needed
Sending the "enter" key is not needed in those input fields that auto
save while the user is typing or when the focus is lost (which since
version 1.4.0 the Selenium driver for Mink is automatically done after
setting the value).

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2021-04-16 20:00:15 +02:00
Roeland Jago Douma 808e589035 Allow registering NotifierServices trough IBootstrap
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2021-04-16 13:56:28 +02:00
Joas Schilling 1670d00452 Integer 0 is not stored as Null and therefor works
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-04-16 09:57:27 +02:00
Joas Schilling 8b4ecdcc88 Test that oracle throws on EmptyValues in a NotNull columns
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-04-16 09:57:27 +02:00
Joas Schilling e88bad4b0a Run migrator tests on OCI
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-04-16 09:57:27 +02:00
Roeland Jago Douma b5ffca00f7 Fix unit test
* Fix namespace
* Fix test

Was broken after https://github.com/nextcloud/server/pull/26529

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2021-04-16 09:47:52 +02:00
Vincent Petry af61486aea
Separate settings for remote share expiration
Added separate settings for default and enforced expiration date for
remote shares.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2021-04-15 10:06:09 +02:00
Roeland Jago Douma 789bb0d0ac
Merge pull request #26266 from nextcloud/future-proof-networking
Improve networking checks
2021-04-12 12:42:33 +02:00
Lukas Reschke e5a4236e68 Increase subnet matcher
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2021-04-07 12:28:59 +00:00
Lukas Reschke 4b4971ab52
Merge pull request #24966 from nextcloud/jknockaert-patch-1
avoid fread on directories and unencrypted files
2021-04-06 13:45:10 +02:00
Lukas Reschke 9dab851931 Adjust test
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2021-04-06 11:37:47 +00:00
Lukas Reschke 5f3abffe6f Improve networking checks
Whilst we currently state that SSRF is generally outside of our threat model, this is something where we should invest to improve this.

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2021-04-06 11:37:47 +00:00
Morris Jobke 5fb909faa5
Merge pull request #24055 from nextcloud/bugfix/noid/enfore-no-notnull-for-boolean-to-store-false
Enforce no notnull for boolean to store false
2021-04-01 18:30:26 +02:00
Julius Härtl 37591f05dc
Get the parent directory before creating a file from a template
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2021-04-01 13:48:21 +02:00
Joas Schilling f9d4fa2d38
Rename the method to match what it does
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-03-31 10:21:18 +02:00
Joas Schilling 3696ef5b96
Don't allow Notnull for boolean columns
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-03-31 10:21:17 +02:00
kesselb 2212a67fbc
Merge pull request #25961 from nextcloud/enh/events/2fa_provider
Add real events for enabled 2fa providers for users
2021-03-30 23:13:36 +02:00
Roeland Jago Douma f3738eeff7
Merge pull request #25280 from nextcloud/explicit-file-permissions
Set umask before operations that create local files
2021-03-30 21:55:50 +02:00
Arthur Schiwon be3ae9a44b
gracefully handle deleteFromSelf when share is already gone
- handling race conditions

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2021-03-30 12:59:40 +02:00
Daniel Calviño Sánchez f216b9307a
Update Mink from 1.7.1 to 1.8.1 in acceptance tests
Since version 1.8.0 of Mink "Mink::getSession()" no longer starts the
session automatically (see https://github.com/minkphp/Mink/pull/705), so
it now needs to be explicitly started.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2021-03-30 08:35:16 +02:00
Daniel Calviño Sánchez 7625a87412
Update Selenium driver for Mink from 1.3.1 to 1.4.0 in acceptance tests
Since version 1.4.0 the Selenium driver for Mink uses again the element
on which the value was set (see
https://github.com/minkphp/MinkSelenium2Driver/pull/286). When creating
a new folder or renaming one sending a new line ("\r") caused the
element on which the value was set to be removed, so the element was no
longer attached to the DOM when the driver tried to use it again, and
thus a "StaleElementReference" exception was thrown.

Due to this now it is needed to explicitly click the confirm button when
creating a new folder. In the case of the renaming, on the other hand,
nothing else besides not sending the new line is needed, as the Selenium
driver now unfocuses the element (that is why it uses again the element
after setting the value) which triggers the renaming.

Besides that, the Selenium driver for Mink uses a library to simulate
certain events, bitovi/syn. In version 1.4.0 that library was updated to
version 0.0.3, which seems to somehow break pressing the "escape" key.
Due to this now the sharing menu has to be closed by pressing "enter" on
the share menu button instead.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2021-03-30 08:35:16 +02:00
Daniel Calviño Sánchez 223b36e851
Update Behat from 3.7.0 to 3.8.1 in acceptance tests
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2021-03-30 08:35:16 +02:00
Daniel Calviño Sánchez b53f49b940
Update PHPUnit from 4.X to 6.X in acceptance tests
The PHPUnit update also required an update of "symfony/yaml", so besides
the changes needed for PHPUnit the "behat.yml" file also had to be
adjusted.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2021-03-30 08:35:15 +02:00
Joas Schilling 8d3fdf24c8
Merge pull request #26353 from nextcloud/techdebt/noid/make-testcase-class-compatible-with-phpunit-9.5
Make Testcase class compatible with phpunit-9.5
2021-03-29 10:47:37 +02:00
Joas Schilling cd35a5c71d
Make Testcase class compatible with phpunit-9.5
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-03-29 09:43:08 +02:00
Vincent Petry cc54f718f5
Add known user check in avatar when v2-private scope
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2021-03-26 13:07:10 +01:00
Vincent Petry bb008be28a
Added PlaceholderAvatar with own cached images
When avatar scope is private, the PlaceholderAvatar is used to deliver a
placeholder avatar based on the user's initials.

This was implemented as a separate class for now to avoid messing with
the existing UserAvatar implementation and its generated vs
non-generated logic.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2021-03-26 13:07:09 +01:00
Vincent Petry b73df5846c
Add property scope tests for AccountManager
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2021-03-26 13:07:09 +01:00
Vincent Petry 278a73789e
Map old account scope properties to new names
Use new scope values in settings page.
Adjust all consumers to use the new constants.
Map old scope values to new ones in account property getter.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2021-03-26 13:07:08 +01:00