more refactoring

This commit is contained in:
Tom Gardham-Pallister 2017-02-08 18:47:35 +00:00
parent 9d790a449b
commit f7fe7c0f49
11 changed files with 6 additions and 14 deletions

View File

@ -42,7 +42,7 @@ var nugetFeedStableSymbolsUploadUrl = "https://www.nuget.org/api/v2/package";
// internal build variables - don't change these. // internal build variables - don't change these.
var releaseTag = ""; var releaseTag = "";
var committedVersion = "0.0.0-dev"; string committedVersion = "0.0.0-dev";
var buildVersion = committedVersion; var buildVersion = committedVersion;
var target = Argument("target", "Default"); var target = Argument("target", "Default");

BIN
src/.DS_Store vendored Normal file

Binary file not shown.

BIN
src/Ocelot/.DS_Store vendored Normal file

Binary file not shown.

Binary file not shown.

View File

@ -12,7 +12,7 @@ namespace Ocelot.Authentication.Handler.Creator
/// </summary> /// </summary>
public class AuthenticationHandlerCreator : IAuthenticationHandlerCreator public class AuthenticationHandlerCreator : IAuthenticationHandlerCreator
{ {
public Response<RequestDelegate> CreateIdentityServerAuthenticationHandler(IApplicationBuilder app, AuthenticationOptions authOptions) public Response<RequestDelegate> Create(IApplicationBuilder app, AuthenticationOptions authOptions)
{ {
var builder = app.New(); var builder = app.New();

View File

@ -8,6 +8,6 @@ namespace Ocelot.Authentication.Handler.Creator
public interface IAuthenticationHandlerCreator public interface IAuthenticationHandlerCreator
{ {
Response<RequestDelegate> CreateIdentityServerAuthenticationHandler(IApplicationBuilder app, AuthenticationOptions authOptions); Response<RequestDelegate> Create(IApplicationBuilder app, AuthenticationOptions authOptions);
} }
} }

View File

@ -19,7 +19,7 @@ namespace Ocelot.Authentication.Handler.Factory
public Response<AuthenticationHandler> Get(IApplicationBuilder app, AuthenticationOptions authOptions) public Response<AuthenticationHandler> Get(IApplicationBuilder app, AuthenticationOptions authOptions)
{ {
var handler = _creator.CreateIdentityServerAuthenticationHandler(app, authOptions); var handler = _creator.Create(app, authOptions);
if (!handler.IsError) if (!handler.IsError)
{ {

View File

@ -1,5 +1,4 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Security.Claims; using System.Security.Claims;
using Ocelot.Errors; using Ocelot.Errors;
using Ocelot.Responses; using Ocelot.Responses;

View File

@ -55,10 +55,6 @@ namespace Ocelot.Configuration.Creator
return new OkResponse<IOcelotConfiguration>(config); return new OkResponse<IOcelotConfiguration>(config);
} }
/// <summary>
/// This method is meant to be tempoary to convert a config to an ocelot config...probably wont keep this but we will see
/// will need a refactor at some point as its crap
/// </summary>
private async Task<IOcelotConfiguration> SetUpConfiguration() private async Task<IOcelotConfiguration> SetUpConfiguration()
{ {
var response = _configurationValidator.IsValid(_options.Value); var response = _configurationValidator.IsValid(_options.Value);

View File

@ -66,7 +66,7 @@ namespace Ocelot.UnitTests.Authentication
private void GivenTheCreatorReturnsAnError() private void GivenTheCreatorReturnsAnError()
{ {
_creator _creator
.Setup(x => x.CreateIdentityServerAuthenticationHandler(It.IsAny<IApplicationBuilder>(), It.IsAny<AuthenticationOptions>())) .Setup(x => x.Create(It.IsAny<IApplicationBuilder>(), It.IsAny<AuthenticationOptions>()))
.Returns(new ErrorResponse<RequestDelegate>(new List<Error> .Returns(new ErrorResponse<RequestDelegate>(new List<Error>
{ {
new UnableToCreateAuthenticationHandlerError($"Unable to create authentication handler for xxx") new UnableToCreateAuthenticationHandlerError($"Unable to create authentication handler for xxx")
@ -76,7 +76,7 @@ namespace Ocelot.UnitTests.Authentication
private void GivenTheCreatorReturns() private void GivenTheCreatorReturns()
{ {
_creator _creator
.Setup(x => x.CreateIdentityServerAuthenticationHandler(It.IsAny<IApplicationBuilder>(), It.IsAny<AuthenticationOptions>())) .Setup(x => x.Create(It.IsAny<IApplicationBuilder>(), It.IsAny<AuthenticationOptions>()))
.Returns(new OkResponse<RequestDelegate>(x => Task.CompletedTask)); .Returns(new OkResponse<RequestDelegate>(x => Task.CompletedTask));
} }

View File

@ -1,7 +1,4 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.IO;
using System.Net.Http;
using Microsoft.AspNetCore.Http;
using Ocelot.Errors; using Ocelot.Errors;
using Ocelot.Middleware; using Ocelot.Middleware;
using Ocelot.Responder; using Ocelot.Responder;