Commit Graph
42 Commits
Author SHA1 Message Date
verhoek 55e349f410 Renamed variable to indicate meaning properly. 2018-05-09 18:57:04 +02:00
Tyler Gill f93f9dcc5a Add new utility class, OAuthHttpClient.
This class extends HttpClient and uses an OAuthHttpMessageHandler under the covers to automatically authenticate requests.
Additionally, it automatically respects the global HttpContextSettings for overall timeout, read/write timeout, and SSL certificate validation.
(BufferRequests isn't currently handled, as HttpClient doesn't seem to easily expose that flag, and as of .NET 4.5, seems to not buffer by default.)
2018-03-23 15:07:51 -06:00
Tyler Gill 97a93a071f Make m_oauth readonly in OAuthHttpMessageHandler. 2018-03-21 11:23:50 -06:00
Tyler Gill 4578a5bd91 Merge branch 'master' of https://github.com/duplicati/duplicati into feature/ms-graph-backends 2018-03-20 14:24:48 -06:00
Tyler Gill 20fc793dee Add OAuthHttpMessageHandler helper class to OAuthHelper library.
This class implements the abstract HttpMessageHandler class (mostly via the default HttpClientHandler implementation).
This abstract class is used by System.Net.Http.HttpClient as the underlying HTTP mechanism, and in this particular case is used to automatically add an authorization header to each request.
It also provides a method for marking a request as one that should not be authenticated.
2018-03-20 14:00:52 -06:00
Tyler Gill f9a8b30b2f Update JSONWebHelper.PostAndGetJSONData to remove parameters that aren't actually being used (setup and setupreq).
These parameters weren't being used in the method body, or being passed in by any callers (it looks like a copy / paste error when a previous method was converted into this one)
These are replaced with a new optional parameter (method) which allows the caller to request a custom HTTP method to be used.
2018-03-20 13:56:05 -06:00
Kenneth Skovhede 842fd96543 Implemented a new logging system that is more transparent and allows a more granular way of picking log messages.
Added ID's to each log message and each exception to allow later introduction of a Knowledgebase service that explains each error in more detail.
2018-03-15 09:12:34 +01:00
Kenneth Hsu 5fb1958ceb Remove redundant calls to ToString. 2017-11-26 15:44:34 -08:00
Kenneth Hsu 3d51e9153b Avoid signing assemblies.
Using strong-named assemblies can cause difficulties with the GNU LGPL
license, which allows for one to recombine or relink their application
with modified versions of the code.  While one solution is to share the
private key so that people can sign the assemblies themselves, this
would break the trust that is expected from signed assemblies.  For now,
the easiest fix is to simply not sign the assemblies.  Note that by
doing so, we prevent the code from being referenced from other signed
assemblies.

