Skip to content

Commit

Permalink
Review Dependabot alerts for net6.0 and net7.0 target frameworks …
Browse files Browse the repository at this point in the history
…and bump all packages (#2220)

* Fix CS1574 warning

* IDE0060: Remove unused parameter 'queryString' if it is not part of a shipped public API

* Warning NETSDK1138: The target framework 'net7.0' is out of support and will not receive security updates in the future. Please refer to https://aka.ms/dotnet-core-support for more information about the support policy.
Remove target framework 'net7.0' from testing projects.

* IDE0079: Remove unnecessary suppression SA1649

* Bump all packages

* Fix issues of code review by @ggnaegi
  • Loading branch information
raman-m authored Nov 26, 2024
1 parent a79ae8a commit e8c0b13
Show file tree
Hide file tree
Showing 19 changed files with 151 additions and 224 deletions.
8 changes: 4 additions & 4 deletions src/Ocelot.Administration/Ocelot.Administration.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
</ItemGroup>
<!-- Conditionally obtain references for the net 6.0 target -->
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.35" />
<PackageReference Include="System.Text.Encodings.Web" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.36" />
<PackageReference Include="System.Text.Encodings.Web" Version="6.0.1" />
</ItemGroup>
<!-- Conditionally obtain references for the net 7.0 target -->
<ItemGroup Condition=" '$(TargetFramework)' == 'net7.0' ">
Expand All @@ -52,7 +52,7 @@
</ItemGroup>
<!-- Conditionally obtain references for the net 8.0 target -->
<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.10" />
<PackageReference Include="System.Text.Encodings.Web" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.11" />
<PackageReference Include="System.Text.Encodings.Web" Version="9.0.0" />
</ItemGroup>
</Project>
24 changes: 12 additions & 12 deletions src/Ocelot.Cache.CacheManager/Ocelot.Cache.CacheManager.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,26 +43,26 @@
</ItemGroup>
<!-- Conditionally obtain references for the net 6.0 target -->
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.2" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.2" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.1" />
<PackageReference Include="Microsoft.NETCore.Platforms" Version="6.0.13" />
</ItemGroup>
<!-- Conditionally obtain references for the net 7.0 target -->
<ItemGroup Condition=" '$(TargetFramework)' == 'net7.0' ">
<PackageReference Include="Microsoft.Extensions.Configuration" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="7.0.4" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
<PackageReference Include="Microsoft.NETCore.Platforms" Version="7.0.4" />
</ItemGroup>
<!-- Conditionally obtain references for the net 8.0 target -->
<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.2" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.1" />
<PackageReference Include="Microsoft.NETCore.Platforms" Version="7.0.4" />
</ItemGroup>
<!-- Conditionally obtain references for the net 8.0 target -->
<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
<PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.0" />
<PackageReference Include="Microsoft.NETCore.Platforms" Version="8.0.0-preview.7.23375.6" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion src/Ocelot.Provider.Consul/Ocelot.Provider.Consul.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<ProjectReference Include="..\Ocelot\Ocelot.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Consul" Version="1.7.14.4" />
<PackageReference Include="Consul" Version="1.7.14.5" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.556">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion src/Ocelot.Provider.Polly/Ocelot.Provider.Polly.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.556">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Polly" Version="8.4.2" />
<PackageReference Include="Polly" Version="8.5.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="8.0.0" />
Expand Down
6 changes: 5 additions & 1 deletion src/Ocelot/Infrastructure/RegexGlobal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ static RegexGlobal()
/// <value>An <see cref="int"/> value.</value>
public static int RegexCacheSize { get; set; }

/// <summary>Default value for the <see cref="GeneratedRegexAttribute"/> attribute and the <see cref="Regex"/> constructors.</summary>
#pragma warning disable IDE0079 // Remove unnecessary suppression
#pragma warning disable CS1574 // File name must match first type name
/// <summary>Default value for the <see cref="GeneratedRegexAttribute"/> and the <see cref="Regex"/> constructors.</summary>
#pragma warning restore CS1574 // File name must match first type name
#pragma warning restore IDE0079 // Remove unnecessary suppression
public const int DefaultMatchTimeoutMilliseconds = 100;

/// <summary>Default match timeout for the <see cref="Regex"/> constructors.</summary>
Expand Down
12 changes: 6 additions & 6 deletions src/Ocelot/Ocelot.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
</PropertyGroup>
<!-- Project dependencies -->
<ItemGroup>
<PackageReference Include="FluentValidation" Version="11.10.0" />
<PackageReference Include="IPAddressRange" Version="6.0.0" />
<PackageReference Include="FluentValidation" Version="11.11.0" />
<PackageReference Include="IPAddressRange" Version="6.1.0" />
<PackageReference Include="Microsoft.Extensions.DiagnosticAdapter" Version="3.1.32">
<NoWarn>NU1701</NoWarn>
</PackageReference>
Expand All @@ -43,8 +43,8 @@
</ItemGroup>
<!-- Conditionally obtain references for the net 6.0 target -->
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
<PackageReference Include="Microsoft.AspNetCore.MiddlewareAnalysis" Version="6.0.35" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.35" />
<PackageReference Include="Microsoft.AspNetCore.MiddlewareAnalysis" Version="6.0.36" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.36" />
</ItemGroup>
<!-- Conditionally obtain references for the net 7.0 target -->
<ItemGroup Condition=" '$(TargetFramework)' == 'net7.0' ">
Expand All @@ -53,8 +53,8 @@
</ItemGroup>
<!-- Conditionally obtain references for the net 8.0 target -->
<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
<PackageReference Include="Microsoft.AspNetCore.MiddlewareAnalysis" Version="8.0.10" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.10" />
<PackageReference Include="Microsoft.AspNetCore.MiddlewareAnalysis" Version="8.0.11" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.11" />
</ItemGroup>
<ItemGroup>
<None Include="..\..\README.md" Pack="true" PackagePath="\" />
Expand Down
17 changes: 13 additions & 4 deletions src/Ocelot/Responses/ErrorResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,23 @@
namespace Ocelot.Responses;

public class ErrorResponse : Response
{
public ErrorResponse(Error error)
: base(new() { error })
{ }

public ErrorResponse(List<Error> errors)
: base(errors)
{ }
}

public class ErrorResponse<T> : Response<T>
{
public ErrorResponse(Error error)
: base(new List<Error> { error })
{
}
{ }

public ErrorResponse(List<Error> errors)
: base(errors)
{
}
{ }
}
19 changes: 0 additions & 19 deletions src/Ocelot/Responses/ErrorResponseGeneric.cs

This file was deleted.

9 changes: 6 additions & 3 deletions src/Ocelot/Responses/OkResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ namespace Ocelot.Responses;

public class OkResponse : Response
{
public OkResponse()
{
}
public OkResponse() { }
}

public class OkResponse<T> : Response<T>
{
public OkResponse(T data) : base(data) { }
}
11 changes: 0 additions & 11 deletions src/Ocelot/Responses/OkResponseGeneric.cs

This file was deleted.

13 changes: 13 additions & 0 deletions src/Ocelot/Responses/Response.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,16 @@ protected Response(List<Error> errors)

public bool IsError => Errors.Count > 0;
}

