Skip to content

Commit fc89cfc

Browse files
authored
Merge branch 'dev' into tefa/lazy-load-accesskey-5
2 parents 154ff11 + 30d6a43 commit fc89cfc

27 files changed

+688
-830
lines changed

build/dependencies.props

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@
3333
<SystemIOPipelinesPackageVersion>8.0.0</SystemIOPipelinesPackageVersion>
3434
<MicrosoftOwinPackageVersion>4.2.2</MicrosoftOwinPackageVersion>
3535
<OwinPackageVersion>1.0.0</OwinPackageVersion>
36-
<MicrosoftAspNetCoreConnectionsAbstractionsNet8PackageVersion>8.0.8</MicrosoftAspNetCoreConnectionsAbstractionsNet8PackageVersion>
36+
<MicrosoftAspNetCoreConnectionsAbstractionsNet8PackageVersion>8.0.11</MicrosoftAspNetCoreConnectionsAbstractionsNet8PackageVersion>
3737
<MicrosoftExtensionsDependencyInjectionNet8PackageVersion>8.0.0</MicrosoftExtensionsDependencyInjectionNet8PackageVersion>
38-
<MicrosoftAspNetCoreHttpConnectionsCommonNet8PackageVersion>8.0.8</MicrosoftAspNetCoreHttpConnectionsCommonNet8PackageVersion>
38+
<MicrosoftAspNetCoreHttpConnectionsCommonNet8PackageVersion>8.0.11</MicrosoftAspNetCoreHttpConnectionsCommonNet8PackageVersion>
3939
<MicrosoftExtensionsLoggingAbstractionsNet8PackageVersion>8.0.1</MicrosoftExtensionsLoggingAbstractionsNet8PackageVersion>
40-
<MicrosoftAspNetCoreSignalRCommonNet8PackageVersion>8.0.8</MicrosoftAspNetCoreSignalRCommonNet8PackageVersion>
40+
<MicrosoftAspNetCoreSignalRCommonNet8PackageVersion>8.0.11</MicrosoftAspNetCoreSignalRCommonNet8PackageVersion>
4141

4242
<!-- SignalR Management -->
4343
<AzureCorePackageVersion>1.39.0</AzureCorePackageVersion>
@@ -55,6 +55,13 @@
5555

5656
<!--Emulator, self-contained, always try the latest version -->
5757
<MicrosoftExtensionsCommandLineUtilsPackageVersion>1.1.1</MicrosoftExtensionsCommandLineUtilsPackageVersion>
58-
<EmulatorMicrosoftPackageVersion>8.0.8</EmulatorMicrosoftPackageVersion></PropertyGroup>
58+
<EmulatorMicrosoftPackageVersion>8.0.11</EmulatorMicrosoftPackageVersion>
59+
60+
<!-- Vulnerability fix-->
61+
<jQueryPackageVersion>3.7.1</jQueryPackageVersion>
62+
<MessagePackPackageVersion>2.5.192</MessagePackPackageVersion>
63+
<SystemNetHttpPackageVersion>4.3.4</SystemNetHttpPackageVersion>
64+
<SystemTextRegularExpressionsPackageVersion>4.3.1</SystemTextRegularExpressionsPackageVersion>
65+
</PropertyGroup>
5966
<Import Project="$(DotNetPackageVersionPropsPath)" Condition=" '$(DotNetPackageVersionPropsPath)' != '' " />
6067
</Project>

samples/Directory.Build.props

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
<Project>
22
<Import Project="..\Directory.Build.props" />
33
<Import Project="..\build\dependencies.private.props" />
4+
<PropertyGroup>
5+
<WarningsNotAsErrors>NU1902</WarningsNotAsErrors>
6+
</PropertyGroup>
7+
<ItemGroup>
8+
<PackageReference Include="MessagePack" Version="$(MessagePackPackageVersion)" />
9+
</ItemGroup>
410
</Project>

