Commit Graph

4488 Commits

Author SHA1 Message Date
Robin Appelman 9126cdc7a8 cleanup shared lock if changing to exclusive lock failed
Signed-off-by: Robin Appelman <robin@icewind.nl>
2019-01-22 15:14:34 +00:00
Roeland Jago Douma 04617a28d4
Move ExpiredTokenException to the correct namespace
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-11-02 11:39:42 +01:00
Patrick Conrad 06e43bb46a
Remove cookies from Clear-Site-Data Header
In 2f87fb6b45 this header was introduced. The referenced documentation says:

> When delivered with a response from https://example.com/clear, the following header will cause cookies associated with the origin https://example.com to be cleared, as well as cookies on any origin in the same registered domain (e.g. https://www.example.com/ and https://more.subdomains.example.com/).

This also applies if `https://nextcloud.example.com/` sends the `Clear-Site-Data: "cookies"` header.
This is not the behavior we want at this point!

So I removed the deletion of cookies from the header. This has no effect on the logout process as this header is supported only recently and the logout works in old browsers as well.

Signed-off-by: Patrick Conrad <conrad@iza.org>
(cherry picked from commit 1806baaeaf)
2018-10-24 08:53:46 +02:00
Daniel Calviño Sánchez 3fbb6e7034 Add acceptance tests for opening a section in the Files app
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-10-23 17:31:01 +02:00
Georg Ehrke 879538c22f
filter null values for UserManager::getByEmail
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
2018-10-22 15:54:41 +02:00
Morris Jobke 7613801a58
Change password expiration time from 12h to 7d
We use the same logic for creating accounts without a password and there the 12h is a bit short. Users don't expect that the signup link needs to be clicked within 12h - 7d should be a more expected behavior.

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-10-16 09:24:38 +02:00
Daniel Calviño Sánchez b9122257eb Include empty directories in the default state of acceptance tests
Before each scenario of the acceptance tests is run the Nextcloud server
is reset to a default state. To do this the full directory of the
Nextcloud server is commited to a local Git repository and then reset to
that commit when needed.

Unfortunately, Git does not support including empty directories in a
commit. Due to this, when the default state was restored, it could
happen that the file cache listed an empty directory that did not exist
because it was not properly restored (for example,
"data/appdata_*/css/icons"), and that in turn could lead to an error
when the directory was used.

Currently the only way to force Git to include an empty directory is to
add a dummy file to the directory (so it will no longer be empty,
but that should not be a problem in the affected directories, even if
the dummy file is not included in the file cache); although Git FAQ
suggests using a ".gitignore" file a ".keep" file was used instead, as
it conveys better its purpose.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-09-19 12:51:39 +02:00
Bjoern Schiessle 5b54b8cba2
update unit tests
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-08-10 17:26:11 +02:00
Bjoern Schiessle be172cc6f2
make file cache updates more robust
only update the encrypted version after the write operation is finished and the stream is closed

Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-08-08 10:46:14 +02:00
Robin Appelman 1fa6115779
prevent lock values from going negative with memcache backend
This can be caused by the code releasing more locks then it acquires,
once the lock value becomes negative it's likely that it will never be able
to change into an exclusive lock again.

