Commit graph

5507 commits

Author SHA1 Message Date
Morris Jobke
3ab2e4d41c
Remove deprecated test of internal attributes via assertAttributeEquals in constructor tests
I removed the tests completely because they just test that the constructor assigns the values to the internal properties. Nothing that should be cared about from the outside.

See https://github.com/sebastianbergmann/phpunit/issues/3339#issuecomment-428843322

It is seen as bad practice to test internal stuff of objects instead of the actual input and output of mathod calls.

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-07-30 13:19:16 +02:00
Morris Jobke
a4a086e296
Use assertEqualsCanonicalizing instead of deprecated assertEquals parameter
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-07-30 13:18:20 +02:00
Morris Jobke
7a49d0fbea
Remove deprecated test of internal attributes via assertAttributeEquals
See https://github.com/sebastianbergmann/phpunit/issues/3339#issuecomment-428843322

It is seen as bad practice to test internal stuff of objects instead of the actual input and output of mathod calls.

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-07-30 13:18:14 +02:00
Morris Jobke
3904acfe93
Use assertStringContainsString instead of assertContains on strings
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-07-30 13:17:13 +02:00
Robin Appelman
2eb61b4111 ensure mounts are scanned during tests
Signed-off-by: Robin Appelman <robin@icewind.nl>
2020-07-09 12:33:29 +00:00
Roeland Jago Douma
bb9da25772 Use the correct mountpoint to calculate
If we use the owners mount point this results in null. And then the rest
of the checks get called with null. Which doesn't work.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-07-09 12:33:26 +00:00
Morris Jobke
778cb33576
Merge pull request #21499 from lmamane/stable18-21285-oneliner
fix #21285 as oneliner
2020-07-08 13:04:58 +02:00
Morris Jobke
52167ddc39
Merge pull request #21575 from nextcloud/backport/21379/stable18
[stable18] Fix share permission checkboxes enabled when permissions can not be set
2020-07-06 23:00:38 +02:00
Roeland Jago Douma
01669bdc86
Merge pull request #21670 from nextcloud/revert-21096-backport/21090/stable18
Revert "[stable18] Do not read certificate bundle from data dir by default"
2020-07-06 10:38:48 +02:00
Roeland Jago Douma
c9eede0acf
Merge pull request #21388 from nextcloud/backport/21380/stable18
[stable18] Increase timeout of the appstore requests
2020-07-04 08:55:18 +02:00
Roeland Jago Douma
f3cb2a8208
Revert "[stable18] Do not read certificate bundle from data dir by default" 2020-07-03 14:21:28 +02:00
Joas Schilling
b5a64321f5
Increase timeout of the appstore requests
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-07-03 10:10:07 +02:00
Roeland Jago Douma
464b9fbe09
Merge pull request #21551 from nextcloud/backport/21535/stable18
[stable18] Fix language in share notes email for users
2020-07-02 21:00:45 +02:00
Joas Schilling
8cba764b59 Fix IPv6 remote addresses from X_FORWARDED_FOR headers before validating
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-07-02 10:09:45 +00:00
Daniel Calviño Sánchez
047b5407d6 Add acceptance test for disabling create permission after sharing
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2020-06-24 19:24:58 +00:00
Daniel Calviño Sánchez
a3f1bb70bd Add acceptance test for sharing a folder without create permission
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2020-06-24 19:24:58 +00:00
Daniel Calviño Sánchez
47222e9ad4 Add acceptance test for sharing a file without edit permission
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2020-06-24 19:24:57 +00:00
Daniel Calviño Sánchez
b2b02ff353 Generalize functions to get locators for share permission checkboxes
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2020-06-24 19:24:57 +00:00
Joas Schilling
70cf8bd7fc
Fix language in share notes email for users
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-06-24 09:10:55 +02:00
Joas Schilling
0d86989706
Fix unit tests
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-06-23 14:55:26 +02:00
Lionel Elie Mamane
c173602f88 adapt testGetLoginCredentialsInvalidTokenLoginCredentials() unit test to uid != loginname
Signed-off-by: Lionel Elie Mamane <lionel@mamane.lu>
2020-06-20 11:52:42 +02:00
Arthur Schiwon
a71701f2e7
acceptence tests shall specify which branch to pick when cloning apps
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2020-06-19 21:13:09 +02:00
Roeland Jago Douma
5e0c5a0a83
Merge pull request #21381 from nextcloud/backport/20447/stable18
[stable18] Increase max-height on button in welcome email template
2020-06-19 13:22:58 +02:00
Christoph Wurst
8e3d47a215 Clean up auth tokens when user is deleted
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-06-18 13:32:24 +00:00
Morris Jobke
11b3619dbd
Fix tests
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-06-18 15:04:05 +02:00
Roeland Jago Douma
3d1273d2f2
Merge pull request #21160 from nextcloud/backport/21152/stable18
[stable18] [stable18] Fix password changes in link and mail shares
2020-06-06 09:35:02 +02:00
Joas Schilling
f97a61aa14 Prevent harder to share your root
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-06-04 09:03:54 +00:00
Daniel Calviño Sánchez
fb271d6b81 Fix disabling send password by Talk without new password in mail shares
When "send password by Talk" was disabled in a mail share it was
possible to keep the same password as before, as it does not pose any
security issue (unlike keeping it when "send password by Talk" is
enabled, as in that case the password was already disclosed by mail).

However, if a mail share is updated but the password is not set again
only the hashed password will be available. In that case it would not
make sense to send the password by mail, so now the password must be
changed when disabling "send password by Talk".