This also fixes an issue introduced in revision ba94d36a80 ("Added
auto-update for WindowsService and Service."), where the WindowsService
project (signed) referenced the AutoUpdater project (not signed).

We also removed instances of <SignAssembly>false</SignAssembly> to be
consistent with newly created .csproj files that do not contain the
SignAssembly element.

This was motivated by the discussion in issue #2814.
2017-10-15 22:00:23 -07:00
Kenneth Skovhede a06f38442a Updated all Newtonsoft.Json packages 2017-09-23 00:25:50 +02:00
Kenneth Skovhede 19a040970f Implemented call-context aware settings for HTTP options, temp folder settings, buffers sizes and oauth settings.
This makes it more smooth to run multiple operations in parellel, but it should be possible to launch an operation in a separate app-domain
2017-09-04 11:05:16 +02:00
Kenneth Skovhede 046b522a8d Updated NewtonSoft.Json 2017-05-17 11:08:51 +02:00
Kenneth Skovhede a7b46b622c Spelling fix in documentation 2017-03-03 20:50:11 +01:00
Kenneth Skovhede a029890409 Implemented better default error messsages 2017-01-09 11:35:38 +01:00
Kenneth Skovhede 52eb8e8478 Disabled MSBuild for much faster builds on MacOS 2016-12-29 23:12:41 +01:00
Kenneth Skovhede 0c68daff6c Fixed all whitespace to be 4 spaces instead of tabs 2016-09-15 11:39:27 +02:00
Kenneth Skovhede 5a03b573cd Extended OAuthHelper to work better with the Dropbox OAuth implementation 2016-09-08 15:03:16 +02:00
Kenneth Skovhede bde606ae60 Updated packages 2016-06-27 15:30:25 +02:00
Kenneth Skovhede 3005594b38 Merge branch 'master' into nuget_setup
# Conflicts:
#	Duplicati/GUI/Duplicati.GUI.TrayIcon/Duplicati.GUI.TrayIcon.csproj
#	Duplicati/Library/Backend/S3/Duplicati.Library.Backend.S3.csproj
#	Duplicati/Library/Backend/S3/S3Wrapper.cs
#	thirdparty/CoCoL/CoCoL.dll
#	thirdparty/SSH.NET/Renci.SshNet.dll
2016-06-27 15:25:52 +02:00
Kenneth Skovhede 5f7e63ae78 Fixed the timeout issue 2016-04-16 17:51:44 +02:00
Kenneth Skovhede d0711011a2 Rewrote all WebRequest code to use AsyncHttpRequest, and normalized usage such that WebResponse objects are always correctly disposed. 2016-04-16 11:12:28 +02:00
Kenneth Skovhede d1c7fdab5f Merge branch 'feature/suport_for_v2_authid' 2016-04-13 10:32:49 +02:00
Kenneth Skovhede c94fde3a52 Re-fix whitespace 2016-04-13 10:32:31 +02:00
Kenneth Skovhede 785c4d325f Reverted changes to solution file so it again forces Windows linefeeds.
This also moved stuff around in some project files.
2016-04-13 00:36:22 +02:00
Kenneth Skovhede d9ecec0e5f Added reading of oauth-v2 tokens if provided 2016-04-10 20:55:01 +02:00
Kenneth Skovhede 59cc0005a3 Removed unused references and updated most libraries to come from NuGet sources instead of being provided in the thirdparty library 2016-01-29 10:47:39 +01:00
Kenneth Skovhede ba827a31af Bugfix for showing the correct error message when the AuthID parameter is missing 2016-01-12 09:52:58 +01:00
Kenneth Skovhede 91b393de3f Implemented fast fail, if the server reports a client error (e.g. dont wait 10 seconds to report invalid credentials). 2015-12-15 21:06:43 +01:00
Kenneth Skovhede c200dbf8aa Implemented som nice helper functions for the multipart upload feature 2015-12-07 21:01:42 +01:00
Kenneth Skovhede 5e35d30a61 Added support for multi-part uploads in the helper class 2015-12-07 09:53:13 +01:00
Kenneth Skovhede a9e34a1625 Virtualized some methods in the JSONHelper and added a method for capturing custom error messages 2015-12-05 14:19:44 +01:00
Kenneth Skovhede a53686d1d0 Moved the JSON helper methods out of the OAuthHelper and into the JSONHelper class.
Added a new method to also POST JSON data.
2015-12-05 11:27:21 +01:00
Kenneth Skovhede 9517af31cc Removed some unused variables and improved the use of a non-standard --oauth-url 2015-08-25 16:02:33 +01:00
Kenneth Skovhede 6dac0f3c2e Fixed an invalid line-ending character 2015-08-05 13:51:56 +02:00
Kenneth Skovhede 4160d472ec Improved the OAuth helper error handling in cases where the server return 503 2015-07-10 10:28:06 +02:00
Kenneth Skovhede 42838ba0a9 Added retries with exponential backoff for reading the OAuth token.
This fixes #1413.
2015-07-10 01:33:21 +02:00
Kenneth Skovhede 67f09fb105 Added options to use an external OAuth server.
This fixes #1403.
2015-07-10 01:16:41 +02:00
Kenneth Skovhede d2fd1cb5e3 Updated version stamps in new projects 2015-07-02 21:32:58 +02:00
Kenneth Skovhede a359b3bbae The OAuthHelper was a mix of JSON web requests and OAuth calls, so now it has been split into two. 2015-07-01 09:39:13 +02:00
Kenneth Skovhede fed160fa1c Implemented chunked-resumeable uploads for Google Drive for issue #1347.
Implemented a Google Cloud Storage backend, which closes #784.
This also adds support for Nearline and DRA so it closes #1385.
2015-06-29 22:37:31 +02:00
Kenneth Skovhede fc29aacff8 Removed the Google API, now running directly on the REST API. 2015-06-27 01:13:30 +02:00
Kenneth Skovhede 3fc9102acc Implemented the Google Drive backend, and trashed the Google Docs backend for issue #1347 2015-06-22 14:41:54 +02:00