1
0
Fork 0
Commit Graph

172 Commits

Author SHA1 Message Date
Olivier Goffart ed5385faa3 Merge remote-tracking branch 'origin/2.4'
Conflicts:
	src/libsync/connectionvalidator.cpp
     	src/libsync/networkjobs.cpp
2017-12-05 15:58:13 +01:00
Tomaz Canabrava 2cacf2547e Merge branch 'master' into clientSideEncryptionV3 2017-11-28 20:12:57 +01:00
Olivier Goffart 753d7addb4 libsync: Fix compilation with TOKEN_AUTH_ONLY
This means we cannot use QtGui in libsync.
So this mostly disable the avatar from the account and the avatarjob

Note that there is one logic change: in ConnectionValidator::slotUserFetched
we do the avatar job even if the user is empty. Otherwise we would end up in
a invalid state. This restore the 2.3.x behavior that was broken in
commit e05d6bfcdc
2017-11-25 12:57:16 +01:00
Christian Kamm e9907bc8ae AvatarJob improvements
* Drop AvatarJob2
* Allow AvatarJob to retrieve different sizes and users
* Make creating a circular avatar into a function
  (maybe all avatars should be made into that shape in the first place)
2017-11-21 16:33:03 +01:00
Christian Kamm d949ec6877 Protocol: Introduce context menu with "open in browser" #6121
To do this conveniently a bunch of functionality that's common to
IssueWidget and ProtocolWidget is moved to ProtocolItem.

Also the convenience function to asynchronously retrieve the private
link url is moved from the socket api to the network jobs.
2017-11-21 12:42:10 +01:00
Tomaz Canabrava d31aa7836a [CSE] Add job to find what folders are encrypted.
This still needs to be correctly setuped in the call chain.
The job returns a QVariantMap with the folder-webdav-url
and the encrypted status.
2017-11-20 21:38:17 +01:00
Tomaz Canabrava 6d464d9dc6 Merge branch 'master-nextcloud' into clientSideEncryptionV3 2017-11-20 18:00:58 +01:00
Christian Kamm 3ae2071129 DetermineAuth: Remove concept of Unknown #6148
This restores 2.3 behavior. Some servers reply 404 to GETs and PROPFINDs
to the remote.php/webdav/ url and used to work. Being more picky would
break them.
2017-11-14 12:10:35 +01:00
Tomaz Canabrava 4755b8c8a3 [CSE] More warnings 2017-11-12 13:03:52 +01:00
Christian Kamm 9af6e29f42 DetermineAuthType: Adjustments for tight firewalls #6135
With some firewalls we can't GET /remote.php/webdav/. Here we keep the
GET request to detect shibboleth through the redirect pattern but then
use PROPFIND to figure out the http auth method.

Currently we prefer OAuth to Shibboleth to Basic auth.

This also restores the fallback behavior of assuming basic auth
when no auth type can be determined.
2017-11-06 13:09:10 +01:00
Tomaz Canabrava 5420741edb Merge branch 'master' into clientSideEncryptionV3 2017-10-30 11:21:36 +01:00
Tomaz Canabrava 23f5bb7ed9 [CSE] Move network jobs out of networkjobs.h
Since those networkjobs are all about client side
encryption, mvoe them to clientsideencryption.h
This will help with fewer conflicts with the origin.
2017-10-23 21:06:26 +02:00
Tomaz Canabrava e0988f482c
[CSE] Build fix
- change the name of one Qt Message Handler
- changed parameter from int to QString
2017-10-18 21:51:39 +02:00
Tomaz Canabrava d83e8819ce
[CSE] SetEncryptionFlagApiJob
This new job sets the Encryption Flag in a folder.
2017-10-18 21:51:39 +02:00
Tomaz Canabrava 1436d5bac1
[CSE] Better debug output 2017-10-18 21:51:39 +02:00
Tomaz Canabrava cfb6e3be8c
[CSE] Send the Private Key to the server 2017-10-18 21:51:38 +02:00
Tomaz Canabrava 090336c928
[cse] Correctly send the CSR
finally.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2017-10-18 21:51:37 +02:00
Tomaz Canabrava 307dfd195c
[cse] Call the CSR job.
There's something wrong on the CSR job that I need to discover.
2017-10-18 21:51:37 +02:00
Tomaz Canabrava 304231811d
[cse] Start the job to sign the public key. 2017-10-18 21:51:37 +02:00
Tomaz Canabrava f4bbec1019
[bugfix] Return the error code, don't discard it. 2017-10-18 21:51:37 +02:00
Tomaz Canabrava 5b51346e83
[CSE] New Network Job: DeleteApiJob
This network job does a DELETE http request on a URL. It's the
second class that does basically the same, but this one returns
the http return code, and it's set to do a api call.
2017-10-18 21:51:36 +02:00
Tomaz Canabrava 9870f39dcb
[CSE] Fetch file-id for subfolders
File id is a must if we want to call any API.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2017-10-18 21:51:36 +02:00
Christian Kamm f598ac89ac HttpCreds: Fix retry after wrong password #5989
This is an ugly solution.
2017-10-13 14:24:37 +02:00
Olivier Goffart 7aca2352be
Use the Qt5 connection syntax (automated with clazy)
This is motivated by the fact that QMetaObject::noralizeSignature takes 7.35%
CPU of the LargeSyncBench. (Mostly from ABstractNetworkJob::setupConnections and
PropagateUploadFileV1::startNextChunk). It could be fixed by using normalized
signature in the connection statement, but i tought it was a good oportunity
to modernize the code.