Note that, even if explicitly setting the same password again along with
the "send password by Talk" property would work, this was also prevented
for simplicity.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2020-05-29 19:38:28 +00:00
Daniel Calviño Sánchez
6e19f53173 Fix enabling send password by Talk with same password in mail shares
When "send password by Talk" is enabled in a mail share a new password
must be also set. However, when the passwords of the original and the
new share were compared it was not taken into account that the original
password is now hashed, while the new one is not (unless no new password
was sent, in which case the password of the original share was set in
the new share by the controller, but that was already prevented due to
both passwords being literally the same), so it was possible to set the
same password again.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2020-05-29 19:38:28 +00:00
Daniel Calviño Sánchez
57663d19f1 Fix enabling send password by Talk with empty password in link shares
When "send password by Talk" is enabled in a link share now a non empty
password is enforced.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2020-05-29 19:38:28 +00:00
Morris Jobke
555108dc65
Revert "[stable18] Fix password changes in link and mail shares" 2020-05-29 21:35:57 +02:00
Daniel Calviño Sánchez
d6f1937502 Fix disabling send password by Talk without new password in mail shares
When "send password by Talk" was disabled in a mail share it was
possible to keep the same password as before, as it does not pose any
security issue (unlike keeping it when "send password by Talk" is
enabled, as in that case the password was already disclosed by mail).

However, if a mail share is updated but the password is not set again
only the hashed password will be available. In that case it would not
make sense to send the password by mail, so now the password must be
changed when disabling "send password by Talk".

Note that, even if explicitly setting the same password again along with
the "send password by Talk" property would work, this was also prevented
for simplicity.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2020-05-29 14:42:16 +02:00
Daniel Calviño Sánchez
1c580351da Fix enabling send password by Talk with same password in mail shares
When "send password by Talk" is enabled in a mail share a new password
must be also set. However, when the passwords of the original and the
new share were compared it was not taken into account that the original
password is now hashed, while the new one is not (unless no new password
was sent, in which case the password of the original share was set in
the new share by the controller, but that was already prevented due to
both passwords being literally the same), so it was possible to set the
same password again.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2020-05-29 14:42:16 +02:00
Daniel Calviño Sánchez
26e4c292c7 Fix enabling send password by Talk with empty password in link shares
When "send password by Talk" is enabled in a link share now a non empty
password is enforced.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2020-05-29 14:42:16 +02:00
Roeland Jago Douma
876479799e
Merge pull request #21109 from nextcloud/backport/19793/stable18
[stable18] Fix resharing of federated shares that were created out of links
2020-05-28 16:37:28 +02:00
Arthur Schiwon
292d8c3d9c use the loginname to verify the old password in user password changes
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2020-05-26 19:22:33 +00:00
Julius Härtl
a8229421df
Remove unneeded test since links have resharing permissions by default
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-05-26 11:28:42 +02:00
Morris Jobke
64df6aaf85 Do not read certificate bundle from data dir by default
Before the resources/config/ca-bundle.crt was only used when the list of custom
certificates was empty and the instance was not installed. But it should also
be used when the list is empty and the instance is installed.

This is inverting the logic to stop if the instance is not installed to use the
default bundle. And it also does this when the list is empty.

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-05-25 17:53:23 +00:00
Morris Jobke
1d816add44
Merge pull request #20965 from nextcloud/backport/20033/stable18
[stable18] Enable fseek for files in S3 storage
2020-05-25 13:38:04 +02:00
Robin Appelman
136a716df0
add basic tests for s3 seeking and add some error handling if reopen return the wrong range
Signed-off-by: Robin Appelman <robin@icewind.nl>
2020-05-20 22:58:58 +02:00
Morris Jobke
d26c5103e6
Compress the appstore requests by default
In test it reduced the transfered data from 5 MB to 2 MB. This should reduce the load on the appstore significantly.

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-05-20 11:18:19 +02:00
Morris Jobke
f7b39e13a2
Cache appstore requests for 60 instead of 5 minutes
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-05-20 11:18:19 +02:00
Clement Wong
43351ecd29 Fix http cache test
Signed-off-by: Clement Wong <git@clement.hk>
2020-05-13 14:40:18 +02:00
Morris Jobke
de4a71c915
Merge pull request #20574 from nextcloud/backport/16035/stable18
[stable18] dont show remote and email options if we have an exact match for local user email
2020-05-12 21:05:58 +02:00
Robin Appelman
e26c055fb4
dont show remote and email options if we have an exact match for local user email
Signed-off-by: Robin Appelman <robin@icewind.nl>
2020-05-12 16:30:48 +02:00
Roeland Jago Douma
b02a79b327 Use random_bytes
Since we don't care if it is human readbale.
The code is backwards compatible with the old format.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-05-11 12:24:59 +00:00
Roeland Jago Douma
de43edca3b
Merge pull request #20763 from nextcloud/backport/20710/stable18
[stable18] Fix Argon2 options checks
2020-05-01 14:43:26 +02:00
MichaIng
e5f1523577 Fix Argon2 options checks
The minimum for memory cost is 8 KiB per thread. Threads must be checked and set first to allow checking against the correct memory cost mimimum.
Options are now applied the following way:
- If config.php contains the setting with an integer higher or equal to the minimum, it is applied.
- If config.php contains the setting with an integer lower than the minimum, the minimum is applied.
- If config.php does not contain the setting or with no integer value, the PHP default is applied.

Signed-off-by: MichaIng <micha@dietpi.com>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-05-01 09:37:24 +00:00
Roeland Jago Douma
7b0819c511
Allow specifying a default expiration date
This overrides the max expiration date.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-05-01 09:14:25 +02:00
Roeland Jago Douma
fc09807ae6
Merge pull request #20512 from nextcloud/backport/20246/stable18
[stable18] Provide the proper language to the mailer
2020-04-20 20:31:30 +02:00