Skip to content

Commit

Permalink
Version 1.0.7-alpha
Browse files Browse the repository at this point in the history
* General
- Added an explicit authentication method for cloud gateways. All other gateway methods still require successful authentication to the cloud service. **Note:** This breaks compatibility with the previous versions of `ICloudGateway` and `IAsyncCloudGateway`.
- Fixed cross-thread marshalling of authentication tokens

*  Updated NuGet packages
- Box.V2 to version 2.10.0
- Google.Apis.Drive.v2/v3 to version 1.15.0.567
- OneDrive SDK to official version 1.1.47 
- NewtonSoft.Json to version 9.0.1

* Gateways
- Updated OneDrive gateway to use official Microsoft OneDrive SDK for CSharp version 1.1.47 from https://github.com/OneDrive/onedrive-sdk-csharp
- Fixed capabilities for OneDrive gateway to support empty files
- Updated GDrive gateway to use Google Drive API v3
- Renamed and moved legacy gateways for OneDrive and Google Drive v2
- Fixed missing assembly signing configuration for hubiC gateway in build configuration //Signed//
- Included local build of MediaFireSDK with support for MediaFire session token v2 (lifetime 2 years instead of 10 minutes)
  • Loading branch information
viciousviper authored Aug 7, 2016
1 parent 3a67d48 commit ec7715a
Show file tree
Hide file tree
Showing 104 changed files with 2,837 additions and 742 deletions.
1 change: 0 additions & 1 deletion CloudFS.Authentication/BrowserLogOn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
using System.Windows;
using System.Windows.Controls;
using System.Windows.Interop;
using System.Windows.Threading;

