mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-04-22 06:42:50 +08:00
Squash some warnings (#278)
* squash SA1649 warnings (file/type name mismatch) * squash SA1127 warnings (generic constraint on own line) * squash SA1507 warnings (multiple blank lines) * squash package analysis warnings re: summary text It's not actually possible to provide a summary right now as per https://github.com/NuGet/Home/issues/4587 * squash missing castle.core reference warning * squash obsolete method warnings re: AddOcelotBaseUrl
This commit is contained in:
parent
f7c23d3384
commit
c1b315173f
@ -3,6 +3,7 @@
|
|||||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||||
<RuntimeFrameworkVersion>2.0.0</RuntimeFrameworkVersion>
|
<RuntimeFrameworkVersion>2.0.0</RuntimeFrameworkVersion>
|
||||||
<NETStandardImplicitPackageVersion>2.0.0</NETStandardImplicitPackageVersion>
|
<NETStandardImplicitPackageVersion>2.0.0</NETStandardImplicitPackageVersion>
|
||||||
|
<NoPackageAnalysis>true</NoPackageAnalysis>
|
||||||
<Description>This project is aimed at people using .NET running a micro services / service orientated architecture that need a unified point of entry into their system. In particular I want easy integration with IdentityServer reference and bearer tokens. We have been unable to find this in my current workplace without having to write our own Javascript middlewares to handle the IdentityServer reference tokens. We would rather use the IdentityServer code that already exists to do this. Ocelot is a bunch of middlewares in a specific order. Ocelot manipulates the HttpRequest object into a state specified by its configuration until it reaches a request builder middleware where it creates a HttpRequestMessage object which is used to make a request to a downstream service. The middleware that makes the request is the last thing in the Ocelot pipeline. It does not call the next middleware. The response from the downstream service is stored in a per request scoped repository and retrived as the requests goes back up the Ocelot pipeline. There is a piece of middleware that maps the HttpResponseMessage onto the HttpResponse object and that is returned to the client. That is basically it with a bunch of other features.</Description>
|
<Description>This project is aimed at people using .NET running a micro services / service orientated architecture that need a unified point of entry into their system. In particular I want easy integration with IdentityServer reference and bearer tokens. We have been unable to find this in my current workplace without having to write our own Javascript middlewares to handle the IdentityServer reference tokens. We would rather use the IdentityServer code that already exists to do this. Ocelot is a bunch of middlewares in a specific order. Ocelot manipulates the HttpRequest object into a state specified by its configuration until it reaches a request builder middleware where it creates a HttpRequestMessage object which is used to make a request to a downstream service. The middleware that makes the request is the last thing in the Ocelot pipeline. It does not call the next middleware. The response from the downstream service is stored in a per request scoped repository and retrived as the requests goes back up the Ocelot pipeline. There is a piece of middleware that maps the HttpResponseMessage onto the HttpResponse object and that is returned to the client. That is basically it with a bunch of other features.</Description>
|
||||||
<AssemblyTitle>Ocelot</AssemblyTitle>
|
<AssemblyTitle>Ocelot</AssemblyTitle>
|
||||||
<VersionPrefix>0.0.0-dev</VersionPrefix>
|
<VersionPrefix>0.0.0-dev</VersionPrefix>
|
||||||
|
@ -75,7 +75,8 @@ namespace Ocelot.Requester
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ReRouteDelegatingHandler<T> where T : DelegatingHandler
|
public class ReRouteDelegatingHandler<T>
|
||||||
|
where T : DelegatingHandler
|
||||||
{
|
{
|
||||||
public T DelegatingHandler { get; private set; }
|
public T DelegatingHandler { get; private set; }
|
||||||
}
|
}
|
||||||
|
@ -50,9 +50,4 @@
|
|||||||
<PackageReference Include="xunit" Version="2.3.1" />
|
<PackageReference Include="xunit" Version="2.3.1" />
|
||||||
<PackageReference Include="Butterfly.Client.AspNetCore" Version="0.0.8" />
|
<PackageReference Include="Butterfly.Client.AspNetCore" Version="0.0.8" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="Castle.Core">
|
|
||||||
<HintPath>..\..\..\..\Users\TGP\.nuget\packages\castle.core\4.2.1\lib\netstandard1.3\Castle.Core.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -342,7 +342,9 @@ namespace Ocelot.IntegrationTests
|
|||||||
.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true);
|
.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true);
|
||||||
config.AddJsonFile("configuration.json");
|
config.AddJsonFile("configuration.json");
|
||||||
config.AddJsonFile("peers.json", optional: true, reloadOnChange: true);
|
config.AddJsonFile("peers.json", optional: true, reloadOnChange: true);
|
||||||
|
#pragma warning disable CS0618
|
||||||
config.AddOcelotBaseUrl(url);
|
config.AddOcelotBaseUrl(url);
|
||||||
|
#pragma warning restore CS0618
|
||||||
config.AddEnvironmentVariables();
|
config.AddEnvironmentVariables();
|
||||||
})
|
})
|
||||||
.ConfigureServices(x =>
|
.ConfigureServices(x =>
|
||||||
|
@ -22,9 +22,10 @@ namespace Ocelot.UnitTests.DependencyInjection
|
|||||||
|
|
||||||
private void GivenTheBaseUrl(string baseUrl)
|
private void GivenTheBaseUrl(string baseUrl)
|
||||||
{
|
{
|
||||||
|
#pragma warning disable CS0618
|
||||||
var builder = new ConfigurationBuilder()
|
var builder = new ConfigurationBuilder()
|
||||||
.AddOcelotBaseUrl(baseUrl);
|
.AddOcelotBaseUrl(baseUrl);
|
||||||
|
#pragma warning restore CS0618
|
||||||
_configuration = builder.Build();
|
_configuration = builder.Build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -223,12 +223,14 @@ namespace Ocelot.UnitTests.DependencyInjection
|
|||||||
_ocelotBuilder.AddAdministration("/administration", options);
|
_ocelotBuilder.AddAdministration("/administration", options);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AddTransientGlobalDelegatingHandler<T>() where T : DelegatingHandler
|
private void AddTransientGlobalDelegatingHandler<T>()
|
||||||
|
where T : DelegatingHandler
|
||||||
{
|
{
|
||||||
_ocelotBuilder.AddTransientDelegatingHandler<T>(true);
|
_ocelotBuilder.AddTransientDelegatingHandler<T>(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AddSpecificTransientDelegatingHandler<T>() where T : DelegatingHandler
|
private void AddSpecificTransientDelegatingHandler<T>()
|
||||||
|
where T : DelegatingHandler
|
||||||
{
|
{
|
||||||
_ocelotBuilder.AddTransientDelegatingHandler<T>();
|
_ocelotBuilder.AddTransientDelegatingHandler<T>();
|
||||||
}
|
}
|
||||||
@ -298,12 +300,14 @@ namespace Ocelot.UnitTests.DependencyInjection
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AddGlobalDelegatingHandler<T>() where T : DelegatingHandler
|
private void AddGlobalDelegatingHandler<T>()
|
||||||
|
where T : DelegatingHandler
|
||||||
{
|
{
|
||||||
_ocelotBuilder.AddSingletonDelegatingHandler<T>(true);
|
_ocelotBuilder.AddSingletonDelegatingHandler<T>(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AddSpecificDelegatingHandler<T>() where T : DelegatingHandler
|
private void AddSpecificDelegatingHandler<T>()
|
||||||
|
where T : DelegatingHandler
|
||||||
{
|
{
|
||||||
_ocelotBuilder.AddSingletonDelegatingHandler<T>();
|
_ocelotBuilder.AddSingletonDelegatingHandler<T>();
|
||||||
}
|
}
|
||||||
|
@ -163,7 +163,6 @@
|
|||||||
.BDDfy();
|
.BDDfy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void should_not_add_content_headers()
|
public void should_not_add_content_headers()
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user