From c70c13138acfd9493846b6b8d339f8809a61d51e Mon Sep 17 00:00:00 2001 From: Victor Chang Date: Wed, 11 Jan 2023 19:18:33 +0000 Subject: [PATCH] Update dependency decisions & fix warnings Signed-off-by: Victor Chang --- doc/dependency_decisions.yml | 12 ++--- .../Configurations/AuthenticationOptions.cs | 4 +- .../BasicAuthorizationMiddleware.cs | 6 +-- third-party-licenses.md | 53 ++++++++++++------- 4 files changed, 46 insertions(+), 29 deletions(-) diff --git a/doc/dependency_decisions.yml b/doc/dependency_decisions.yml index d333432..1c67dfc 100644 --- a/doc/dependency_decisions.yml +++ b/doc/dependency_decisions.yml @@ -18,14 +18,14 @@ - :who: mocsharp :why: MIT (https://github.com/dotnet/aspnetcore/raw/main/LICENSE.txt) :versions: - - 6.0.11 + - 6.0.12 :when: 2022-10-14 23:36:49.751931025 Z - - :approve - Microsoft.AspNetCore.TestHost - :who: mocsharp :why: MIT (https://github.com/dotnet/aspnetcore/raw/main/LICENSE.txt) :versions: - - 6.0.11 + - 6.0.12 :when: 2022-10-14 23:36:49.751931025 Z - - :approve - Microsoft.CSharp @@ -39,7 +39,7 @@ - :who: mocsharp :why: MIT (https://github.com/microsoft/vstest/raw/main/LICENSE) :versions: - - 17.4.0 + - 17.4.1 :when: 2022-08-16 23:05:48.342748414 Z - - :approve - Microsoft.Extensions.Configuration @@ -256,7 +256,7 @@ - :who: mocsharp :why: MIT (https://raw.githubusercontent.com/microsoft/vstest/main/LICENSE) :versions: - - 17.4.0 + - 17.4.1 :when: 2022-09-01 23:06:13.008314524 Z - - :approve - Microsoft.NETCore.Platforms @@ -277,14 +277,14 @@ - :who: mocsharp :why: MIT (https://github.com/microsoft/vstest/raw/v17.4.0/LICENSE) :versions: - - 17.4.0 + - 17.4.1 :when: 2022-08-16 23:06:16.175705981 Z - - :approve - Microsoft.TestPlatform.TestHost - :who: mocsharp :why: MIT (https://github.com/microsoft/vstest/raw/v17.4.0/LICENSE) :versions: - - 17.4.0 + - 17.4.1 :when: 2022-08-16 23:06:17.671459450 Z - - :approve - Microsoft.Win32.Primitives diff --git a/src/Authentication/Configurations/AuthenticationOptions.cs b/src/Authentication/Configurations/AuthenticationOptions.cs index c34df0e..dabd181 100755 --- a/src/Authentication/Configurations/AuthenticationOptions.cs +++ b/src/Authentication/Configurations/AuthenticationOptions.cs @@ -1,5 +1,5 @@ /* - * Copyright 2022 MONAI Consortium + * Copyright 2023 MONAI Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -106,7 +106,7 @@ private void ValidateClaims(List claims, bool validateEndpoints) } } - if (validateEndpoints && claim.Endpoints.IsNullOrEmpty()) + if (validateEndpoints && claim.Endpoints!.IsNullOrEmpty()) { throw new InvalidOperationException("Value for claimType is invalid."); } diff --git a/src/Authentication/Middleware/BasicAuthorizationMiddleware.cs b/src/Authentication/Middleware/BasicAuthorizationMiddleware.cs index cc5433d..4da69cf 100755 --- a/src/Authentication/Middleware/BasicAuthorizationMiddleware.cs +++ b/src/Authentication/Middleware/BasicAuthorizationMiddleware.cs @@ -1,5 +1,5 @@ /* - * Copyright 2022 MONAI Consortium + * Copyright 2023 MONAI Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -59,11 +59,11 @@ public async Task InvokeAsync(HttpContext httpContext) var authHeader = AuthenticationHeaderValue.Parse(httpContext.Request.Headers["Authorization"]); if (authHeader.Scheme == "Basic") { - var credentialBytes = Convert.FromBase64String(authHeader.Parameter); + var credentialBytes = Convert.FromBase64String(authHeader.Parameter ?? ""); var credentials = Encoding.UTF8.GetString(credentialBytes).Split(':', 2); var username = credentials[0]; var password = credentials[1]; - if (string.Compare(username, _options.Value.BasicAuth.Id, false) is 0 && + if (string.Compare(username, _options.Value.BasicAuth!.Id, false) is 0 && string.Compare(password, _options.Value.BasicAuth.Password, false) is 0) { var claims = new[] { new Claim("name", credentials[0]) }; diff --git a/third-party-licenses.md b/third-party-licenses.md index 4f36513..0d3e9ba 100644 --- a/third-party-licenses.md +++ b/third-party-licenses.md @@ -1,3 +1,20 @@ + + + # Third-Party Licenses @@ -123,14 +140,14 @@ SOFTWARE.
-Microsoft.AspNetCore.Authentication.JwtBearer 6.0.11 +Microsoft.AspNetCore.Authentication.JwtBearer 6.0.12 ## Microsoft.AspNetCore.Authentication.JwtBearer -- Version: 6.0.11 +- Version: 6.0.12 - Authors: Microsoft - Project URL: https://asp.net/ -- Source: [NuGet](https://www.nuget.org/packages/Microsoft.AspNetCore.Authentication.JwtBearer/6.0.11) +- Source: [NuGet](https://www.nuget.org/packages/Microsoft.AspNetCore.Authentication.JwtBearer/6.0.12) - License: [MIT](https://github.com/dotnet/aspnetcore/raw/main/LICENSE.txt) @@ -164,14 +181,14 @@ SOFTWARE.
-Microsoft.AspNetCore.TestHost 6.0.11 +Microsoft.AspNetCore.TestHost 6.0.12 ## Microsoft.AspNetCore.TestHost -- Version: 6.0.11 +- Version: 6.0.12 - Authors: Microsoft - Project URL: https://asp.net/ -- Source: [NuGet](https://www.nuget.org/packages/Microsoft.AspNetCore.TestHost/6.0.11) +- Source: [NuGet](https://www.nuget.org/packages/Microsoft.AspNetCore.TestHost/6.0.12) - License: [MIT](https://github.com/dotnet/aspnetcore/raw/main/LICENSE.txt) @@ -247,15 +264,15 @@ SOFTWARE.
-Microsoft.CodeCoverage 17.4.0 +Microsoft.CodeCoverage 17.4.1 ## Microsoft.CodeCoverage -- Version: 17.4.0 +- Version: 17.4.1 - Authors: Microsoft - Owners: Microsoft - Project URL: https://github.com/microsoft/vstest/ -- Source: [NuGet](https://www.nuget.org/packages/Microsoft.CodeCoverage/17.4.0) +- Source: [NuGet](https://www.nuget.org/packages/Microsoft.CodeCoverage/17.4.1) - License: [MIT](https://github.com/microsoft/vstest/raw/main/LICENSE) @@ -1505,15 +1522,15 @@ SOFTWARE.
-Microsoft.NET.Test.Sdk 17.4.0 +Microsoft.NET.Test.Sdk 17.4.1 ## Microsoft.NET.Test.Sdk -- Version: 17.4.0 +- Version: 17.4.1 - Authors: Microsoft - Owners: Microsoft - Project URL: https://github.com/microsoft/vstest/ -- Source: [NuGet](https://www.nuget.org/packages/Microsoft.NET.Test.Sdk/17.4.0) +- Source: [NuGet](https://www.nuget.org/packages/Microsoft.NET.Test.Sdk/17.4.1) - License: [MIT](https://raw.githubusercontent.com/microsoft/vstest/main/LICENSE) @@ -1943,15 +1960,15 @@ consequential or other damages.
-Microsoft.TestPlatform.ObjectModel 17.4.0 +Microsoft.TestPlatform.ObjectModel 17.4.1 ## Microsoft.TestPlatform.ObjectModel -- Version: 17.4.0 +- Version: 17.4.1 - Authors: Microsoft - Owners: Microsoft - Project URL: https://github.com/microsoft/vstest/ -- Source: [NuGet](https://www.nuget.org/packages/Microsoft.TestPlatform.ObjectModel/17.4.0) +- Source: [NuGet](https://www.nuget.org/packages/Microsoft.TestPlatform.ObjectModel/17.4.1) - License: [MIT](https://github.com/microsoft/vstest/raw/v17.4.0/LICENSE) @@ -1981,15 +1998,15 @@ SOFTWARE.
-Microsoft.TestPlatform.TestHost 17.4.0 +Microsoft.TestPlatform.TestHost 17.4.1 ## Microsoft.TestPlatform.TestHost -- Version: 17.4.0 +- Version: 17.4.1 - Authors: Microsoft - Owners: Microsoft - Project URL: https://github.com/microsoft/vstest/ -- Source: [NuGet](https://www.nuget.org/packages/Microsoft.TestPlatform.TestHost/17.4.0) +- Source: [NuGet](https://www.nuget.org/packages/Microsoft.TestPlatform.TestHost/17.4.1) - License: [MIT](https://github.com/microsoft/vstest/raw/v17.4.0/LICENSE)