This commit only contains calls that were automatically converted with clazy.
2017-10-05 22:01:35 +02:00
Christian Kamm ce51ea34b9
OAuth: Use redirectable jobs for oauth token management 2017-10-05 22:01:32 +02:00
Helmut K. C. Tessarek e8f17f5b0b
remove qt4 code 2017-10-05 22:01:32 +02:00
Christian Kamm b810ce7768
Update server url in case of permanent redirection #5972
This is the first time the account url may update outside of
account setup.

Summary of redirection handling:
1. During account setup (wizard)
   - status.php gets permanently redirected -> adjust url
   - authed PROPFIND gets *any* redirection -> adjust url
2. During connectivity ping (ConnectionValidator)
   - status.php gets permanently redirected -> adjust url (new!)

All other redirections should be followed transparently and
don't update the account url in the settings.
2017-10-05 22:01:05 +02:00
Christian Kamm 1c0d80c20d
Use DetermineAuthTypeJob in HttpCredentials
* Move it to networkjobs
* Minor adjustments to its logic
* Fixes redirect handling for oauth/basic http auth check #6003
2017-10-05 22:01:05 +02:00
Olivier Goffart ff4213b59f Use the Qt5 connection syntax (automated with clazy)
This is motivated by the fact that QMetaObject::noralizeSignature takes 7.35%
CPU of the LargeSyncBench. (Mostly from ABstractNetworkJob::setupConnections and
PropagateUploadFileV1::startNextChunk). It could be fixed by using normalized
signature in the connection statement, but i tought it was a good oportunity
to modernize the code.

This commit only contains calls that were automatically converted with clazy.
2017-09-21 14:05:39 +02:00
Christian Kamm 7d075cdcb7 OAuth: Use redirectable jobs for oauth token management 2017-09-15 09:28:03 +02:00
Helmut K. C. Tessarek 709aa27031 remove qt4 code 2017-09-15 07:11:05 +02:00
Christian Kamm 09173fb727 Update server url in case of permanent redirection #5972
This is the first time the account url may update outside of
account setup.

Summary of redirection handling:
1. During account setup (wizard)
   - status.php gets permanently redirected -> adjust url
   - authed PROPFIND gets *any* redirection -> adjust url
2. During connectivity ping (ConnectionValidator)
   - status.php gets permanently redirected -> adjust url (new!)

All other redirections should be followed transparently and
don't update the account url in the settings.
2017-09-11 19:27:36 +02:00
Christian Kamm de5de6284c Use DetermineAuthTypeJob in HttpCredentials
* Move it to networkjobs
* Minor adjustments to its logic
* Fixes redirect handling for oauth/basic http auth check #6003
2017-09-11 19:15:43 +02:00
Christian Kamm c8d0f788e0 Apply clang-format 2017-05-17 12:26:27 +02:00
Jocelyn Turcotte b7553d5bdf Upgrade some qCDebug to qCInfo or qCWarning
Use qCInfo for anything that has general value for support and
development. Use qCWarning for any recoverable error and qCCritical
for anything that could result in data loss or would identify a serious
issue with the code.

Issue #5647
2017-05-11 17:22:59 +02:00
Jocelyn Turcotte 4ad190a558 Use Qt logging categories for logging
This gives more insight about the logs and allow setting fine-tuned
logging rules. The categories are set to only output Info by default
so this allows us to provide more concise logging while keeping the
ability to extract more information for a specific category when
developping or debugging customer issues.

