Skip to content

Commit

Permalink
Updated packages (#1133)
Browse files Browse the repository at this point in the history
* Upgrading nugets

* doc changes

* more changes to remove warnings

* one more fix

* one more fix

* forcing the build
  • Loading branch information
Pedram Rezaei committed Apr 11, 2020
1 parent 4110837 commit 84821c6
Show file tree
Hide file tree
Showing 32 changed files with 125 additions and 132 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ A quick list of Ocelot's capabilities for more information see the [documentatio

## How to install

Ocelot is designed to work with ASP.NET Core only and it targets `netstandard2.0`. This means it can be used anywhere `.NET Standard 2.0` is supported, including `.NET Core 3.1` and `.NET Framework 4.8` and up. [This](https://docs.microsoft.com/en-us/dotnet/standard/net-standard) documentation may prove helpful when working out if Ocelot would be suitable for you.
Ocelot is designed to work with ASP.NET Core only and it targets `netcoreapp3.1`.

Install Ocelot and it's dependencies using NuGet.
Install Ocelot and it's dependencies using NuGet.

`Install-Package Ocelot`

Expand Down
5 changes: 2 additions & 3 deletions docs/introduction/gettingstarted.rst
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
Getting Started
===============

Ocelot is designed to work with .NET Core only and is currently
built to netstandard2.0. `This <https://docs.microsoft.com/en-us/dotnet/articles/standard/library>`_ documentation may prove helpful when working out if Ocelot would be suitable for you.
Ocelot is designed to work with .NET Core only and is currently on netcoreapp3.1.

.NET Core 3.1
^^^^^^^^^^^^^

**Install NuGet package**

Install Ocelot and it's dependencies using nuget. You will need to create a netstandard2.0 project and bring the package into it. Then follow the Startup below and :doc:`../features/configuration` sections
Install Ocelot and it's dependencies using nuget. You will need to create a netcoreapp3.1 project and bring the package into it. Then follow the Startup below and :doc:`../features/configuration` sections
to get up and running.

``Install-Package Ocelot``
Expand Down
4 changes: 2 additions & 2 deletions samples/AdministrationApi/AdministrationApi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<Folder Include="wwwroot\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Ocelot" Version="14.0.3" />
<PackageReference Include="Ocelot.Administration" Version="14.0.3" />
<PackageReference Include="Ocelot" Version="14.0.9" />
<PackageReference Include="Ocelot.Administration" Version="14.0.9" />

</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion samples/OcelotBasic/OcelotBasic.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ocelot" Version="13.8.4" />
<PackageReference Include="ocelot" Version="14.0.9" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions samples/OcelotEureka/ApiGateway/ApiGateway.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Ocelot" Version="13.5.1" />
<PackageReference Include="Ocelot.Provider.Eureka" Version="13.5.1" />
<PackageReference Include="Ocelot.Provider.Polly" Version="13.5.1" />
<PackageReference Include="Ocelot" Version="14.0.9" />
<PackageReference Include="Ocelot.Provider.Eureka" Version="14.0.9" />
<PackageReference Include="Ocelot.Provider.Polly" Version="14.0.9" />
</ItemGroup>

</Project>
3 changes: 2 additions & 1 deletion samples/OcelotEureka/DownstreamService/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace DownstreamService
{
using Microsoft.Extensions.Hosting;
using Steeltoe.Discovery.Client;

public class Startup
Expand All @@ -30,7 +31,7 @@ public void ConfigureServices(IServiceCollection services)
}

// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
Expand Down
4 changes: 2 additions & 2 deletions samples/OcelotGraphQL/OcelotGraphQL.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<Folder Include="wwwroot\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Ocelot" Version="5.5.1" />
<PackageReference Include="GraphQL" Version="2.0.0-alpha-870" />
<PackageReference Include="Ocelot" Version="14.0.9" />
<PackageReference Include="GraphQL" Version="2.4.0" />
</ItemGroup>
</Project>
22 changes: 12 additions & 10 deletions samples/OcelotGraphQL/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class Hero

public class Query
{
private List<Hero> _heroes = new List<Hero>
private readonly List<Hero> _heroes = new List<Hero>
{
new Hero { Id = 1, Name = "R2-D2" },
new Hero { Id = 2, Name = "Batman" },
Expand Down Expand Up @@ -58,7 +58,7 @@ protected async override Task<HttpResponseMessage> SendAsync(HttpRequestMessage
var query = await request.Content.ReadAsStringAsync();

//if not body try query string, dont hack like this in real world..
if(query.Length == 0)
if (query.Length == 0)
{
var decoded = WebUtility.UrlDecode(request.RequestUri.Query);
query = decoded.Replace("?query=", "");
Expand All @@ -82,7 +82,7 @@ protected async override Task<HttpResponseMessage> SendAsync(HttpRequestMessage

public class Program
{
public static void Main(string[] args)
public static void Main()
{
var schema = Schema.For(@"
type Hero {
Expand All @@ -93,7 +93,8 @@ public static void Main(string[] args)
type Query {
hero(id: Int): Hero
}
", _ => {
", _ =>
{
_.Types.Include<Query>();
});

Expand All @@ -109,10 +110,11 @@ public static void Main(string[] args)
.AddJsonFile("ocelot.json", false, false)
.AddEnvironmentVariables();
})
.ConfigureServices(s => {
s.AddSingleton<ISchema>(schema);
s.AddOcelot()
.AddSingletonDelegatingHandler<GraphQlDelegatingHandler>();
.ConfigureServices(s =>
{
s.AddSingleton<ISchema>(schema);
s.AddOcelot()
.AddDelegatingHandler<GraphQlDelegatingHandler>();
})
.ConfigureLogging((hostingContext, logging) =>
{
Expand All @@ -125,7 +127,7 @@ public static void Main(string[] args)
app.UseOcelot().Wait();
})
.Build()
.Run();
}
.Run();
}
}
}
8 changes: 3 additions & 5 deletions samples/OcelotKube/ApiGateway/ApiGateway.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.7.9" />
<PackageReference Include="Ocelot" Version="13.5.1" />
<PackageReference Include="Ocelot.Provider.Kubernetes" Version="13.5.1" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.9.10" />
<PackageReference Include="Ocelot" Version="14.0.9" />
<PackageReference Include="Ocelot.Provider.Kubernetes" Version="14.0.9" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.7.9" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.9.10" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Description>Stateless Service Application</Description>
<Authors> </Authors>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<AssemblyName>OcelotApplicationService</AssemblyName>
<PackageId>OcelotApplicationService</PackageId>
<PackageTargetFallback>$(PackageTargetFallback)</PackageTargetFallback>
</PropertyGroup>
<ItemGroup>&#xD;
&#xD;
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.ServiceFabric" Version="6.1.456"/>
<PackageReference Include="Microsoft.ServiceFabric.Services" Version="3.0.456"/>
<PackageReference Include="Microsoft.AspNetCore" Version="2.0.1"/>
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.0.2"/>
<PackageReference Include="Microsoft.ServiceFabric.AspNetCore.Kestrel" Version="3.0.456"/>
</ItemGroup>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Description>Stateless Service Application</Description>
<Authors> </Authors>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<AssemblyName>OcelotApplicationService</AssemblyName>
<PackageId>OcelotApplicationService</PackageId>
<PackageTargetFallback>$(PackageTargetFallback)</PackageTargetFallback>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.ServiceFabric" Version="6.1.456" />
<PackageReference Include="Microsoft.ServiceFabric.Services" Version="3.0.456" />
<PackageReference Include="Microsoft.AspNetCore" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
<PackageReference Include="Microsoft.ServiceFabric.AspNetCore.Kestrel" Version="3.0.456" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions src/Ocelot.Administration/Ocelot.Administration.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
<ProjectReference Include="..\Ocelot\Ocelot.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.66">
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.164">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="IdentityServer4.AccessTokenValidation" Version="3.0.1" />
<PackageReference Include="IdentityServer4" Version="3.0.1" />
<PackageReference Include="IdentityServer4" Version="3.1.1" />
</ItemGroup>
<ItemGroup>
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.0.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<ProjectReference Include="..\Ocelot\Ocelot.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.66">
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.164">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="CacheManager.Core" Version="2.0.0-beta-1629" />
Expand Down
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 @@ -28,7 +28,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Consul" Version="0.7.2.6" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.66">
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.164">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/Ocelot.Provider.Eureka/Ocelot.Provider.Eureka.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
<ProjectReference Include="..\Ocelot\Ocelot.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Steeltoe.Discovery.ClientCore" Version="2.3.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.66">
<PackageReference Include="Steeltoe.Discovery.ClientCore" Version="2.4.2" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.164">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="KubeClient" Version="2.3.4" />
<PackageReference Include="KubeClient.Extensions.DependencyInjection" Version="2.3.4" />
<PackageReference Include="KubeClient" Version="2.3.11" />
<PackageReference Include="KubeClient.Extensions.DependencyInjection" Version="2.3.11" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/Ocelot.Provider.Polly/Ocelot.Provider.Polly.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
<ProjectReference Include="..\Ocelot\Ocelot.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.66">
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.164">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Polly" Version="7.1.1" />
<PackageReference Include="Polly" Version="7.2.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.0.0" />
Expand Down
4 changes: 2 additions & 2 deletions src/Ocelot.Provider.Rafty/Ocelot.Provider.Rafty.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
<ProjectReference Include="..\Ocelot.Administration\Ocelot.Administration.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Data.SQLite" Version="3.0.0" />
<PackageReference Include="Microsoft.Data.SQLite" Version="3.1.1" />
<PackageReference Include="Rafty" Version="0.4.4" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.66">
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.164">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ public class RateLimitOptionsBuilder
{
private bool _enableRateLimiting;
private string _clientIdHeader;
private List<string> _clientWhitelist;
private Func<List<string>> _getClientWhitelist;
private bool _disableRateLimitHeaders;
private string _quotaExceededMessage;
Expand Down
2 changes: 1 addition & 1 deletion src/Ocelot/Errors/Middleware/ExceptionHandlerMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public async Task Invoke(DownstreamContext context)

await _next.Invoke(context);
}
catch (OperationCanceledException e) when (context.HttpContext.RequestAborted.IsCancellationRequested)
catch (OperationCanceledException) when (context.HttpContext.RequestAborted.IsCancellationRequested)
{
Logger.LogDebug("operation canceled");
if (!context.HttpContext.Response.HasStarted)
Expand Down
11 changes: 5 additions & 6 deletions src/Ocelot/Ocelot.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
<PackageId>Ocelot</PackageId>
<PackageTags>API Gateway;.NET core</PackageTags>
<PackageProjectUrl>https://github.com/ThreeMammals/Ocelot</PackageProjectUrl>
<PackageProjectUrl>https://github.com/ThreeMammals/Ocelot</PackageProjectUrl>
<PackageIconUrl>http://threemammals.com/images/ocelot_logo.png</PackageIconUrl>
<RuntimeIdentifiers>win10-x64;osx.10.11-x64;osx.10.12-x64;win7-x64</RuntimeIdentifiers>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
Expand All @@ -25,13 +24,13 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentValidation" Version="8.5.0" />
<PackageReference Include="Microsoft.AspNetCore.MiddlewareAnalysis" Version="3.0.0" />
<PackageReference Include="Microsoft.Extensions.DiagnosticAdapter" Version="3.0.0">
<PackageReference Include="FluentValidation" Version="8.6.1" />
<PackageReference Include="Microsoft.AspNetCore.MiddlewareAnalysis" Version="3.1.1" />
<PackageReference Include="Microsoft.Extensions.DiagnosticAdapter" Version="3.1.1">
<NoWarn>NU1701</NoWarn>
</PackageReference>
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.0.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.66">
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.1" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.164">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
Expand Down
5 changes: 3 additions & 2 deletions test/Ocelot.AcceptanceTests/ConfigurationInConsulTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ namespace Ocelot.AcceptanceTests
{
using Configuration.File;
using Consul;
using IdentityServer4.Extensions;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
Expand Down Expand Up @@ -169,9 +170,9 @@ private void GivenThereIsAServiceRunningOn(string url, string basePath, int stat
{
context.Response.StatusCode = statusCode;
await context.Response.WriteAsync(responseBody);
});
});
})
});
})
.Build();

_builder.Start();
Expand Down

0 comments on commit 84821c6

Please sign in to comment.