src/Common/MemoryBufferWriter.cs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Copyright (c) Microsoft. All rights reserved.
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
3+
#nullable enable
34

45
using System;
56
using System.Buffers;
@@ -14,7 +15,7 @@ namespace Microsoft.Azure.SignalR
1415
internal sealed class MemoryBufferWriter : Stream, IBufferWriter<byte>
1516
{
1617
[ThreadStatic]
17-
private static MemoryBufferWriter _cachedInstance;
18+
private static MemoryBufferWriter? _cachedInstance;
1819

1920
#if DEBUG
2021
private bool _inUse;
@@ -23,8 +24,8 @@ internal sealed class MemoryBufferWriter : Stream, IBufferWriter<byte>
2324
private readonly int _minimumSegmentSize;
2425
private int _bytesWritten;
2526

26-
private List<CompletedBuffer> _completedSegments;
27-
private byte[] _currentSegment;
27+
private List<CompletedBuffer>? _completedSegments;
28+
private byte[]? _currentSegment;
2829
private int _position;
2930

3031
public MemoryBufferWriter(int minimumSegmentSize = 4096)
@@ -107,14 +108,14 @@ public Memory<byte> GetMemory(int sizeHint = 0)
107108
{
108109
EnsureCapacity(sizeHint);
109110

110-
return _currentSegment.AsMemory(_position, _currentSegment.Length - _position);
111+
return _currentSegment.AsMemory(_position, _currentSegment!.Length - _position);
111112
}
112113

113114
public Span<byte> GetSpan(int sizeHint = 0)
114115
{
115116
EnsureCapacity(sizeHint);
116117

117-
return _currentSegment.AsSpan(_position, _currentSegment.Length - _position);
118+
return _currentSegment.AsSpan(_position, _currentSegment!.Length - _position);
118119
}
119120

120121
public void CopyTo(IBufferWriter<byte> destination)
@@ -137,7 +138,7 @@ public override Task CopyToAsync(Stream destination, int bufferSize, Cancellatio
137138
if (_completedSegments == null)
138139
{
139140
// There is only one segment so write without awaiting.
140-
return destination.WriteAsync(_currentSegment, 0, _position);
141+
return destination.WriteAsync(_currentSegment!, 0, _position);
141142
}
142143

143144
return CopyToSlowAsync(destination);
@@ -194,7 +195,7 @@ private async Task CopyToSlowAsync(Stream destination)
194195
}
195196
}
196197

197-
await destination.WriteAsync(_currentSegment, 0, _position);
198+
await destination.WriteAsync(_currentSegment!, 0, _position);
198199
}
199200

200201
public byte[] ToArray()
@@ -270,7 +271,7 @@ public override void WriteByte(byte value)
270271
else
271272
{
272273
AddSegment();
273-
_currentSegment[0] = value;
274+
_currentSegment![0] = value;
274275
}
275276

276277
_position++;

src/Microsoft.Azure.SignalR.AspNet/Microsoft.Azure.SignalR.AspNet.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@
55
<LangVersion>11</LangVersion>
66
<RootNamespace>Microsoft.Azure.SignalR.AspNet</RootNamespace>
77
<TargetFramework>net462</TargetFramework>
8+
<!-- jQuery is not used in this library, upgrading jQuery to 3.x might potentially break users using 1.x, so ignore this warning -->
9+
<WarningsNotAsErrors>NU1902</WarningsNotAsErrors>
810
</PropertyGroup>
911

1012
<ItemGroup>
1113
<!-- Directly reference Microsoft.Owin 4.x for security fix -->
1214
<PackageReference Include="Microsoft.Owin" Version="$(MicrosoftOwinPackageVersion)" />
1315
<PackageReference Include="Microsoft.AspNet.SignalR" Version="$(MicrosoftAspNetSignalRPackageVersion)" />
1416
<PackageReference Include="Microsoft.Extensions.Logging.EventSource" Version="$(MicrosoftExtensionsLoggingEventSourcePackageVersion)" />
15-
1617
</ItemGroup>
1718