Issue #5647
2017-05-11 17:22:59 +02:00
Christian Kamm 2598579d84 Switch JsonApiJob to Qt5's QJson #5710 2017-05-08 11:50:33 +02:00
Christian Kamm cd4e647816 Merge remote-tracking branch 'origin/2.3' 2017-04-24 10:32:53 +02:00
Markus Goetz 5ac58d3b83 Server: Parse version from capabilities too #5691 (#5698)
Newer servers will have the option of hiding version, versionstring, edition
and productname. They will always send the full information in the capabilities.
2017-04-19 11:02:03 +02:00
Olivier Goffart 8cb3a77022 Merge remote-tracking branch 'origin/avatar_pics'
Also fix compilation because of 22370fdbdadd06f0cacd249a8d7a32f0d3c1374e

Pull request #5482
2017-04-13 11:54:28 +02:00
Christian Kamm 35af03b2e5 Improve http error messages; cleanup
By default QNetworkReply::errorString() often produces messages like
   "Error downloading <url> - server replied: <reason>"
but the "downloading" part invariably confuses people since the
error might very well have been produced by a PUT request.

This commit produces clearer error messages for HTTP errors.

Additionally:
* Remove some unnecessary null checks from slots connected to
  network job signals and document that these signals never send
  null replies.
* There was a bug where AbstractNetworkJob::_timedout wasn't
  set when derived classes overrode slotTimeout. We now ensure
  it's always set by disallowing overrides of slotTimeout.
  Instead it now calls onTimedOut, which allows custom handling.
* Several subclasses declared errorString, isTimedOut. Move
  these to AbstractNetworkJob.
* Unify handling of OC-ErrorString (via the new, general
  Job::errorString)
* Add documentation in various places.
2017-04-04 09:27:37 +02:00
Klaas Freitag 5e33898a08 Avatar: Use QImage instead of QPixmap to avoid dep on QApplication.
That fixes the test suite.
2017-03-09 22:34:36 +01:00
Christian Kamm 4a1a5fa076 AbstractNetworkJob: Improve redirect handling #5555
* For requests:
  - reuse the original QNetworkRequest, so headers and attributes
    are the same as in the original request
  - determine the original http method from the reply and the request
    attributes
  - keep the original request body around such that it can be sent
    again in case the request is redirected

* Simplify the interface that is used for creating new requests in
  AbstractNetworkJob.
2017-03-07 13:18:01 +01:00
Klaas Freitag b49dd02e3d New network job AvatarJob: GETs the account avatar from server. 2017-01-22 13:52:19 +01:00
Markus Goetz c6f4f44619 Fix up SSL client certificates #5213 #69 (#5289)
The re-enables the UI, uses Qt API for importing and
stores the certificate/key in the system keychain.
People who had set up client certs need to re-setup the account. This is ok
since it was an undocumented feature anyway.
2017-01-02 08:34:02 +01:00
Markus Goetz 679ac0d26a Wizard: Show if server asks for client certificate #2799 #69 (#5261)
This also nicely displays the 'Untrusted domain' message of oC.
The link to add a trusted domain (via web browser) is clickable.
2016-11-23 11:43:15 +01:00
Olivier Goffart 8ca3eb7883 Merge remote-tracking branch 'origin/master' into chunking-ng 2016-10-31 11:09:12 +01:00
Christian Kamm 10644d3568 Move concatUrl and settingsWithGroup to Utility
There was little reason to keep them cluttering Account.
2016-10-25 12:05:28 +02:00
Olivier Goffart da26e59770 Chunking-NG: add some headers when uploading chunks
These are not understood by owncloud yet, but were requested for CernBox

OC-Total-Length in the MKCOL: The full lenght of the file
OC-Chunk-Offset in the PUT: The offset within the file in which this chunk belongs
OC-Checksum in the MOVE: The transission checksum
2016-09-16 16:36:46 +02:00
Olivier Goffart fad387b6b8 Chunking-Ng: Resume 2016-08-31 10:28:15 +02:00
Olivier Goffart a1558100b8 WIP: new chunking algorithm
Current limitations of this WiP
 - No resuming implemented yet
 - No parallel chunks
 - Hackish way to get the webdav paths
