Skip to content

Commit 29b68ad

Browse files
author
Greg Domzalski
authored
Merge pull request #639 from Yubico/upgrade-deps
Upgrade dependencies and make necessary updates.
2 parents 56f2389 + 9878e28 commit 29b68ad

27 files changed

+66
-109
lines changed

Yubico.Core/src/Yubico.Core.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ limitations under the License. -->
107107

108108

109109
<ItemGroup>
110-
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.1" />
110+
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.1" />
111111
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
112-
<PackageReference Include="System.Memory" Version="4.5.4" />
112+
<PackageReference Include="System.Memory" Version="4.5.5" />
113113
<PackageReference Include="System.Security.Principal.Windows" Version="5.0.0" />
114114
<PackageReference Include="Yubico.NativeShims" Version="1.*-*" />
115115
<ProjectReference Include="..\..\Yubico.DotNetPolyfills\src\Yubico.DotNetPolyfills.csproj" />

Yubico.Core/src/Yubico/Core/Devices/Hid/MacOSHidDevice.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public MacOSHidDevice(long entryId) :
5050
public static IEnumerable<HidDevice> GetList()
5151
{
5252
Logger log = Log.GetLogger();
53-
using IDisposable logScope = log.BeginScope("MacOSHidDevice.GetList()");
53+
using IDisposable? logScope = log.BeginScope("MacOSHidDevice.GetList()");
5454

5555
IntPtr manager = IntPtr.Zero;
5656
IntPtr deviceSet = IntPtr.Zero;

Yubico.Core/src/Yubico/Core/Devices/Hid/MacOSHidDeviceListener.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ private void StopListening()
6868
private void ListeningThread()
6969
{
7070
const int runLoopTimeout = 10; // 10 seconds is arbitrary, pulled from Apple sample code
71-
using IDisposable logScope = _log.BeginScope("MacOSHidDeviceListener.StartListening()");
71+
using IDisposable? logScope = _log.BeginScope("MacOSHidDeviceListener.StartListening()");
7272

7373
_log.LogInformation("HID listener thread started. ThreadID is {ThreadID}.", Environment.CurrentManagedThreadId);
7474

Yubico.Core/src/Yubico/Core/Devices/SmartCard/DesktopSmartCardConnection.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ private class TransactionScope : IDisposable
3333
{
3434
private readonly Logger _log = Log.GetLogger();
3535
private readonly DesktopSmartCardConnection _thisConnection;
36-
private readonly IDisposable _logScope;
36+
private readonly IDisposable? _logScope;
3737
private bool _disposedValue;
3838

3939
public TransactionScope(DesktopSmartCardConnection thisConnection)
@@ -58,7 +58,7 @@ protected virtual void Dispose(bool disposing)
5858

5959
if (disposing)
6060
{
61-
_logScope.Dispose();
61+
_logScope?.Dispose();
6262
}
6363
}
6464

Yubico.Core/src/Yubico/Core/Devices/SmartCard/DesktopSmartCardDevice.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ internal class DesktopSmartCardDevice : SmartCardDevice
3232
public static IReadOnlyList<ISmartCardDevice> GetList()
3333
{
3434
Logger log = Log.GetLogger();
35-
using IDisposable logScope = log.BeginScope("SmartCardDevice.GetList()");
35+
using IDisposable? logScope = log.BeginScope("SmartCardDevice.GetList()");
3636

3737
uint result = SCardEstablishContext(SCARD_SCOPE.USER, out SCardContext context);
3838
log.SCardApiCall(nameof(SCardEstablishContext), result);

Yubico.Core/src/Yubico/Core/Devices/SmartCard/SmartCardLoggerExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace Yubico.Core.Devices.SmartCard
88
{
99
internal static class SmartCardLoggerExtensions
1010
{
11-
public static IDisposable BeginTransactionScope(this Logger logger, IDisposable transactionScope) =>
11+
public static IDisposable? BeginTransactionScope(this Logger logger, IDisposable transactionScope) =>
1212
logger.BeginScope("Transaction[{TransactionID}]", transactionScope.GetHashCode());
1313

1414
public static void SCardApiCall(this Logger logger, string apiName, uint result)

Yubico.Core/src/Yubico/Core/Logging/Logger.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,6 @@ public void Log<TState>(
122122
/// <returns>
123123
/// A disposable object that ends the logical operation scope on dispose.
124124
/// </returns>
125-
public IDisposable BeginScope<TState>(TState state) => _logger.BeginScope(state);
125+
public IDisposable? BeginScope<TState>(TState state) where TState : notnull => _logger.BeginScope(state);
126126
}
127127
}

Yubico.Core/src/Yubico/Core/Logging/LoggerExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,7 @@ public static void SensitiveLog(this Logger logger, LogLevel logLevel, EventId e
934934
/// {
935935
/// }
936936
/// </example>
937-
public static IDisposable BeginScope(
937+
public static IDisposable? BeginScope(
938938
this Logger logger,
939939
string messageFormat,
940940
params object?[] args) =>

Yubico.Core/tests/Yubico.Core.UnitTests.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ limitations under the License. -->
4444
</PropertyGroup>
4545
<ItemGroup>
4646
<ProjectReference Include="..\src\Yubico.Core.csproj" />
47+
<PackageReference Include="coverlet.collector" Version="6.0.0" PrivateAssets="all" IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" />
48+
<PackageReference Include="xunit" Version="2.6.1" />
49+
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3" PrivateAssets="all" IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" />
50+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
51+
<PackageReference Include="Moq" Version="4.16.1" />
4752
</ItemGroup>
4853

4954
</Project>

Yubico.Core/tests/Yubico/Core/Devices/Hid/HidTranslatorTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public void GetChar_GivenHidCode_ReturnsCorrectChar(KeyboardLayout layout, (char
156156
}
157157
#endif
158158

159-
private static IEnumerable<object> GetTestData()
159+
public static IEnumerable<object[]> GetTestData()
160160
{
161161
// Originally, I hard-coded these, but I decided that it should do
162162
// this dynamically so that newly added keyboard layouts aren't left

0 commit comments

Comments
 (0)