Skip to content

Commit aa577bf

Browse files
Update Dependencies and Suppress NU1603 (#1970)
## Why make this change? - Updates dependencies `SqlClient` and `Microsoft.AspNetCore.Authentication.JwtBearer` - Explicitly set version of and include transitive dependencies: `System.IdentityModel.Tokens.Jwt` and `Microsoft.IdentityModel.JsonWebTokens` - Suppress NU1603 when resolving dependencies from NuGet feed to prevent pipeline failures. - Allows pipeline to pull compatible dependency version from private feed even when dependency is not the exact lower bounded version. DAB project treats warnings as errors and in this case, NU1603 is emitted and should be ignored. - Background on issue: NuGet/Home#5764 Even though our feed may have version `6.10.1` of the relevant package which meets the expectations of `>=6.10.0`, NuGet is expects and considers the "ideal" match to be `6.10.0` because that is what the package was built and tested against. Newer versions may or may not work and allows build systems to be consistent (per linked NuGet issue thread). > ##[error]Core.csproj(0,0): Error NU1603: Microsoft.IdentityModel.Protocols 6.10.0 depends on Microsoft.IdentityModel.Tokens (>= 6.10.0) > but Microsoft.IdentityModel.Tokens 6.10.0 was not found. > An approximate best match of Microsoft.IdentityModel.Tokens 6.10.1 was resolved. ## What is this change? - Suppress `NU1603` warning in all csproj files. - Updates SqlClient dependency to version `5.1.4`. - Updates Microsoft.AspNetCore.Authentication.JwtBearer to version `6.0.26` - Updates System.IdentityModel.Tokens.Jwt and Microsoft.IdentityModel.JsonWebTokens to `6.35.0` explicitly even though transitive dependencies because latest SqlClient 5.1.4 references vulnerable 6.24.0 versions. Known issue in sqlclient dotnet/SqlClient#2294 and workaround is to explicitly define the dependencies/needed version. ## How was this tested? - [x] integration test: privately running the pipeline resolves expected dependencies without error. --------- Co-authored-by: neeraj-sharma2592 <[email protected]>
1 parent dacf3bc commit aa577bf

11 files changed

+18
-5
lines changed

src/Auth/Azure.DataApiBuilder.Auth.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<Nullable>enable</Nullable>
77
<OutputPath>$(BaseOutputPath)\engine</OutputPath>
88
<EmbedUntrackedSources>true</EmbedUntrackedSources>
9+
<NoWarn>NU1603</NoWarn>
910
</PropertyGroup>
1011

1112
<PropertyGroup Condition="'$(TF_BUILD)' == 'true'">

src/Cli.Tests/Cli.Tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<Nullable>enable</Nullable>
77
<IsPackable>false</IsPackable>
88
<OutputPath>$(BaseOutputPath)\tests</OutputPath>
9+
<NoWarn>NU1603</NoWarn>
910
</PropertyGroup>
1011

1112
<ItemGroup>

src/Cli/Cli.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
</Dependencies>
2929
<EmbedUntrackedSources>true</EmbedUntrackedSources>
3030
<PublishRepositoryUrl>true</PublishRepositoryUrl>
31+
<NoWarn>NU1603</NoWarn>
3132
</PropertyGroup>
3233

3334
<PropertyGroup Condition="'$(TF_BUILD)' == 'true'">

src/Config/Azure.DataApiBuilder.Config.csproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<TargetFramework>net6.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77
<OutputPath>$(BaseOutputPath)\engine</OutputPath>
88
<EmbedUntrackedSources>true</EmbedUntrackedSources>
9+
<NoWarn>NU1603</NoWarn>
910
</PropertyGroup>
1011

1112
<PropertyGroup Condition="'$(TF_BUILD)' == 'true'">
@@ -18,6 +19,8 @@
1819
<PackageReference Include="System.IO.Abstractions" />
1920
<PackageReference Include="System.Drawing.Common" />
2021
<PackageReference Include="Microsoft.Data.SqlClient" />
22+
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" />
23+
<PackageReference Include="System.IdentityModel.Tokens.Jwt" />
2124
<PackageReference Include="StyleCop.Analyzers">
2225
<PrivateAssets>all</PrivateAssets>
2326
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

src/Core/Azure.DataApiBuilder.Core.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77
<EmbedUntrackedSources>true</EmbedUntrackedSources>
8+
<NoWarn>NU1603</NoWarn>
89
</PropertyGroup>
910

1011
<ItemGroup>

src/Directory.Packages.props

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,18 @@
1717
<PackageVersion Include="Microsoft.ApplicationInsights" Version="2.21.0" />
1818
<PackageVersion Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.21.0" />
1919
<PackageVersion Include="Microsoft.AspNetCore.Authorization" Version="6.0.14" />
20-
<PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.14" />
20+
<PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.26" />
2121
<PackageVersion Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
2222
<PackageVersion Include="Microsoft.AspNetCore.Http" Version="2.2.0" />
2323
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="6.0.14" />
2424
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="6.0.14" />
2525
<PackageVersion Include="Microsoft.Azure.Cosmos" Version="3.20.0" />
2626
<!--When updating Microsoft.Data.SqlClient, update license URL in scripts/notice-generation.ps1-->
27-
<PackageVersion Include="Microsoft.Data.SqlClient" Version="5.1.1" />
27+
<PackageVersion Include="Microsoft.Data.SqlClient" Version="5.1.4" />
2828
<PackageVersion Include="Microsoft.Extensions.Configuration.Binder" Version="6.0.0" />
2929
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
3030
<PackageVersion Include="Microsoft.Extensions.Logging.ApplicationInsights" Version="2.21.0" />
31+
<PackageVersion Include="Microsoft.IdentityModel.JsonWebTokens" Version="6.35.0" />
3132
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
3233
<PackageVersion Include="Microsoft.OData.Edm" Version="7.12.5" />
3334
<PackageVersion Include="Microsoft.OData.Core" Version="7.12.5" />
@@ -45,6 +46,7 @@
4546
<PackageVersion Include="Swashbuckle.AspNetCore.SwaggerUI" Version="6.5.0" />
4647
<PackageVersion Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
4748
<PackageVersion Include="System.Drawing.Common" Version="6.0.0" />
49+
<PackageVersion Include="System.IdentityModel.Tokens.Jwt" Version="6.35.0" />
4850
<PackageVersion Include="System.IO.Abstractions" Version="19.2.29" />
4951
<PackageVersion Include="System.IO.Abstractions.TestingHelpers" Version="19.2.29" />
5052
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.1.1" />

src/Product/Azure.DataApiBuilder.Product.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<Nullable>enable</Nullable>
77
<OutputPath>$(BaseOutputPath)\engine</OutputPath>
88
<EmbedUntrackedSources>true</EmbedUntrackedSources>
9+
<NoWarn>NU1603</NoWarn>
910
</PropertyGroup>
1011

1112
<PropertyGroup Condition="'$(TF_BUILD)' == 'true'">

src/Service.GraphQLBuilder/Azure.DataApiBuilder.Service.GraphQLBuilder.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<Nullable>enable</Nullable>
77
<OutputPath>$(BaseOutputPath)\engine</OutputPath>
88
<EmbedUntrackedSources>true</EmbedUntrackedSources>
9+
<NoWarn>NU1603</NoWarn>
910
</PropertyGroup>
1011

1112
<PropertyGroup Condition="'$(TF_BUILD)' == 'true'">

src/Service.Tests/Azure.DataApiBuilder.Service.Tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<IsPackable>false</IsPackable>
66
<Nullable>disable</Nullable>
77
<OutputPath>$(BaseOutputPath)\tests</OutputPath>
8+
<NoWarn>NU1603</NoWarn>
89
</PropertyGroup>
910

1011
<ItemGroup>

src/Service.Tests/Configuration/ConfigurationTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2862,7 +2862,7 @@ private static JsonContent GetJsonContentForCosmosConfigRequest(string endpoint,
28622862

28632863
private static string GenerateMockJwtToken()
28642864
{
2865-
string mySecret = "PlaceholderPlaceholder";
2865+
string mySecret = "PlaceholderPlaceholderPlaceholder";
28662866
SymmetricSecurityKey mySecurityKey = new(Encoding.ASCII.GetBytes(mySecret));
28672867

28682868
JwtSecurityTokenHandler tokenHandler = new();

0 commit comments

Comments
 (0)