2016-08-31 10:28:15 +02:00
Daniel Molkentin bb5c2cbfa5 Always follow redirects in network jobs (#4905)
This is a move away from the original policy where jobs
would only follow redirects in special cases.

Two restrictions are in place:

1. We do not allow protocol downgrades (https -> http)
2. We stop redirects after we find them looping (e.g. old = new url, or
indirectly when looping 10 times).

This is closer to RFC conforming behavior, although currently
we will treat 301 replies like they were 302. This is for a separate
commit.

Error handling (and display) also needs improvement.

Addresses #2791
2016-08-09 16:01:29 +02:00
Christian Kamm 4b19cdeca0 Propfind: Treat broken XML response as failure #4575
Soldiering on with a broken or incomplete response could lead to
incorrect sync behavior.

Since discovery uses LsCol jobs which already handle errors
correctly, this should not have a significant impact.
2016-03-17 11:32:19 +01:00
Markus Goetz d78c3679e7 Propagator: Pump in more requests if we think current ones are quick
Helps with small file sync #331
When I benchmarked this, it went up to 6 parallelism and
was about 1/3 faster than the previous fixed 3 parallelism.
Doing more than 6 is dangerous because QNAM limits to 6 TCP
connections and also the server might become a bottleneck.

Should also help for #4081
2016-03-02 15:22:21 +01:00
Hefee 28b694b170 Merge branch '2.1' 2016-02-20 10:34:34 +01:00
Olivier Goffart dd89ab59e4 Use oc:size instead of quota-used-bytes to get the sizes of folder (#4459) 2016-02-11 15:09:47 +01:00
Olivier Goffart 893e22691d ConnectionValidator: Make sure we intercept propfind error
If the PROPFIND return an invalid code (like 200) then we would
not recieve the error signal and we would never sync again.

Found while investigating https://github.com/owncloud/enterprise/issues/1068
2016-02-10 15:38:21 +01:00
Christian Kamm bdf830f691 Add an experimental ProppatchJob #3235 2015-11-23 11:59:56 +01:00
Klaas Freitag 421c6a92f3 NetworkJobs: JSON network job now reports OCS reply code.
The signal jsonReceived() now not only delivers the raw json string, but
also the status code that came as OCS reply.

Also, fixed a typo in the signals name (recieved => received).
2015-11-19 16:01:51 +01:00
Klaas Freitag 87aa1de67a Merge branch 'newactivity' 2015-11-16 17:02:05 +01:00
Klaas Freitag 9545af0d43 JSONApiJob: Add method to add additional query parameter. 2015-11-02 17:37:23 +01:00
Markus Goetz ccec186b98 ETagJob: Depth 0 for server >= 8.1 #3730 2015-10-19 15:31:27 +02:00
Phil Davis f0e17fd9c0 libtypos comment and message typos for master 2015-10-05 09:05:09 +05:45
Markus Goetz 3b59960fb3 Fix Qt4 build (SSL sessionTicket()) 2015-08-11 13:53:21 +02:00
Markus Goetz bd71fdc388 SslButton: Fix harder #3534 #3536 2015-08-11 12:18:25 +02:00
Markus Goetz 9a9cefbcc5 SslButton: Improve reliability and usefulness #3534 #3536 2015-08-05 13:04:30 +02:00
Markus Goetz eafc45d83c CheckServerJob: Only show SSL ticket warning when actually suceeded 2015-07-30 18:16:37 +02:00
Olivier Goffart 61a1a0bb2d PropfindJob: fix a debug output message
Prpfind job can be used for more than getting the quota
2015-06-26 13:32:02 +02:00
Olivier Goffart db87d2a18e QuotaJob: remove and use a PropfindJob instead
This remove code duplication because the QuotaJob was just a duplication
of the propfind jobs with the properties hardcoded.
2015-06-25 14:39:48 +02:00
Olivier Goffart dd5ddf2166 AbstractNetworkJob: move to its own file 2015-06-17 17:29:11 +02:00
Olivier Goffart ce0a0e3f0d Credential: move the implementation to the gui 2015-06-15 17:39:28 +02:00
Olivier Goffart 16786eed54 Merge pull request #3281 from owncloud/confirm
Confirm feature (sync engine part only)
2015-06-10 13:39:52 +02:00
Olivier Goffart e135d4cccf Merge remote-tracking branch 'origin/1.8' 2015-06-10 13:42:02 +02:00
Christian Kamm 2ed329e025 Improve reporting of server error messages. #3220
In particular the 'unsupported client version' error message
is now visible to the user when trying to connect to a
server that no longer supports the current client version.
2015-06-04 10:07:24 +02:00
Christian Kamm 4c10f1e40c Wizard: Show server error message if possible. #3220 2015-06-03 16:33:09 +02:00
Olivier Goffart 5cb10bf6a1 PropfindJob: fix parsing of properties that have a sub element
The default argument of readElementText is ErrorOnUnexpectedElement which
abort the parsing of remaining elements
2015-05-26 12:33:54 +02:00
Olivier Goffart 6b27d2e703 Merge remote-tracking branch 'origin/1.8' 2015-05-26 12:28:31 +02:00
Olivier Goffart 6b9e123816 Merge remote-tracking branch 'origin/checksum_1.8' into 1.8 2015-05-22 10:32:37 +02:00
Philipp Heckel 68fa190cf7 Add 'Content-Length: 0' header 2015-05-20 14:40:20 +01:00
Klaas Freitag 3701fbcbfe PropagateUpload: Add checksum calculation if required by config.
If the config file has an transmissionChecksum entry, a checksum
is added to the PUT requests in a header.
2015-05-19 17:09:39 +02:00
Markus Goetz 2a45ebde33 Networkjobs: Fix Qt 4 compile (again) 2015-05-12 17:19:17 +02:00
Daniel Molkentin a36df4aa4b Merge remote-tracking branch 'origin/1.8' into 1.9 2015-05-12 09:57:22 +02:00
Markus Goetz f2004da867 SSL: Re-use encryption session for different TCP connections #3159
This also improves the SSL configuration creation and fixes #3027
2015-05-08 14:21:27 +02:00
Markus Goetz 0359c775e0 Discovery: Test better, treat invalid hrefs as error #3176 2015-05-07 17:19:48 +02:00
Markus Goetz 2866e56c51 LsColXMLParser: More testing 2 2015-04-14 14:56:25 +02:00
Klaas Freitag 4283ab3b44 LsColJob: Create a XML parser object for better unit testability. 2015-04-14 13:43:05 +02:00
Markus Goetz 9ffacd4ecd Discovery: Explicitly check for XML parser errors
..instead of relying that our state machine does not do anything in that case.
2015-04-13 16:04:24 +02:00
Klaas Freitag ec81cdefb0 Networkjobs: Only log a subset of the account url.
This avoids disclosing of user and password in the logfile which can
happen in some cases.
2015-04-12 12:37:14 +02:00
Olivier Goffart 1617c9d482 PropfindJob: fix xml parsing
It would only find the first property
2015-04-07 10:35:27 +02:00
Jocelyn Turcotte 3c9acdf724 Fix a crash when accessing a dangling UploadDevice pointer #2984
This is largely a guess, but this is the only place where we use
a QIODevice to push data through QNAM and that the QIODevice isn't
a direct child of the QNetworkReply.

Fix the issue by making sure that we don't go back to the event loop
and possibly handle network events between the destruction of the
upload QIODevice and the QNetworkReply, which might lead to QNAM
dereferencing a dangling QIODevice pointer.
2015-03-23 16:14:54 +01:00
Klaas Freitag c88742fad3 Revert "SetupW: Display proper error messages if password or user was wrong."
This reverts commit 396f38598f.

This adds redundant code and potentially breaks Shibboleth
2015-03-10 11:17:35 +01:00
Markus Goetz 31e4009737 Propagator: Use QBA for responseTimestamp instead of QString 2015-03-09 15:52:52 +01:00
Klaas Freitag 396f38598f SetupW: Display proper error messages if password or user was wrong.
If the password or user was wrong during setup, the client showed a
ConnectionClosed error instead of a proper Username or password wrong
message. This was because in HTTPCredentials::slotAuthentication, the
reply is closed, and a property is set to indicate the auth problem.

This patch now checks at all occurences of networkErrors if it might
have been an authentication problem, and displays something useful.

There is a good chance that this is a sufficient fix for
owncloud/enterprise#556
2015-03-06 16:41:59 +01:00
Markus Goetz 3f712dce02 ETags: For Folder and RequestEtagJob, always use Concatenation 2015-03-05 17:49:12 +01:00
Olivier Goffart bd6769a3fd LsColJob: one must now specify the properties
So the discovery phase don't ask for the quota, and the selective sync
don't ask for all the other properties

Issue #2906
2015-03-02 11:03:25 +01:00
Christian Kamm c8167b77c9 Remove mention of allprop #2865 2015-02-26 12:36:11 +01:00
Olivier Goffart 438c4fe72e Account: put the server version in the account 2015-02-12 14:50:42 +01:00
Olivier Goffart 51337a10af LSCOL job: Fix getting the list of folders when there are non-ascii
Task #2795
2015-02-08 12:23:47 +01:00
Olivier Goffart 34237f604e JsonApiJob: Refactor out of the shibbolethuserjob 2015-02-05 15:42:01 +01:00
Olivier Goffart d70e146c1f Merge remote-tracking branch 'origin/ssl_client_cert'
Conflicts:
	CMakeLists.txt
	csync/src/CMakeLists.txt
	csync/src/csync_owncloud.c
2015-01-28 14:13:40 +01:00