namespace IgorSoft.CloudFS.Authentication
{
Expand Down
10 changes: 8 additions & 2 deletions CloudFS.Authentication/LogOnBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE

namespace IgorSoft.CloudFS.Authentication
{
public abstract class LogOnBase
public abstract class LogOnBase : IDisposable
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1060:MovePInvokesToNativeMethodsClass")]
[System.Runtime.InteropServices.DllImport("user32.dll")]
protected static extern bool SetForegroundWindow(IntPtr hWnd);
internal static extern bool SetForegroundWindow(IntPtr hWnd);

private readonly EventWaitHandle waitHandle = new EventWaitHandle(false, EventResetMode.AutoReset);

Expand Down Expand Up @@ -90,6 +90,12 @@ protected void OnAuthenticated(NameValueCollection parameters)
synchonizationContext.Post(state => handler?.Invoke(this, (AuthenticatedEventArgs)state), new AuthenticatedEventArgs(parameters));
}

public void Dispose()
{
waitHandle.Dispose();
GC.SuppressFinalize(this);
}

public event EventHandler<AuthenticatedEventArgs> Authenticated;
}
}
7 changes: 7 additions & 0 deletions CloudFS.Authentication/OAuth/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ namespace IgorSoft.CloudFS.Authentication.OAuth
{
public static class Constants
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
public static class Parameters
{
public const string ResponseType = "response_type";
Expand All @@ -51,12 +52,14 @@ public static class Parameters
public const string ResponseMode = "response_mode";
}

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
public static class ResponseTypes
{
public const string Code = "code";
public const string Token = "token";
}

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
public static class GrantTypes
{
public const string AuthorizationCode = "authorization_code";
Expand All @@ -65,11 +68,13 @@ public static class GrantTypes
public const string Password = "password";
}

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
public static class TokenTypes
{
public const string Bearer = "bearer";
}

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
public static class Errors
{
public const string InvalidRequest = "invalid_request";
Expand All @@ -80,12 +85,14 @@ public static class Errors
public const string UnauthorizedClient = "unauthorized_client";
}

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
public static class Extra
{
public const string ClientId = "client_id";
public const string RedirectUri = "redirect_uri";
}

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
public static class ResponseModes
{
public const string FormPost = "form_post";
Expand Down
24 changes: 12 additions & 12 deletions CloudFS.Authentication/UIThread.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,18 @@ public static class UIThread
public static Dispatcher GetDispatcher()
{
if (dispatcher == null) {
var waitHandle = new EventWaitHandle(false, EventResetMode.AutoReset);

var uiThread = new Thread(() =>
{
dispatcher = Dispatcher.CurrentDispatcher;
waitHandle.Set();
Dispatcher.Run();
}) { Name = "UI-Thread" };
uiThread.SetApartmentState(ApartmentState.STA);
uiThread.Start();

waitHandle.WaitOne();
using (var waitHandle = new EventWaitHandle(false, EventResetMode.AutoReset)) {
var uiThread = new Thread(() =>
{
dispatcher = Dispatcher.CurrentDispatcher;
waitHandle.Set();
Dispatcher.Run();
}) { Name = "UI-Thread" };
uiThread.SetApartmentState(ApartmentState.STA);
uiThread.Start();

waitHandle.WaitOne();
}
}

return dispatcher;
Expand Down
7 changes: 4 additions & 3 deletions CloudFS.GatewayTests/App.Signed.config
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@
<test libPath=".\Gateways">
<gateways>
<gateway schema="box" type="Async" userName="BoxUser" mount="B" exclusions="None" />
<!--<gateway schema="copy" type="Async" userName="CopyUser" mount="Y" exclusions="CopyDirectoryItem,CopyFileItem,MoveDirectoryItem,MoveFileItem,RenameDirectoryItem,RenameFileItem" />-->
<!--<gateway schema="copy" type="Async" userName="CopyUser" mount="Z" exclusions="CopyDirectoryItem,CopyFileItem,MoveDirectoryItem,MoveFileItem,RenameDirectoryItem,RenameFileItem" />-->
<gateway schema="file" type="Sync" mount="F" parameters="root=..\..\..\TestData" exclusions="ItemId" />
<gateway schema="gdrive" type="Async" userName="GDriveUser" mount="G" exclusions="CopyDirectoryItem" />
<gateway schema="hubic" type="Async" userName="hubiCUser" mount="H" parameters="container=default" exclusions="CopyDirectoryItem,MoveDirectoryItem,MoveFileItem,RenameDirectoryItem,RenameFileItem,ItemId" />
<gateway schema="mediafire" type="Async" userName="MediaFireUser" mount="M" exclusions="ClearContent,CopyDirectoryItem" />
<gateway schema="mega" type="Async" userName="MegaUser" mount="N" exclusions="ClearContent,SetContent,CopyDirectoryItem,CopyFileItem,RenameDirectoryItem,RenameFileItem" />
<gateway schema="onedrive" type="Async" userName="OneDriveUser" mount="O" exclusions="ClearContent" />
<gateway schema="onedrive" type="Async" userName="OneDriveUser" mount="O" />
<gateway schema="onedrive_legacy" type="Async" userName="OneDriveUser" mount="Q" exclusions="ClearContent" testDirectory="FileSystemTests-Legacy" />
<gateway schema="pcloud" type="Async" userName="pCloudUser" mount="P" exclusions="CopyDirectoryItem" />
<gateway schema="yandex" type="Async" userName="YandexUser" mount="X" exclusions="ItemId" />
<gateway schema="yandex" type="Async" userName="YandexUser" mount="Y" exclusions="ItemId" />
</gateways>
</test>
</configuration>
8 changes: 5 additions & 3 deletions CloudFS.GatewayTests/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@
<test libPath=".\Gateways">
<gateways>
<gateway schema="box" type="Async" userName="BoxUser" mount="B" exclusions="None" />
<!--<gateway schema="copy" type="Async" userName="CopyUser" mount="Y" exclusions="CopyDirectoryItem,CopyFileItem,MoveDirectoryItem,MoveFileItem,RenameDirectoryItem,RenameFileItem" />-->
<!--<gateway schema="copy" type="Async" userName="CopyUser" mount="Z" exclusions="CopyDirectoryItem,CopyFileItem,MoveDirectoryItem,MoveFileItem,RenameDirectoryItem,RenameFileItem" />-->
<gateway schema="file" type="Sync" mount="F" parameters="root=..\..\..\TestData" exclusions="ItemId" />
<gateway schema="gdrive" type="Async" userName="GDriveUser" mount="G" exclusions="CopyDirectoryItem" />
<gateway schema="gdrive_v2" type="Async" userName="GDriveUser" mount="X" exclusions="CopyDirectoryItem" testDirectory="FileSystemTests-V2" />
<gateway schema="hubic" type="Async" userName="hubiCUser" mount="H" parameters="container=default" exclusions="CopyDirectoryItem,MoveDirectoryItem,MoveFileItem,RenameDirectoryItem,RenameFileItem,ItemId" />
<gateway schema="mediafire" type="Async" userName="MediaFireUser" mount="M" exclusions="ClearContent,CopyDirectoryItem" />
<gateway schema="mega" type="Async" userName="MegaUser" mount="N" exclusions="ClearContent,SetContent,CopyDirectoryItem,CopyFileItem,RenameDirectoryItem,RenameFileItem" />
<gateway schema="onedrive" type="Async" userName="OneDriveUser" mount="O" exclusions="ClearContent" />
<gateway schema="onedrive" type="Async" userName="OneDriveUser" mount="O" />
<gateway schema="onedrive_legacy" type="Async" userName="OneDriveUser" mount="Q" exclusions="ClearContent" testDirectory="FileSystemTests-Legacy" />
<gateway schema="pcloud" type="Async" userName="pCloudUser" mount="P" exclusions="CopyDirectoryItem" />
<gateway schema="yandex" type="Async" userName="YandexUser" mount="X" exclusions="ItemId" />
<gateway schema="yandex" type="Async" userName="YandexUser" mount="Y" exclusions="ItemId" />
</gateways>
</test>
</configuration>
Loading

0 comments on commit ec7715a

Please sign in to comment.