1819
<ItemGroup>

src/Microsoft.Azure.SignalR.Common/Constants.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ internal static class Constants
2222
public const string AsrsDefaultScope = "https://signalr.azure.com/.default";
2323

2424

25-
public const int DefaultCloseTimeoutMilliseconds = 30000;
25+
public const int DefaultCloseTimeoutMilliseconds = 10000;
2626

2727
public static class Keys
2828
{

src/Microsoft.Azure.SignalR.Common/Utilities/TaskExtenstions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ public static async Task OrCancelAsync(this Task task, CancellationToken token,
1818
{
1919
// make sure the task throws exception if any
2020
await anyTask;
21+
tcs.TrySetCanceled();
2122
}
2223
else
2324
{

src/Microsoft.Azure.SignalR.Emulator/Microsoft.Azure.SignalR.Emulator.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,8 @@
1515
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="$(EmulatorMicrosoftPackageVersion)" />
1616
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="$(EmulatorMicrosoftPackageVersion)" />
1717
<PackageReference Include="Microsoft.Extensions.CommandLineUtils" Version="$(MicrosoftExtensionsCommandLineUtilsPackageVersion)" />
18+
<PackageReference Include="MessagePack" Version="$(MessagePackPackageVersion)" />
19+
<PackageReference Include="System.Net.Http" Version="$(SystemNetHttpPackageVersion)" />
20+
<PackageReference Include="System.Text.RegularExpressions" Version="$(SystemTextRegularExpressionsPackageVersion)" />
1821
</ItemGroup>
1922
</Project>
Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
// Copyright (c) Microsoft. All rights reserved.
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

4+
#nullable enable
45
using System.Buffers;
56

6-
namespace Microsoft.Azure.SignalR.Serverless.Protocols
7+
namespace Microsoft.Azure.SignalR.Serverless.Protocols;
8+
9+
public interface IServerlessProtocol
710
{
8-
public interface IServerlessProtocol
9-
{
10-
// TODO: Have a discussion about how to handle version change.
11-
/// <summary>
12-
/// Gets the version of the protocol.
13-
/// </summary>
14-
int Version { get; }
11+
// TODO: Have a discussion about how to handle version change.
12+
/// <summary>
13+
/// Gets the version of the protocol.
14+
/// </summary>
15+
int Version { get; }
1516

16-
/// <summary>
17-
/// Creates a new <see cref="ServerlessMessage"/> from the specified serialized representation.
18-
/// </summary>
19-
/// <param name="input">The serialized representation of the message.</param>
20-
/// <param name="message">When this method returns <c>true</c>, contains the parsed message.</param>
21-
/// <returns>A value that is <c>true</c> if the <see cref="ServerlessMessage"/> was successfully parsed; otherwise, <c>false</c>.</returns>
22-
bool TryParseMessage(ref ReadOnlySequence<byte> input, out ServerlessMessage message);
23-
}
17+
/// <summary>
18+
/// Creates a new <see cref="ServerlessMessage"/> from the specified serialized representation.
19+
/// </summary>
20+
/// <param name="input">The serialized representation of the message.</param>
21+
/// <param name="message">When this method returns <c>true</c>, contains the parsed message.</param>
22+
/// <returns>A value that is <c>true</c> if the <see cref="ServerlessMessage"/> was successfully parsed; otherwise, <c>false</c>.</returns>
23+
bool TryParseMessage(ref ReadOnlySequence<byte> input, out ServerlessMessage? message);
2424
}

src/Microsoft.Azure.SignalR.Serverless.Protocols/Internal/Constants.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Copyright (c) Microsoft. All rights reserved.
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
3+
#nullable enable
34

45
namespace Microsoft.Azure.SignalR.Serverless.Protocols;
56

0 commit comments

Comments
 (0)