Signed-off-by: Robin Appelman <robin@icewind.nl>
2018-07-10 17:50:45 +02:00
Roeland Jago Douma e55effc5ef
Make sure the file is readable before attempting to create a preview
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-05-29 22:03:43 +02:00
Georg Ehrke 0493d0e3fb
make sure force language is reflected in html lang attribute
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
2018-05-24 13:07:54 +02:00
Roeland Jago Douma 46aafe4f11
Certain tokens can expire
However due to the nature of what we store in the token (encrypted
passwords etc). We can't just delete the tokens because that would make
the oauth refresh useless.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-05-22 14:26:13 +02:00
Roeland Jago Douma 8fcb7d4334
Allow the rotation of tokens
This for example will allow rotating the apptoken for oauth

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-05-22 12:51:25 +02:00
Morris Jobke eb429e7ee6
Add tests for special domain name
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-05-09 10:51:26 +02:00
Morris Jobke 229667c84c
Add tests for domains
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-05-09 10:51:14 +02:00
Joas Schilling 7bb44214a1
Move regex to a function and add tests
Signed-off-by: Joas Schilling <coding@schilljs.com>
2018-05-09 10:50:56 +02:00
Morris Jobke 26c153667a
Merge pull request #9231 from nextcloud/13-9205
[stable13] Provide an option to disable HTML emails
2018-04-18 22:38:33 +02:00
Roeland Jago Douma a1c4bdfdf8
Merge pull request #9233 from nextcloud/13-9159
[stable13] fix appinfo parsing when a single localized option is provided
2018-04-18 21:18:37 +02:00
Robin Appelman 5fbba7854b
fix appinfo parsing when a single localized option is provided
Signed-off-by: Robin Appelman <robin@icewind.nl>
2018-04-18 17:32:19 +02:00
Morris Jobke 01278056a5
Provide an option to disable HTML emails
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-04-18 16:59:34 +02:00
Joas Schilling 6b97429ebe
Show EOL warning in the update section
Signed-off-by: Joas Schilling <coding@schilljs.com>
2018-04-18 13:46:25 +02:00
John Molakvoæ d45a889fe2
Merge pull request #8779 from nextcloud/backport/8255/show-group-display-names
[stable13] Show group display names
2018-04-06 15:14:12 +02:00
Roeland Jago Douma af317a1e38
Fix test
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-04-04 12:02:42 +02:00
Bjoern Schiessle d4f64b94f2
reset encryptionVersion to '1' if a file was stream copied, because this means that we basically write the file from scratch
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-04-03 18:12:16 +02:00
John Molakvoæ (skjnldsv) 05f76b3469
Use app version to generate scss filename
Fixed scsscacher tests

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2018-03-28 16:11:10 +02:00
Joas Schilling 5e15c76d21
Fix unit tests
Signed-off-by: Joas Schilling <coding@schilljs.com>
2018-03-16 10:50:18 +01:00
John Molakvoæ (skjnldsv) ae369e870d
Fixed caldav tests and metadata 2
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2018-03-12 12:02:14 +01:00
Morris Jobke b0f0c26fe3
Merge pull request #8745 from nextcloud/stable13-8716
[13] Remove base url from global cache prefix
2018-03-09 16:15:48 +01:00
Morris Jobke 17f75d6797
Mock method of actual cache
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-03-09 15:36:53 +01:00
Roeland Jago Douma 43243380f1
Always return the depscache
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-03-09 14:43:54 +01:00
Daniel Calviño Sánchez e9f5073677 Add acceptance tests for creation of subfolders in public shared folders
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-03-09 12:26:58 +01:00
Daniel Calviño Sánchez 4337de7559 Extract common "wait for" functions to a helper class
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-03-09 12:26:58 +01:00
Daniel Calviño Sánchez 05fd72937b Generalize file list steps so a specific ancestor can be used
The "FileListContext" provides steps to interact with and check the
behaviour of a file list. However, the "FileListContext" does not know
the right file list ancestor that has to be used by the file list steps,
so until now the file list steps were explicitly wired to the Files app
and they could be used only in that case.