public abstract class Response<T> : Response
{
protected Response(T data)
{
Data = data;
}

protected Response(List<Error> errors) : base(errors)
{ }

public T Data { get; }
}
20 changes: 0 additions & 20 deletions src/Ocelot/Responses/ResponseGeneric.cs

This file was deleted.

55 changes: 21 additions & 34 deletions test/Ocelot.AcceptanceTests/Ocelot.AcceptanceTests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<VersionPrefix>0.0.0-dev</VersionPrefix>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>disable</Nullable>
<IsPackable>false</IsPackable>
Expand Down Expand Up @@ -63,7 +63,7 @@
<PackageReference Include="OpenTracing" Version="0.12.1" />
<PackageReference Include="IdentityServer4" Version="4.1.2" />
<PackageReference Include="IdentityServer4.AccessTokenValidation" Version="3.0.1" />
<PackageReference Include="Consul" Version="1.7.14.4" />
<PackageReference Include="Consul" Version="1.7.14.5" />
<PackageReference Include="CacheManager.Microsoft.Extensions.Logging" Version="2.0.0-beta-1629" />
<PackageReference Include="CacheManager.Serialization.Json" Version="2.0.0-beta-1629" />
<PackageReference Include="Steeltoe.Discovery.ClientCore" Version="3.2.8" />
Expand All @@ -74,42 +74,29 @@
</ItemGroup>
<!-- Conditionally obtain references for the net 6.0 target -->
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="6.0.35" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="6.0.2" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="6.0.36" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="6.0.3" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="6.0.2" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="6.0.1" />
<PackageReference Include="Serilog.AspNetCore" Version="6.1.0" />
</ItemGroup>
<!-- Conditionally obtain references for the net 7.0 target -->
<ItemGroup Condition=" '$(TargetFramework)' == 'net7.0' ">
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="7.0.20" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="7.0.0" />
<PackageReference Include="Serilog.AspNetCore" Version="7.0.0" />
</ItemGroup>
<!-- Conditionally obtain references for the net 8.0 target -->
<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="8.0.10" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" />
<PackageReference Include="Serilog.AspNetCore" Version="8.0.2" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="8.0.11" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="9.0.0" />
<PackageReference Include="Serilog.AspNetCore" Version="8.0.3" />
</ItemGroup>
<ItemGroup>
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="8.0.0" />
Expand Down
14 changes: 7 additions & 7 deletions test/Ocelot.AcceptanceTests/Routing/RoutingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -476,18 +476,18 @@ public void ShouldMatchComplexQueriesCaseInsensitive(string downstream, string u
[Theory]
[Trait("Bug", "2209")]
[InlineData("/api/invoices/{url0}-{url1}-{url2}", "/api/invoices_{url0}/{url1}-{url2}_abcd/{url3}?urlId={url4}",
"/api/InvoIces_abc/def-ghi_abcd/xyz?urlId=bla", "/api/invoices/abc-def-ghi", "?urlId=bla")]
"/api/InvoIces_abc/def-ghi_abcd/xyz?urlId=bla", "/api/invoices/abc-def-ghi")]
[InlineData("/api/products/{category}-{subcategory}/{filter}", "/api/products_{category}/{subcategory}_details/{itemId}?filter={filter}",
"/API/PRODUCTS_electronics/computers_details/123?filter=active", "/api/products/electronics-computers/active", "")]
"/API/PRODUCTS_electronics/computers_details/123?filter=active", "/api/products/electronics-computers/active")]
[InlineData("/api/users/{userId}/posts/{postId}/{lang}", "/api/users/{userId}/{postId}_content/{timestamp}?lang={lang}",
"/api/UsErS/101/2022_content/2024?lang=en", "/api/users/101/posts/2022/en", "")]
"/api/UsErS/101/2022_content/2024?lang=en", "/api/users/101/posts/2022/en")]
[InlineData("/api/categories/{cat}-{subcat}?sort={sort}", "/api/categories_{cat}/{subcat}_items/{itemId}?sort={sort}",
"/api/CATEGORIES_home/furniture_items/789?sort=asc", "/api/categories/home-furniture", "?sort=asc")]
"/api/CATEGORIES_home/furniture_items/789?sort=asc", "/api/categories/home-furniture")]
[InlineData("/api/orders/{order}-{detail}?status={status}", "/api/orders_{order}/{detail}_invoice/{ref}?status={status}",
"/API/ORDERS_987/abc_invOiCE/123?status=shipped", "/api/orders/987-abc", "?status=shipped")]
"/API/ORDERS_987/abc_invOiCE/123?status=shipped", "/api/orders/987-abc")]
[InlineData("/api/transactions/{type}-{region}", "/api/transactions_{type}/{region}_summary/{year}?q={query}",
"/api/TRanSacTIONS_sales/NA_summary/2024?q=forecast", "/api/transactions/sales-NA", "?q=forecast")]
public void ShouldNotMatchComplexQueriesCaseSensitive(string downstream, string upstream, string requestUrl, string downstreamPath, string queryString)
"/api/TRanSacTIONS_sales/NA_summary/2024?q=forecast", "/api/transactions/sales-NA")]
public void ShouldNotMatchComplexQueriesCaseSensitive(string downstream, string upstream, string requestUrl, string downstreamPath)
{
var port = PortFinder.GetRandomPort();
var route = GivenRoute(port, upstream, downstream);
Expand Down
8 changes: 2 additions & 6 deletions test/Ocelot.Benchmarks/Ocelot.Benchmarks.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<VersionPrefix>0.0.0-dev</VersionPrefix>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>disable</Nullable>
<IsPackable>false</IsPackable>
Expand Down Expand Up @@ -31,13 +31,9 @@
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
<PackageReference Include="Serilog.AspNetCore" Version="6.1.0" />
</ItemGroup>
<!-- Conditionally obtain references for the net 7.0 target -->
<ItemGroup Condition=" '$(TargetFramework)' == 'net7.0' ">
<PackageReference Include="Serilog.AspNetCore" Version="7.0.0" />
</ItemGroup>
<!-- Conditionally obtain references for the net 8.0 target -->
<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
<PackageReference Include="Serilog.AspNetCore" Version="8.0.2" />
<PackageReference Include="Serilog.AspNetCore" Version="8.0.3" />
</ItemGroup>
<ItemGroup>
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="8.0.0" />
Expand Down
Loading

0 comments on commit e8c0b13

Please sign in to comment.