mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-06-17 18:03:22 +08:00
more refactoring
This commit is contained in:
parent
9d790a449b
commit
f7fe7c0f49
@ -42,7 +42,7 @@ var nugetFeedStableSymbolsUploadUrl = "https://www.nuget.org/api/v2/package";
|
||||
|
||||
// internal build variables - don't change these.
|
||||
var releaseTag = "";
|
||||
var committedVersion = "0.0.0-dev";
|
||||
string committedVersion = "0.0.0-dev";
|
||||
var buildVersion = committedVersion;
|
||||
|
||||
var target = Argument("target", "Default");
|
||||
|
BIN
src/.DS_Store
vendored
Normal file
BIN
src/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
src/Ocelot/.DS_Store
vendored
Normal file
BIN
src/Ocelot/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
src/Ocelot/Authentication/Handler/.DS_Store
vendored
Normal file
BIN
src/Ocelot/Authentication/Handler/.DS_Store
vendored
Normal file
Binary file not shown.
@ -12,7 +12,7 @@ namespace Ocelot.Authentication.Handler.Creator
|
||||
/// </summary>
|
||||
public class AuthenticationHandlerCreator : IAuthenticationHandlerCreator
|
||||
{
|
||||
public Response<RequestDelegate> CreateIdentityServerAuthenticationHandler(IApplicationBuilder app, AuthenticationOptions authOptions)
|
||||
public Response<RequestDelegate> Create(IApplicationBuilder app, AuthenticationOptions authOptions)
|
||||
{
|
||||
var builder = app.New();
|
||||
|
||||
|
@ -8,6 +8,6 @@ namespace Ocelot.Authentication.Handler.Creator
|
||||
|
||||
public interface IAuthenticationHandlerCreator
|
||||
{
|
||||
Response<RequestDelegate> CreateIdentityServerAuthenticationHandler(IApplicationBuilder app, AuthenticationOptions authOptions);
|
||||
Response<RequestDelegate> Create(IApplicationBuilder app, AuthenticationOptions authOptions);
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ namespace Ocelot.Authentication.Handler.Factory
|
||||
|
||||
public Response<AuthenticationHandler> Get(IApplicationBuilder app, AuthenticationOptions authOptions)
|
||||
{
|
||||
var handler = _creator.CreateIdentityServerAuthenticationHandler(app, authOptions);
|
||||
var handler = _creator.Create(app, authOptions);
|
||||
|
||||
if (!handler.IsError)
|
||||
{
|
||||
|
@ -1,5 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Security.Claims;
|
||||
using Ocelot.Errors;
|
||||
using Ocelot.Responses;
|
||||
|
@ -55,10 +55,6 @@ namespace Ocelot.Configuration.Creator
|
||||
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()
|
||||
{
|
||||
var response = _configurationValidator.IsValid(_options.Value);
|
||||
|
@ -66,7 +66,7 @@ namespace Ocelot.UnitTests.Authentication
|
||||
private void GivenTheCreatorReturnsAnError()
|
||||
{
|
||||
_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>
|
||||
{
|
||||
new UnableToCreateAuthenticationHandlerError($"Unable to create authentication handler for xxx")
|
||||
@ -76,7 +76,7 @@ namespace Ocelot.UnitTests.Authentication
|
||||
private void GivenTheCreatorReturns()
|
||||
{
|
||||
_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));
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Net.Http;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Ocelot.Errors;
|
||||
using Ocelot.Middleware;
|
||||
using Ocelot.Responder;
|
||||
|
Loading…
x
Reference in New Issue
Block a user