Instead of duplicating the steps with a slightly different name (for
example, "I create a new folder named :folderName in the public shared
folder" instead of "I create a new folder named :folderName") the steps
were generalized; now contexts that "know" that certain file list
ancestor has to be used by the FileListContext steps performed by
certain actor from that point on (until changed again) set it
explicitly. For example, when the current page is the Files app then the
ancestor of the file list is the main view of the current section of the
Files app, but when the current page is a shared link then the ancestor
is set to null (because there will be just one file list, and thus its
ancestor is not relevant to differentiate between instances)

A helper trait, "FileListAncestorSetter", was introduced to reduce the
boilerplate needed to set the file list ancestor from other contexts.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-03-09 12:26:58 +01:00
Daniel Calviño Sánchez 7ebbd666a8 Generalize file list locators so a specific ancestor can be used
The file list is used in other places besides the Files app (for
example, the File sharing app); in those cases the locators for the file
list elements are the same, but not for the ancestor of the file list.
To make possible to reuse the file list locators in those cases too now
they receive the ancestor to use.

Note that the locators for the file actions menu were not using an
ancestor locator because it is expected that there is only one file
actions menu at a time in the whole page; that may change in the future,
but for the time being it is a valid assumption and thus the ancestor
was not added to those locators in this commit.

Although the locators were generalized the steps themselves still use
the "FilesAppContext::currentSectionMainView" locator as ancestor; the
steps will be generalized in a following commit.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-03-09 12:26:58 +01:00
Daniel Calviño Sánchez 0709f4fd67 Store the name of the actor in the Actor object
This is needed to be able to easily use the actor as a key in an array.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-03-09 12:26:58 +01:00
Daniel Calviño Sánchez da6743277b Extract file list locators and steps to its own class
Besides the extraction some minor adjustments (sorting locators for file
action menu entries to reflect the order of the menu entries in the UI,
moving parametrized locators like "createMenuItemFor" above the locators
that use them and placing "descendantOf" calls always in a new line)
were made too.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-03-09 12:26:58 +01:00
Morris Jobke 6176296c80
Merge pull request #8749 from nextcloud/backport/8596/sharee-email-matches-not-limited
[stable13] Sharee email matches not limited
2018-03-09 11:29:15 +01:00
Joas Schilling a2f3f0a681
Fix calculation if there are more results
Signed-off-by: Joas Schilling <coding@schilljs.com>
2018-03-09 10:16:42 +01:00
Joas Schilling a31439e89d
Add tests for finding own email and user results pagination
Signed-off-by: Joas Schilling <coding@schilljs.com>
2018-03-09 10:16:12 +01:00
Roeland Jago Douma 85ba5adb33
Fix tests
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-03-09 09:44:36 +01:00
Julius Härtl d4d3cecbf8
Fix tests to use ICacheFactory
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2018-03-09 09:24:50 +01:00
Daniel Calviño Sánchez fc6c290a4f Add automatic handling of NoSuchElement exceptions
NoSuchElement exceptions are sometimes thrown instead of
StaleElementReference exceptions. This can happen when the Selenium2
driver for Mink performs an action on an element through the WebDriver
session instead of directly through the WebDriver element. In that case,
if the element with the given ID does not exist, a NoSuchElement
exception would be thrown instead of a StaleElementReference exception,
so those cases are handled like StaleElementReference exceptions.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-03-09 02:17:04 +01:00
Daniel Calviño Sánchez f0cbeecf21 Add automatic handling of MoveTargetOutOfBounds exceptions
MoveTargetOutOfBounds exceptions are sometimes thrown instead of
ElementNotVisible exceptions. This can happen when the Selenium2 driver
for Mink moves the cursor on an element using the "moveto" method of the
Webdriver session, for example, before clicking on an element. In that
case, if the element is not visible, "moveto" would throw a
MoveTargetOutOfBounds exception instead of an ElementNotVisible
exception, so those cases are handled like ElementNotVisible exceptions.

Note that MoveTargetOutOfBounds exceptions could be thrown too if the
element was visible but "out of reach"; there is no problem in handling
those cases as if the element was not visible, as the exception will be
thrown again anyway once it is verified that the element is indeed
visible.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-03-09 02:17:04 +01:00
Roeland Jago Douma 9413f97b92
Hardening of SimpleFile getContent
if file_get_contents fails remove the file. And traverse up the tree
checking if the other folders are there.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-03-02 21:23:41 +01:00
Roeland Jago Douma 2c6f3c88cf
Merge pull request #8099 from nextcloud/7873_13
[stable13] Don't perform CSRF check on OCS routes with Bearer auth
2018-02-28 14:34:20 +01:00
Joas Schilling d63caf5829
Better result handling of email search
1. Local users should not be returned when searching for empty string
2. The limit of the response should be respected

Signed-off-by: Joas Schilling <coding@schilljs.com>
2018-02-20 17:47:54 +01:00
Daniel Calviño Sánchez 5fd7de5275 Take into account the comment message when looking for it
Instead of checking that the list contains one comment it is now checked
that a comment with certain message is visible. This makes the step (and
the locator) more reusable in future tests and also simplifies the code.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-02-16 12:24:35 +01:00
Daniel Calviño Sánchez d9e66b2114 Adjust timeouts in the step to create a new comment
Depending on the previous steps the new comment field may be already
shown or not when the step to create a new comment is executed.
Therefore, the timeout was increased from 2 to the "standard" 10 seconds
used in other tests.

If the new comment field was found there is no need to use a timeout
when looking for the new comment button; it is either there or not, it
will not appear after some time.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-02-16 12:24:35 +01:00
Daniel Calviño Sánchez f6737e43e9 Move locators above step definitions
The locators are moved above the step definitions for consistency with
other context files; besides that I made some minor adjustments for
consistency too in the locator descriptions and identation, and moved
the locators for ".newCommentRow" descendants together.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-02-16 12:24:35 +01:00