Skip to content

Commit

Permalink
Fix failing build due to dependencies with severe vulnerabilities (#2824
Browse files Browse the repository at this point in the history
)
  • Loading branch information
gathogojr authored Nov 27, 2023
1 parent 287686c commit fd74a5c
Show file tree
Hide file tree
Showing 17 changed files with 36 additions and 34 deletions.
4 changes: 2 additions & 2 deletions pipelines/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ steps:
version: 3.x

- task: UseDotNet@2
displayName: Use .NET Core sdk 2.0.x
displayName: Use .NET Core sdk 2.1.x
inputs:
version: 2.0.x
version: 2.1.x

- task: UseDotNet@2
displayName: Use .NET Core sdk 5.x
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.9" />
<PackageReference Update="Microsoft.NETCore.App" Version="2.1.30" />
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.1.30" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ public async Task UnauthorizedResponseFromODataControllerIsSerializedAsODataErro
}
}

#if !NETCOREAPP2_0 && NETCORE
#if !NETCOREAPP2_1 && NETCORE
[Fact]
public async Task ConflictResponseFromODataControllerIsSerializedAsODataError()
{
Expand Down Expand Up @@ -930,7 +930,7 @@ public IActionResult Get()
{
return Unauthorized("Not authorized to access this resource.");
}
#if !NETCOREAPP2_0
#if !NETCOREAPP2_1
public IActionResult Patch([FromODataUri] int key, [FromBody] Customer customer)
{
return Conflict("Conflict during update.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@
using Microsoft.AspNet.OData.Test.Common;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc.Formatters;
using Microsoft.AspNetCore.Mvc.Infrastructure;

#if NETCOREAPP3_1
#else
using Microsoft.AspNetCore.Mvc.Internal;
using Microsoft.AspNetCore.Mvc.Internal;
#endif
using Microsoft.AspNetCore.Mvc.ModelBinding;
using Microsoft.AspNetCore.WebUtilities;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// </copyright>
//------------------------------------------------------------------------------

#if !NETCOREAPP2_0
#if !NETCOREAPP2_1
using System;
using Microsoft.AspNet.OData.Common;
using Microsoft.AspNet.OData.Extensions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// </copyright>
//------------------------------------------------------------------------------

#if !NETCOREAPP2_0
#if !NETCOREAPP2_1
using System;
using System.Collections.Generic;
using Microsoft.AspNetCore.Builder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Formatters;
#if NETCOREAPP2_0
#if NETCOREAPP2_1
using Microsoft.AspNetCore.Mvc.Internal;
#endif
using Microsoft.AspNetCore.Mvc.ModelBinding;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
using Microsoft.AspNetCore.Mvc.ModelBinding;
using System.Linq;
using System.Text;
#if NETCOREAPP2_0
#if NETCOREAPP2_1
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.OData;
Expand Down Expand Up @@ -87,7 +87,7 @@ public static void SetupActionSelector(System.Type controllerType,
as IReadOnlyList<ControllerActionDescriptor>;
actionDescriptors = actionDescriptors.Where(a => a.ActionName == actionName).ToList();
var serviceProvider = routeBuilder.ServiceProvider;
#if NETCOREAPP2_0
#if NETCOREAPP2_1
var actionsProvider = serviceProvider.GetRequiredService<IActionDescriptorCollectionProvider>();
var actionConstraintsProvider = serviceProvider.GetRequiredService<ActionConstraintCache>();
var loggerFactory = serviceProvider.GetRequiredService<ILoggerFactory>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
using Microsoft.AspNetCore.Mvc.Abstractions;
using Microsoft.AspNetCore.Mvc.ApplicationParts;
using Microsoft.AspNetCore.Mvc.Infrastructure;
#if NETCOREAPP2_0
#if NETCOREAPP2_1
using Microsoft.AspNetCore.Builder.Internal;
using Microsoft.AspNetCore.Mvc.Internal;
#endif
Expand Down Expand Up @@ -81,7 +81,7 @@ public static IRouteBuilder Create()
// Create a route build with a default path handler.
IRouteBuilder routeBuilder = new RouteBuilder(appBuilder);

#if NETCOREAPP2_0
#if NETCOREAPP2_1
routeBuilder.DefaultHandler = new MvcRouteHandler(
mockInvokerFactory.Object,
mockActionSelector.Object,
Expand Down Expand Up @@ -207,7 +207,7 @@ public static IRouteBuilder CreateWithDisabledCaseInsensitiveRequestPropertyBind
// Create a route build with a default path handler.
IRouteBuilder routeBuilder = new RouteBuilder(appBuilder);

#if NETCOREAPP2_0
#if NETCOREAPP2_1
routeBuilder.DefaultHandler = new MvcRouteHandler(
mockInvokerFactory.Object,
mockActionSelector.Object,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
#if !NETCOREAPP2_0
#if !NETCOREAPP2_1
using Microsoft.AspNetCore.Http.Features;
#endif
using Microsoft.AspNetCore.Mvc;
Expand Down Expand Up @@ -44,7 +44,7 @@ public static TestServer Create(Type[] controllers, Action<IRouteBuilder> config
IWebHostBuilder builder = WebHost.CreateDefaultBuilder();
builder.ConfigureServices(services =>
{
#if NETCOREAPP2_0
#if NETCOREAPP2_1
services.AddMvc();
#else
services.AddMvc(options => options.EnableEndpointRouting = false)
Expand All @@ -57,7 +57,7 @@ public static TestServer Create(Type[] controllers, Action<IRouteBuilder> config

builder.Configure(app =>
{
#if !NETCOREAPP2_0
#if !NETCOREAPP2_1
app.Use(next => context =>
{
var body = context.Features.Get<IHttpBodyControlFeature>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
#if NETCOREAPP2_0
#if NETCOREAPP2_1
using Microsoft.AspNetCore.Mvc.Internal;
using Microsoft.AspNetCore.Http.Internal;
#endif
Expand All @@ -28,7 +28,7 @@ public void GetEdmModel_WillNotFail_With_Parallel_Calls()
var services = new Mock<IServiceProvider>();
services.Setup(s => s.GetService(typeof(ApplicationPartManager))).Returns(new ApplicationPartManager());

#if NETCOREAPP2_0
#if NETCOREAPP2_1
var request = new DefaultHttpRequest(new DefaultHttpContext { RequestServices = services.Object });
#else
var request = new DefaultHttpContext { RequestServices = services.Object }.Request;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// </copyright>
//------------------------------------------------------------------------------

#if !NETCOREAPP2_0
#if !NETCOREAPP2_1
using System;
using Microsoft.AspNet.OData.Extensions;
using Microsoft.AspNet.OData.Test.Common;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// </copyright>
//------------------------------------------------------------------------------

#if !NETCOREAPP2_0
#if !NETCOREAPP2_1
using System;
using Microsoft.AspNet.OData.Extensions;
using Microsoft.AspNet.OData.Test.Common;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// </copyright>
//------------------------------------------------------------------------------

#if !NETCOREAPP2_0
#if !NETCOREAPP2_1
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// </copyright>
//------------------------------------------------------------------------------

#if !NETCOREAPP2_0
#if !NETCOREAPP2_1
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp2.0;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>netcoreapp2.1;netcoreapp3.1</TargetFrameworks>
</PropertyGroup>
<Import Project="..\..\..\tools\WebStack.settings.targets" />
<PropertyGroup>
Expand All @@ -25,14 +25,13 @@
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0' ">
<PackageReference Include="Microsoft.AspNetCore" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Routing" Version="2.0.1" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="2.0.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.1' ">
<PackageReference Update="Microsoft.NETCore.App" Version="2.1.30" />
<PackageReference Include="Microsoft.AspNetCore" Version="2.1.7" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.1.3" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.1.3" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="2.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Routing" Version="2.1.1" />
<PackageReference Include="Microsoft.OData.Core" Version="7.17.0" />
<PackageReference Include="Microsoft.OData.Edm" Version="7.17.0" />
<PackageReference Include="Microsoft.Spatial" Version="7.17.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public partial class PublicApiTest
{
private const string AssemblyName = "Microsoft.AspNetCore.OData.dll";
private const string OutputFileName = "Microsoft.AspNetCore.OData.PublicApi.out";
#if NETCOREAPP2_0
#if NETCOREAPP2_1
private const string BaseLineFileName = "Microsoft.AspNetCore.OData.PublicApi.bsl";
#else
private const string BaseLineFileName = "Microsoft.AspNetCore3x.OData.PublicApi.bsl";
Expand Down

0 comments on commit fd74a5c

Please sign in to comment.