Skip to content

Commit

Permalink
Updated to signalR 1.0.0-preview2-final.
Browse files Browse the repository at this point in the history
  • Loading branch information
dicky authored and dicky committed Apr 13, 2018
1 parent 9e05cb3 commit 01d8aed
Show file tree
Hide file tree
Showing 43 changed files with 3,332 additions and 1,910 deletions.
37 changes: 36 additions & 1 deletion ASP.NET Core Demo/UnitTests/MockDotNetifyHub.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
using DotNetify;
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http.Features;
using System.Threading;

namespace UnitTests
{
Expand Down Expand Up @@ -84,6 +86,12 @@ public Task SendAsync(string method, object[] args)
Hub.GetType().GetMethod(method).Invoke(Hub, args);
return Task.CompletedTask;
}

public Task SendCoreAsync(string method, object[] args)
{
Hub.GetType().GetMethod(method).Invoke(Hub, (object[])args[0]);
return Task.CompletedTask;
}
}

private class MockHubConnectionContext : HubConnectionContext
Expand All @@ -100,6 +108,33 @@ private class MockHubConnectionContext : HubConnectionContext
public override string ConnectionId => _mockConnectionId;
}

private class MockHubCallerContext : HubCallerContext
{
private readonly HubConnectionContext _connectionContext;

public MockHubCallerContext(HubConnectionContext connectionContext) : base()
{
_connectionContext = connectionContext;
}

public override string ConnectionId => _connectionContext.ConnectionId;

public override string UserIdentifier => _connectionContext.User.Identity.Name;

public override ClaimsPrincipal User => _connectionContext.User;

public override IDictionary<object, object> Items => throw new NotImplementedException();

public override IFeatureCollection Features => throw new NotImplementedException();

public override CancellationToken ConnectionAborted => throw new NotImplementedException();

public override void Abort()
{
throw new NotImplementedException();
}
}

public MockDotNetifyHub Create()
{
_hub = new DotNetifyHub(
Expand All @@ -109,7 +144,7 @@ public MockDotNetifyHub Create()
new HubPipeline(_middlewareFactories, _vmFilterFactories),
new MockHubContext() { MockHubClients = new MockHubClients { MockClientProxy = new MockClientProxy { Hub = this } } })
{
Context = new HubCallerContext(new MockHubConnectionContext(ConnectionId))
Context = new MockHubCallerContext(new MockHubConnectionContext(ConnectionId))
};
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Diagnostics" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Routing" Version="2.1.0-preview1-final" />
<PackageReference Include="Microsoft.AspNetCore.Routing" Version="2.1.0-preview2-final" />
<PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.0.0" />
Expand Down
4 changes: 2 additions & 2 deletions ASP.NET Core Demo/WebApplication.Knockout/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
"knockout": "^3.4.1",
"requirejs": "^2.3.2",
"signalr": "^2.2.2",
"@aspnet/signalr": "1.0.0-preview1-final"
"@aspnet/signalr": "1.0.0-preview2-final"
},
"devDependencies": {
"grunt": "^1.0.1",
"grunt-contrib-clean": "^1.0.0",
"grunt-contrib-copy": "^1.0.0",
"grunt-contrib-uglify": "^2.0.0"
}
}
}
8 changes: 3 additions & 5 deletions ASP.NET Core Demo/WebApplication.Knockout/web.config
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>

<!--
Configure your application settings in appsettings.json. Learn more at http://go.microsoft.com/fwlink/?LinkId=786380
-->

<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false"/>
<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false" startupTimeLimit="3600" requestTimeout="23:00:00" />
</system.webServer>
</configuration>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ var dotNetify = {};

dotnetify = $.extend(dotnetify,
{
version: "1.1.5",
version: "1.2.0",

// SignalR hub options.
hub: dotnetifyHub,
Expand Down Expand Up @@ -65,6 +65,12 @@ var dotNetify = {};

dotnetifyHub.client.response_VM = function (iVMId, iVMData) {

// SignalR .NET Core is sending an array of arguments.
if (Array.isArray(iVMId)) {
iVMData = iVMId[1];
iVMId = iVMId[0];
}

// Report unauthorized access.
if (iVMData == "403") {
console.error("Unauthorized access to " + iVMId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ limitations under the License.
// Add plugin functions.
dotnetify.router =
{
version: "1.1.3",
version: "1.2.0",

// URL path that will be parsed when performing routing.
urlPath: document.location.pathname,
Expand Down
Loading

0 comments on commit 01d8aed

Please sign in to comment.