Skip to content

Commit

Permalink
Fixed Merge Conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Thiago Loureiro committed Jun 1, 2019
2 parents 57580af + b707cd6 commit 60655c4
Show file tree
Hide file tree
Showing 545 changed files with 3,478 additions and 3,386 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ os:

# Ubuntu 14.04
sudo: required
dist: trusty
dist: bionic

# OS X 10.12
osx_image: xcode9.2

mono:
- 5.10.0

dotnet: 2.1.500
dotnet: 2.2.105

before_install:
- git fetch --unshallow # Travis always does a shallow clone, but GitVersion needs the full history including branches and tags
Expand Down
16 changes: 16 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<Project>
<PropertyGroup>
<LangVersion>latest</LangVersion>

<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/ThreeMammals/Ocelot</RepositoryUrl>
<!-- Optional: Publish the repository URL in the built .nupkg (in the NuSpec <Repository> element) -->
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<!-- Optional: Build symbol package (.snupkg) to distribute the PDB containing Source Link -->
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta2-18618-05" PrivateAssets="All"/>
</ItemGroup>
</Project>
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
[<img src="http://threemammals.com/images/ocelot_logo.png">](http://threemammals.com/ocelot)

[![Build status](https://ci.appveyor.com/api/projects/status/r6sv51qx36sis1je?branch=develop&svg=true)](https://ci.appveyor.com/project/TomPallister/ocelot-fcfpb) Windows (AppVeyor)

[![Build Status](https://travis-ci.org/ThreeMammals/Ocelot.svg?branch=develop)](https://travis-ci.org/ThreeMammals/Ocelot) Linux & OSX (Travis)

[![Build Status](https://dev.azure.com/ThreeMammals/Ocelot/_apis/build/status/Ocelot%20-%20Windows?branchName=develop)](https://dev.azure.com/ThreeMammals/Ocelot/_build/latest?definitionId=4&branchName=develop) Windows

[![Build Status](https://dev.azure.com/ThreeMammals/Ocelot/_apis/build/status/Ocelot%20-%20MacOS?branchName=develop)](https://dev.azure.com/ThreeMammals/Ocelot/_build/latest?definitionId=3&branchName=develop) MacOS

[![Build Status](https://dev.azure.com/ThreeMammals/Ocelot/_apis/build/status/Ocelot%20-%20Linux?branchName=develop)](https://dev.azure.com/ThreeMammals/Ocelot/_build/latest?definitionId=2&branchName=develop) Linux

[![Windows Build history](https://buildstats.info/appveyor/chart/TomPallister/ocelot-fcfpb?branch=develop&includeBuildsFromPullRequest=false)](https://ci.appveyor.com/project/TomPallister/ocelot-fcfpb/history?branch=develop)

[![Coverage Status](https://coveralls.io/repos/github/ThreeMammals/Ocelot/badge.svg?branch=develop)](https://coveralls.io/github/ThreeMammals/Ocelot?branch=develop)



# Ocelot

Ocelot is a .NET API Gateway. This project is aimed at people using .NET running
Expand Down
2 changes: 1 addition & 1 deletion docs/features/authentication.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Then map the authentication provider key to a ReRoute in your configuration e.g.
Identity Server Bearer Tokens
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

In order to use IdentityServer bearer tokens register your IdentityServer services as usual in ConfigureServices with a scheme (key). If you don't understand how to do this please consult the IdentityServer documentation.
In order to use IdentityServer bearer tokens, register your IdentityServer services as usual in ConfigureServices with a scheme (key). If you don't understand how to do this please consult the IdentityServer documentation.

.. code-block:: csharp
Expand Down
6 changes: 3 additions & 3 deletions docs/features/qualityofservice.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ Then add the following section to a ReRoute configuration.
"QoSOptions": {
"ExceptionsAllowedBeforeBreaking":3,
"DurationOfBreak":5,
"DurationOfBreak":1000,
"TimeoutValue":5000
}
You must set a number greater than 0 against ExceptionsAllowedBeforeBreaking for this rule to be
implemented. Duration of break is how long the circuit breaker will stay open for after it is tripped.
implemented. Duration of break means the circuit breaker will stay open for 1 second after it is tripped.
TimeoutValue means if a request takes more than 5 seconds it will automatically be timed out.

You can set the TimeoutValue in isoldation of the ExceptionsAllowedBeforeBreaking and DurationOfBreak options.
You can set the TimeoutValue in isolation of the ExceptionsAllowedBeforeBreaking and DurationOfBreak options.

.. code-block:: json
Expand Down
9 changes: 8 additions & 1 deletion docs/features/ratelimiting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,13 @@ OK so to get rate limiting working for a ReRoute you need to add the following j
}
ClientWhitelist - This is an array that contains the whitelist of the client. It means that the client in this array will not be affected by the rate limiting.

EnableRateLimiting - This value specifies enable endpoint rate limiting.

Period - This value specifies the period that the limit applies to, such as 1s, 5m, 1h,1d and so on. If you make more requests in the period than the limit allows then you need to wait for PeriodTimespan to elapse before you make another request.

PeriodTimespan - This value specifies that we can retry after a certain number of seconds.

Limit - This value specifies the maximum number of requests that a client can make in a defined period.

You can also set the following in the GlobalConfiguration part of ocelot.json
Expand All @@ -34,7 +38,10 @@ You can also set the following in the GlobalConfiguration part of ocelot.json
"ClientIdHeader" : "Test"
}
DisableRateLimitHeaders - This value specifies whether X-Rate-Limit and Rety-After headers are disabled.
DisableRateLimitHeaders - This value specifies whether X-Rate-Limit and Retry-After headers are disabled.

QuotaExceededMessage - This value specifies the exceeded message.

HttpStatusCode - This value specifies the returned HTTP Status code when rate limiting occurs.

ClientIdHeader - Allows you to specifiy the header that should be used to identify clients. By default it is "ClientId"
2 changes: 1 addition & 1 deletion docs/features/routing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ The DownstreamPathTemplate, DownstreamScheme and DownstreamHostAndPorts define t
DownstreamHostAndPorts is a collection that defines the host and port of any downstream services that you wish to forward requests to.
Usually this will just contain a single entry but sometimes you might want to load balance requests to your downstream services and Ocelot allows you add more than one entry and then select a load balancer.

The UpstreamPathTemplate is the URL that Ocelot will use to identity which DownstreamPathTemplate to use for a given request.
The UpstreamPathTemplate is the URL that Ocelot will use to identify which DownstreamPathTemplate to use for a given request.
The UpstreamHttpMethod is used so Ocelot can distinguish between requests with different HTTP verbs to the same URL. You can set a specific list of HTTP Methods or set an empty list to allow any of them.

In Ocelot you can add placeholders for variables to your Templates in the form of {something}.
Expand Down
6 changes: 0 additions & 6 deletions global.json

This file was deleted.

8 changes: 5 additions & 3 deletions samples/OcelotEureka/ApiGateway/ApiGateway.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

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

<ItemGroup>
Expand All @@ -15,8 +15,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.9" />
<PackageReference Include="Ocelot" Version="5.5.7" />
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.2.5" />
<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" />
</ItemGroup>

</Project>
9 changes: 7 additions & 2 deletions samples/OcelotEureka/ApiGateway/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
namespace ApiGateway
using Ocelot.Provider.Eureka;
using Ocelot.Provider.Polly;

namespace ApiGateway
{
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
Expand Down Expand Up @@ -27,7 +30,9 @@ public static IWebHost BuildWebHost(string[] args) =>
})
.ConfigureServices(s =>
{
s.AddOcelot();
s.AddOcelot()
.AddEureka()
.AddPolly();
})
.Configure(a =>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

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

<ItemGroup>
<Folder Include="wwwroot\" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.9" />
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.2.5" />
<PackageReference Include="Steeltoe.Discovery.Client" Version="1.1.0" />
</ItemGroup>

Expand Down
25 changes: 25 additions & 0 deletions samples/OcelotGraphQL/OcelotGraphQL.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.28803.452
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OcelotGraphQL", "OcelotGraphQL.csproj", "{5A3220BF-FE0B-4B26-8B2F-37DB7292EEA9}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{5A3220BF-FE0B-4B26-8B2F-37DB7292EEA9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5A3220BF-FE0B-4B26-8B2F-37DB7292EEA9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5A3220BF-FE0B-4B26-8B2F-37DB7292EEA9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5A3220BF-FE0B-4B26-8B2F-37DB7292EEA9}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {5762C36C-EA4B-44D9-9DAA-2F7C3FC98692}
EndGlobalSection
EndGlobal
27 changes: 27 additions & 0 deletions samples/OcelotGraphQL/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:53639/",
"sslPort": 0
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"OcelotGraphQL": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "http://localhost:53640/"
}
}
}
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp2.2</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.1.1" PrivateAssets="All" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.1.1" />
<PackageReference Include="Ocelot" Version="13.6.0-alpha0010"/>
<PackageReference Include="Ocelot.Provider.Kubernetes" Version="13.6.0-alpha0010"/>
<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" />
</ItemGroup>

</Project>
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using Ocelot.DependencyInjection;
using Ocelot.Middleware;
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp2.2</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
</PropertyGroup>

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

</Project>
File renamed without changes.
8 changes: 4 additions & 4 deletions src/Ocelot.Administration/IIdentityServerConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ namespace Ocelot.Administration

public interface IIdentityServerConfiguration
{
string ApiName { get; }
string ApiSecret { get; }
bool RequireHttps { get; }
List<string> AllowedScopes { get; }
string ApiName { get; }
string ApiSecret { get; }
bool RequireHttps { get; }
List<string> AllowedScopes { get; }
string CredentialsSigningCertificateLocation { get; }
string CredentialsSigningCertificatePassword { get; }
}
Expand Down
6 changes: 3 additions & 3 deletions src/Ocelot.Administration/IdentityServerConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ namespace Ocelot.Administration
public class IdentityServerConfiguration : IIdentityServerConfiguration
{
public IdentityServerConfiguration(
string apiName,
bool requireHttps,
string apiName,
bool requireHttps,
string apiSecret,
List<string> allowedScopes,
string credentialsSigningCertificateLocation,
string credentialsSigningCertificateLocation,
string credentialsSigningCertificatePassword)
{
ApiName = apiName;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
namespace Ocelot.Administration
{
using System.Threading.Tasks;
using Configuration;
using Configuration.Repository;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using Ocelot.Middleware;
using System.Threading.Tasks;

public static class IdentityServerMiddlewareConfigurationProvider
{
Expand Down
6 changes: 3 additions & 3 deletions src/Ocelot.Administration/Ocelot.Administration.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
<ProjectReference Include="..\Ocelot\Ocelot.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="StyleCop.Analyzers" Version="1.0.2">
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="IdentityServer4.AccessTokenValidation" Version="2.6.0" />
<PackageReference Include="IdentityServer4" Version="2.2.0" />
<PackageReference Include="IdentityServer4.AccessTokenValidation" Version="2.7.0" />
<PackageReference Include="IdentityServer4" Version="2.4.0" />
</ItemGroup>
</Project>
15 changes: 6 additions & 9 deletions src/Ocelot.Administration/OcelotBuilderExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
namespace Ocelot.Administration
{
using System;
using System.Collections.Generic;
using System.IdentityModel.Tokens.Jwt;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using Configuration;
using Configuration.Creator;
using DependencyInjection;
using IdentityModel;
using IdentityServer4.AccessTokenValidation;
using IdentityServer4.Models;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Ocelot.Middleware;
using System;
using System.Collections.Generic;
using System.IdentityModel.Tokens.Jwt;
using System.Security.Cryptography.X509Certificates;

public static class OcelotBuilderExtensions
{
Expand Down Expand Up @@ -61,7 +57,8 @@ private static void AddIdentityServer(IIdentityServerConfiguration identityServe
{
builder.Services.TryAddSingleton<IIdentityServerConfiguration>(identityServerConfiguration);
var identityServerBuilder = builder.Services
.AddIdentityServer(o => {
.AddIdentityServer(o =>
{
o.IssuerUri = "Ocelot";
})
.AddInMemoryApiResources(Resources(identityServerConfiguration))
Expand Down
Loading

0 comments on commit 60655c4

Please sign in to comment.