From f79b76b414cfe1c5658b970e51739e423e592235 Mon Sep 17 00:00:00 2001 From: TomPallister Date: Tue, 18 Oct 2016 18:52:43 +0100 Subject: [PATCH] reorganised project so its a bit more vertical for features --- .../{ => Handler}/AuthenticationHandler.cs | 6 +-- .../Creator}/AuthenticationHandlerCreator.cs | 11 +++--- .../Creator}/IAuthenticationHandlerCreator.cs | 9 +++-- .../Factory}/AuthenticationHandlerFactory.cs | 12 +++--- .../Factory}/IAuthenticationHandlerFactory.cs | 7 ++-- ...nableToCreateAuthenticationHandlerError.cs | 6 +-- .../SupportedAuthenticationProviders.cs | 7 ++++ .../Middleware/AuthenticationMiddleware.cs | 23 ++++++------ ...nticationMiddlewareMiddlewareExtensions.cs | 6 +-- .../SupportAuthenticationProviders.cs | 7 ---- .../YamlOcelotConfigurationCreator.cs | 7 ++-- .../Parser}/InstructionNotForClaimsError.cs | 2 +- .../Parser}/NoInstructionsError.cs | 2 +- .../ParsingConfigurationHeaderError.cs | 2 +- .../YamlOcelotConfigurationProvider.cs | 3 +- .../ConfigurationValidationResult.cs | 8 ++-- .../ConfigurationValidator.cs | 20 +++++----- .../DownstreamTemplateAlreadyUsedError.cs | 6 +-- .../IConfigurationValidator.cs | 7 ++-- .../UnsupportedAuthenticationProviderError.cs | 6 +-- .../ServiceCollectionExtensions.cs | 17 ++++++--- .../DownstreamRouteFinder/DownstreamRoute.cs | 5 ++- .../{ => Finder}/DownstreamRouteFinder.cs | 4 +- .../{ => Finder}/IDownstreamRouteFinder.cs | 6 +-- .../UnableToFindDownstreamRouteError.cs | 6 +-- .../DownstreamRouteFinderMiddleware.cs | 13 ++++--- ...wnstreamRouteFinderMiddlewareExtensions.cs | 6 +-- .../ITemplateVariableNameAndValueFinder.cs | 8 ++-- .../IUrlPathToUrlTemplateMatcher.cs | 6 +-- .../UrlMatcher/RegExUrlMatcher.cs | 8 ++-- .../TemplateVariableNameAndValue.cs | 2 +- .../TemplateVariableNameAndValueFinder.cs | 8 ++-- .../UrlMatcher/UrlMatch.cs | 2 +- .../DownstreamUrlCreatorMiddleware.cs | 15 ++++---- ...ownstreamUrlCreatorMiddlewareExtensions.cs | 6 +-- .../DownstreamUrlTemplateVariableReplacer.cs | 10 ++--- ...wnstreamUrlPathTemplateVariableReplacer.cs | 8 ++-- .../AddHeadersToRequest.cs | 3 +- .../IAddHeadersToRequest.cs | 2 +- .../HttpRequestHeadersBuilderMiddleware.cs | 15 +++----- ...questHeadersBuilderMiddlewareExtensions.cs | 6 +-- .../Parser}/CannotFindClaimError.cs | 2 +- .../Parser}/ClaimsParser.cs | 2 +- .../Parser}/IClaimsParser.cs | 2 +- .../Middleware/OcelotMiddleware.cs | 5 ++- .../Middleware/OcelotMiddlewareExtensions.cs | 10 ++++- .../{ => Builder}/HttpRequestBuilder.cs | 20 +++++----- .../{ => Builder}/IRequestBuilder.cs | 12 +++--- .../HttpRequestBuilderMiddleware.cs | 13 ++++--- .../HttpRequestBuilderMiddlewareExtensions.cs | 6 +-- .../Middleware/HttpRequesterMiddleware.cs | 14 +++---- .../HttpRequesterMiddlewareExtensions.cs | 6 +-- .../Middleware/HttpResponderMiddleware.cs | 14 +++---- .../HttpResponderMiddlewareExtensions.cs | 6 +-- .../CannotAddDataError.cs | 6 +-- .../CannotFindDataError.cs | 6 +-- .../IScopedRequestDataRepository.cs | 6 +-- .../ScopedRequestDataRepository.cs | 14 +++---- .../AuthenticationHandlerFactoryTests.cs | 3 ++ .../AuthenticationMiddlewareTests.cs | 15 ++++---- .../ConfigurationHeadersExtractorTests.cs | 3 +- .../ConfigurationValidationTests.cs | 1 + .../YamlConfigurationCreatorTests.cs | 2 + .../DownstreamRouteFinderMiddlewareTests.cs | 14 +++---- .../DownstreamRouteFinderTests.cs | 5 ++- .../UrlMatcher/RegExUrlMatcherTests.cs | 7 ++-- ...TemplateVariableNameAndValueFinderTests.cs | 7 ++-- .../DownstreamUrlCreatorMiddlewareTests.cs | 37 +++++++++---------- ...eamUrlPathTemplateVariableReplacerTests.cs | 11 +++--- .../AddHeadersToRequestTests.cs | 5 ++- .../ClaimParserTests.cs | 6 +-- ...ttpRequestHeadersBuilderMiddlewareTests.cs | 10 ++--- .../ScopedRequestDataRepositoryTests.cs | 2 +- .../HttpRequestBuilderMiddlewareTests.cs | 12 +++--- .../RequestBuilder/RequestBuilderTests.cs | 1 + .../HttpRequesterMiddlewareTests.cs | 13 +++---- .../HttpResponderMiddlewareTests.cs | 11 +++--- 77 files changed, 324 insertions(+), 298 deletions(-) rename src/Ocelot.Library/Authentication/{ => Handler}/AuthenticationHandler.cs (79%) rename src/Ocelot.Library/Authentication/{ => Handler/Creator}/AuthenticationHandlerCreator.cs (84%) rename src/Ocelot.Library/Authentication/{ => Handler/Creator}/IAuthenticationHandlerCreator.cs (63%) rename src/Ocelot.Library/Authentication/{ => Handler/Factory}/AuthenticationHandlerFactory.cs (80%) rename src/Ocelot.Library/Authentication/{ => Handler/Factory}/IAuthenticationHandlerFactory.cs (65%) rename src/Ocelot.Library/Authentication/{ => Handler/Factory}/UnableToCreateAuthenticationHandlerError.cs (74%) create mode 100644 src/Ocelot.Library/Authentication/Handler/SupportedAuthenticationProviders.cs rename src/Ocelot.Library/{ => Authentication}/Middleware/AuthenticationMiddleware.cs (84%) rename src/Ocelot.Library/{ => Authentication}/Middleware/AuthenticationMiddlewareMiddlewareExtensions.cs (76%) delete mode 100644 src/Ocelot.Library/Authentication/SupportAuthenticationProviders.cs rename src/Ocelot.Library/Configuration/{Yaml => Creator}/YamlOcelotConfigurationCreator.cs (97%) rename src/Ocelot.Library/{RequestBuilder => Configuration/Parser}/InstructionNotForClaimsError.cs (87%) rename src/Ocelot.Library/{RequestBuilder => Configuration/Parser}/NoInstructionsError.cs (85%) rename src/Ocelot.Library/{RequestBuilder => Configuration/Parser}/ParsingConfigurationHeaderError.cs (88%) rename src/Ocelot.Library/Configuration/{Yaml => Provider}/YamlOcelotConfigurationProvider.cs (93%) rename src/Ocelot.Library/Configuration/{Yaml => Validator}/ConfigurationValidationResult.cs (80%) rename src/Ocelot.Library/Configuration/{Yaml => Validator}/ConfigurationValidator.cs (88%) rename src/Ocelot.Library/Configuration/{Yaml => Validator}/DownstreamTemplateAlreadyUsedError.cs (74%) rename src/Ocelot.Library/Configuration/{Yaml => Validator}/IConfigurationValidator.cs (54%) rename src/Ocelot.Library/Configuration/{Yaml => Validator}/UnsupportedAuthenticationProviderError.cs (75%) rename src/Ocelot.Library/DownstreamRouteFinder/{ => Finder}/DownstreamRouteFinder.cs (94%) rename src/Ocelot.Library/DownstreamRouteFinder/{ => Finder}/IDownstreamRouteFinder.cs (65%) rename src/Ocelot.Library/DownstreamRouteFinder/{ => Finder}/UnableToFindDownstreamRouteError.cs (73%) rename src/Ocelot.Library/{ => DownstreamRouteFinder}/Middleware/DownstreamRouteFinderMiddleware.cs (84%) rename src/Ocelot.Library/{ => DownstreamRouteFinder}/Middleware/DownstreamRouteFinderMiddlewareExtensions.cs (75%) rename src/Ocelot.Library/{ => DownstreamRouteFinder}/UrlMatcher/ITemplateVariableNameAndValueFinder.cs (59%) rename src/Ocelot.Library/{ => DownstreamRouteFinder}/UrlMatcher/IUrlPathToUrlTemplateMatcher.cs (63%) rename src/Ocelot.Library/{ => DownstreamRouteFinder}/UrlMatcher/RegExUrlMatcher.cs (76%) rename src/Ocelot.Library/{ => DownstreamRouteFinder}/UrlMatcher/TemplateVariableNameAndValue.cs (87%) rename src/Ocelot.Library/{ => DownstreamRouteFinder}/UrlMatcher/TemplateVariableNameAndValueFinder.cs (96%) rename src/Ocelot.Library/{ => DownstreamRouteFinder}/UrlMatcher/UrlMatch.cs (74%) rename src/Ocelot.Library/{ => DownstreamUrlCreator}/Middleware/DownstreamUrlCreatorMiddleware.cs (82%) rename src/Ocelot.Library/{ => DownstreamUrlCreator}/Middleware/DownstreamUrlCreatorMiddlewareExtensions.cs (75%) rename src/Ocelot.Library/{ => DownstreamUrlCreator}/UrlTemplateReplacer/DownstreamUrlTemplateVariableReplacer.cs (80%) rename src/Ocelot.Library/{ => DownstreamUrlCreator}/UrlTemplateReplacer/IDownstreamUrlPathTemplateVariableReplacer.cs (53%) rename src/Ocelot.Library/{RequestBuilder => HeaderBuilder}/AddHeadersToRequest.cs (94%) rename src/Ocelot.Library/{RequestBuilder => HeaderBuilder}/IAddHeadersToRequest.cs (89%) rename src/Ocelot.Library/{ => HeaderBuilder}/Middleware/HttpRequestHeadersBuilderMiddleware.cs (82%) rename src/Ocelot.Library/{ => HeaderBuilder}/Middleware/HttpRequestHeadersBuilderMiddlewareExtensions.cs (77%) rename src/Ocelot.Library/{RequestBuilder => HeaderBuilder/Parser}/CannotFindClaimError.cs (83%) rename src/Ocelot.Library/{RequestBuilder => HeaderBuilder/Parser}/ClaimsParser.cs (97%) rename src/Ocelot.Library/{RequestBuilder => HeaderBuilder/Parser}/IClaimsParser.cs (84%) rename src/Ocelot.Library/RequestBuilder/{ => Builder}/HttpRequestBuilder.cs (88%) rename src/Ocelot.Library/RequestBuilder/{ => Builder}/IRequestBuilder.cs (66%) rename src/Ocelot.Library/{ => RequestBuilder}/Middleware/HttpRequestBuilderMiddleware.cs (86%) rename src/Ocelot.Library/{ => RequestBuilder}/Middleware/HttpRequestBuilderMiddlewareExtensions.cs (76%) rename src/Ocelot.Library/{ => Requester}/Middleware/HttpRequesterMiddleware.cs (85%) rename src/Ocelot.Library/{ => Requester}/Middleware/HttpRequesterMiddlewareExtensions.cs (76%) rename src/Ocelot.Library/{ => Responder}/Middleware/HttpResponderMiddleware.cs (89%) rename src/Ocelot.Library/{ => Responder}/Middleware/HttpResponderMiddlewareExtensions.cs (76%) rename src/Ocelot.Library/{Repository => ScopedData}/CannotAddDataError.cs (72%) rename src/Ocelot.Library/{Repository => ScopedData}/CannotFindDataError.cs (73%) rename src/Ocelot.Library/{Repository => ScopedData}/IScopedRequestDataRepository.cs (69%) rename src/Ocelot.Library/{Repository => ScopedData}/ScopedRequestDataRepository.cs (87%) rename test/Ocelot.UnitTests/{Middleware => Authentication}/AuthenticationMiddlewareTests.cs (89%) rename test/Ocelot.UnitTests/{RequestBuilder => Configuration}/ConfigurationHeadersExtractorTests.cs (98%) rename test/Ocelot.UnitTests/{Middleware => DownstreamRouteFinder}/DownstreamRouteFinderMiddlewareTests.cs (90%) rename test/Ocelot.UnitTests/{ => DownstreamRouteFinder}/UrlMatcher/RegExUrlMatcherTests.cs (97%) rename test/Ocelot.UnitTests/{ => DownstreamRouteFinder}/UrlMatcher/TemplateVariableNameAndValueFinderTests.cs (97%) rename test/Ocelot.UnitTests/{Middleware => DownstreamUrlCreator}/DownstreamUrlCreatorMiddlewareTests.cs (83%) rename test/Ocelot.UnitTests/{ => DownstreamUrlCreator}/UrlTemplateReplacer/UpstreamUrlPathTemplateVariableReplacerTests.cs (95%) rename test/Ocelot.UnitTests/{RequestBuilder => HeaderBuilder}/AddHeadersToRequestTests.cs (97%) rename test/Ocelot.UnitTests/{RequestBuilder => HeaderBuilder}/ClaimParserTests.cs (96%) rename test/Ocelot.UnitTests/{Middleware => HeaderBuilder}/HttpRequestHeadersBuilderMiddlewareTests.cs (94%) rename test/Ocelot.UnitTests/{Middleware => RequestBuilder}/HttpRequestBuilderMiddlewareTests.cs (93%) rename test/Ocelot.UnitTests/{Middleware => Requester}/HttpRequesterMiddlewareTests.cs (93%) rename test/Ocelot.UnitTests/{Middleware => Responder}/HttpResponderMiddlewareTests.cs (94%) diff --git a/src/Ocelot.Library/Authentication/AuthenticationHandler.cs b/src/Ocelot.Library/Authentication/Handler/AuthenticationHandler.cs similarity index 79% rename from src/Ocelot.Library/Authentication/AuthenticationHandler.cs rename to src/Ocelot.Library/Authentication/Handler/AuthenticationHandler.cs index 8a2a505e..ccdf0a66 100644 --- a/src/Ocelot.Library/Authentication/AuthenticationHandler.cs +++ b/src/Ocelot.Library/Authentication/Handler/AuthenticationHandler.cs @@ -1,7 +1,7 @@ -namespace Ocelot.Library.Authentication -{ - using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Http; +namespace Ocelot.Library.Authentication.Handler +{ public class AuthenticationHandler { public AuthenticationHandler(string provider, RequestDelegate handler) diff --git a/src/Ocelot.Library/Authentication/AuthenticationHandlerCreator.cs b/src/Ocelot.Library/Authentication/Handler/Creator/AuthenticationHandlerCreator.cs similarity index 84% rename from src/Ocelot.Library/Authentication/AuthenticationHandlerCreator.cs rename to src/Ocelot.Library/Authentication/Handler/Creator/AuthenticationHandlerCreator.cs index 34fedf38..1ff79b20 100644 --- a/src/Ocelot.Library/Authentication/AuthenticationHandlerCreator.cs +++ b/src/Ocelot.Library/Authentication/Handler/Creator/AuthenticationHandlerCreator.cs @@ -1,9 +1,10 @@ -namespace Ocelot.Library.Authentication +using IdentityServer4.AccessTokenValidation; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Http; +using Ocelot.Library.Responses; + +namespace Ocelot.Library.Authentication.Handler.Creator { - using IdentityServer4.AccessTokenValidation; - using Microsoft.AspNetCore.Builder; - using Microsoft.AspNetCore.Http; - using Responses; using AuthenticationOptions = Configuration.AuthenticationOptions; /// diff --git a/src/Ocelot.Library/Authentication/IAuthenticationHandlerCreator.cs b/src/Ocelot.Library/Authentication/Handler/Creator/IAuthenticationHandlerCreator.cs similarity index 63% rename from src/Ocelot.Library/Authentication/IAuthenticationHandlerCreator.cs rename to src/Ocelot.Library/Authentication/Handler/Creator/IAuthenticationHandlerCreator.cs index 5789ecf6..7d3e64c1 100644 --- a/src/Ocelot.Library/Authentication/IAuthenticationHandlerCreator.cs +++ b/src/Ocelot.Library/Authentication/Handler/Creator/IAuthenticationHandlerCreator.cs @@ -1,8 +1,9 @@ -namespace Ocelot.Library.Authentication +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Http; +using Ocelot.Library.Responses; + +namespace Ocelot.Library.Authentication.Handler.Creator { - using Microsoft.AspNetCore.Builder; - using Microsoft.AspNetCore.Http; - using Responses; using AuthenticationOptions = Configuration.AuthenticationOptions; public interface IAuthenticationHandlerCreator diff --git a/src/Ocelot.Library/Authentication/AuthenticationHandlerFactory.cs b/src/Ocelot.Library/Authentication/Handler/Factory/AuthenticationHandlerFactory.cs similarity index 80% rename from src/Ocelot.Library/Authentication/AuthenticationHandlerFactory.cs rename to src/Ocelot.Library/Authentication/Handler/Factory/AuthenticationHandlerFactory.cs index 109d750e..8ef9993c 100644 --- a/src/Ocelot.Library/Authentication/AuthenticationHandlerFactory.cs +++ b/src/Ocelot.Library/Authentication/Handler/Factory/AuthenticationHandlerFactory.cs @@ -1,9 +1,11 @@ -namespace Ocelot.Library.Authentication +using System.Collections.Generic; +using Microsoft.AspNetCore.Builder; +using Ocelot.Library.Authentication.Handler.Creator; +using Ocelot.Library.Errors; +using Ocelot.Library.Responses; + +namespace Ocelot.Library.Authentication.Handler.Factory { - using System.Collections.Generic; - using Errors; - using Microsoft.AspNetCore.Builder; - using Responses; using AuthenticationOptions = Configuration.AuthenticationOptions; public class AuthenticationHandlerFactory : IAuthenticationHandlerFactory diff --git a/src/Ocelot.Library/Authentication/IAuthenticationHandlerFactory.cs b/src/Ocelot.Library/Authentication/Handler/Factory/IAuthenticationHandlerFactory.cs similarity index 65% rename from src/Ocelot.Library/Authentication/IAuthenticationHandlerFactory.cs rename to src/Ocelot.Library/Authentication/Handler/Factory/IAuthenticationHandlerFactory.cs index ea583487..97b7d005 100644 --- a/src/Ocelot.Library/Authentication/IAuthenticationHandlerFactory.cs +++ b/src/Ocelot.Library/Authentication/Handler/Factory/IAuthenticationHandlerFactory.cs @@ -1,7 +1,8 @@ -namespace Ocelot.Library.Authentication +using Microsoft.AspNetCore.Builder; +using Ocelot.Library.Responses; + +namespace Ocelot.Library.Authentication.Handler.Factory { - using Microsoft.AspNetCore.Builder; - using Responses; using AuthenticationOptions = Configuration.AuthenticationOptions; public interface IAuthenticationHandlerFactory diff --git a/src/Ocelot.Library/Authentication/UnableToCreateAuthenticationHandlerError.cs b/src/Ocelot.Library/Authentication/Handler/Factory/UnableToCreateAuthenticationHandlerError.cs similarity index 74% rename from src/Ocelot.Library/Authentication/UnableToCreateAuthenticationHandlerError.cs rename to src/Ocelot.Library/Authentication/Handler/Factory/UnableToCreateAuthenticationHandlerError.cs index bcda8ef6..ba066955 100644 --- a/src/Ocelot.Library/Authentication/UnableToCreateAuthenticationHandlerError.cs +++ b/src/Ocelot.Library/Authentication/Handler/Factory/UnableToCreateAuthenticationHandlerError.cs @@ -1,7 +1,7 @@ -namespace Ocelot.Library.Authentication -{ - using Errors; +using Ocelot.Library.Errors; +namespace Ocelot.Library.Authentication.Handler.Factory +{ public class UnableToCreateAuthenticationHandlerError : Error { public UnableToCreateAuthenticationHandlerError(string message) diff --git a/src/Ocelot.Library/Authentication/Handler/SupportedAuthenticationProviders.cs b/src/Ocelot.Library/Authentication/Handler/SupportedAuthenticationProviders.cs new file mode 100644 index 00000000..c2d624fe --- /dev/null +++ b/src/Ocelot.Library/Authentication/Handler/SupportedAuthenticationProviders.cs @@ -0,0 +1,7 @@ +namespace Ocelot.Library.Authentication.Handler +{ + public enum SupportedAuthenticationProviders + { + IdentityServer + } +} diff --git a/src/Ocelot.Library/Middleware/AuthenticationMiddleware.cs b/src/Ocelot.Library/Authentication/Middleware/AuthenticationMiddleware.cs similarity index 84% rename from src/Ocelot.Library/Middleware/AuthenticationMiddleware.cs rename to src/Ocelot.Library/Authentication/Middleware/AuthenticationMiddleware.cs index 4042edca..7a74bd6a 100644 --- a/src/Ocelot.Library/Middleware/AuthenticationMiddleware.cs +++ b/src/Ocelot.Library/Authentication/Middleware/AuthenticationMiddleware.cs @@ -1,15 +1,16 @@ -namespace Ocelot.Library.Middleware -{ - using System.Collections.Generic; - using System.Threading.Tasks; - using Authentication; - using Configuration; - using DownstreamRouteFinder; - using Errors; - using Microsoft.AspNetCore.Builder; - using Microsoft.AspNetCore.Http; - using Repository; +using System.Collections.Generic; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Http; +using Ocelot.Library.Authentication.Handler.Factory; +using Ocelot.Library.Configuration; +using Ocelot.Library.DownstreamRouteFinder; +using Ocelot.Library.Errors; +using Ocelot.Library.Middleware; +using Ocelot.Library.ScopedData; +namespace Ocelot.Library.Authentication.Middleware +{ public class AuthenticationMiddleware : OcelotMiddleware { private readonly RequestDelegate _next; diff --git a/src/Ocelot.Library/Middleware/AuthenticationMiddlewareMiddlewareExtensions.cs b/src/Ocelot.Library/Authentication/Middleware/AuthenticationMiddlewareMiddlewareExtensions.cs similarity index 76% rename from src/Ocelot.Library/Middleware/AuthenticationMiddlewareMiddlewareExtensions.cs rename to src/Ocelot.Library/Authentication/Middleware/AuthenticationMiddlewareMiddlewareExtensions.cs index 88b3a678..9083a1b2 100644 --- a/src/Ocelot.Library/Middleware/AuthenticationMiddlewareMiddlewareExtensions.cs +++ b/src/Ocelot.Library/Authentication/Middleware/AuthenticationMiddlewareMiddlewareExtensions.cs @@ -1,7 +1,7 @@ -namespace Ocelot.Library.Middleware -{ - using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Builder; +namespace Ocelot.Library.Authentication.Middleware +{ public static class AuthenticationMiddlewareMiddlewareExtensions { public static IApplicationBuilder UseAuthenticationMiddleware(this IApplicationBuilder builder) diff --git a/src/Ocelot.Library/Authentication/SupportAuthenticationProviders.cs b/src/Ocelot.Library/Authentication/SupportAuthenticationProviders.cs deleted file mode 100644 index e9eea91b..00000000 --- a/src/Ocelot.Library/Authentication/SupportAuthenticationProviders.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Ocelot.Library.Authentication -{ - public enum SupportAuthenticationProviders - { - IdentityServer - } -} diff --git a/src/Ocelot.Library/Configuration/Yaml/YamlOcelotConfigurationCreator.cs b/src/Ocelot.Library/Configuration/Creator/YamlOcelotConfigurationCreator.cs similarity index 97% rename from src/Ocelot.Library/Configuration/Yaml/YamlOcelotConfigurationCreator.cs rename to src/Ocelot.Library/Configuration/Creator/YamlOcelotConfigurationCreator.cs index 5d6179a0..433acc66 100644 --- a/src/Ocelot.Library/Configuration/Yaml/YamlOcelotConfigurationCreator.cs +++ b/src/Ocelot.Library/Configuration/Creator/YamlOcelotConfigurationCreator.cs @@ -2,13 +2,12 @@ using System; using System.Collections.Generic; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; -using Ocelot.Library.Configuration.Creator; using Ocelot.Library.Configuration.Parser; -using Ocelot.Library.Configuration.Repository; -using Ocelot.Library.Errors; +using Ocelot.Library.Configuration.Validator; +using Ocelot.Library.Configuration.Yaml; using Ocelot.Library.Responses; -namespace Ocelot.Library.Configuration.Yaml +namespace Ocelot.Library.Configuration.Creator { /// /// Register as singleton diff --git a/src/Ocelot.Library/RequestBuilder/InstructionNotForClaimsError.cs b/src/Ocelot.Library/Configuration/Parser/InstructionNotForClaimsError.cs similarity index 87% rename from src/Ocelot.Library/RequestBuilder/InstructionNotForClaimsError.cs rename to src/Ocelot.Library/Configuration/Parser/InstructionNotForClaimsError.cs index 2802cfe5..651d9caa 100644 --- a/src/Ocelot.Library/RequestBuilder/InstructionNotForClaimsError.cs +++ b/src/Ocelot.Library/Configuration/Parser/InstructionNotForClaimsError.cs @@ -1,6 +1,6 @@ using Ocelot.Library.Errors; -namespace Ocelot.Library.RequestBuilder +namespace Ocelot.Library.Configuration.Parser { public class InstructionNotForClaimsError : Error { diff --git a/src/Ocelot.Library/RequestBuilder/NoInstructionsError.cs b/src/Ocelot.Library/Configuration/Parser/NoInstructionsError.cs similarity index 85% rename from src/Ocelot.Library/RequestBuilder/NoInstructionsError.cs rename to src/Ocelot.Library/Configuration/Parser/NoInstructionsError.cs index 9a2bc694..732603a3 100644 --- a/src/Ocelot.Library/RequestBuilder/NoInstructionsError.cs +++ b/src/Ocelot.Library/Configuration/Parser/NoInstructionsError.cs @@ -1,6 +1,6 @@ using Ocelot.Library.Errors; -namespace Ocelot.Library.RequestBuilder +namespace Ocelot.Library.Configuration.Parser { public class NoInstructionsError : Error { diff --git a/src/Ocelot.Library/RequestBuilder/ParsingConfigurationHeaderError.cs b/src/Ocelot.Library/Configuration/Parser/ParsingConfigurationHeaderError.cs similarity index 88% rename from src/Ocelot.Library/RequestBuilder/ParsingConfigurationHeaderError.cs rename to src/Ocelot.Library/Configuration/Parser/ParsingConfigurationHeaderError.cs index 1b8eaf54..0b7409bc 100644 --- a/src/Ocelot.Library/RequestBuilder/ParsingConfigurationHeaderError.cs +++ b/src/Ocelot.Library/Configuration/Parser/ParsingConfigurationHeaderError.cs @@ -1,7 +1,7 @@ using System; using Ocelot.Library.Errors; -namespace Ocelot.Library.RequestBuilder +namespace Ocelot.Library.Configuration.Parser { public class ParsingConfigurationHeaderError : Error { diff --git a/src/Ocelot.Library/Configuration/Yaml/YamlOcelotConfigurationProvider.cs b/src/Ocelot.Library/Configuration/Provider/YamlOcelotConfigurationProvider.cs similarity index 93% rename from src/Ocelot.Library/Configuration/Yaml/YamlOcelotConfigurationProvider.cs rename to src/Ocelot.Library/Configuration/Provider/YamlOcelotConfigurationProvider.cs index 534fe83c..bf3faab7 100644 --- a/src/Ocelot.Library/Configuration/Yaml/YamlOcelotConfigurationProvider.cs +++ b/src/Ocelot.Library/Configuration/Provider/YamlOcelotConfigurationProvider.cs @@ -1,9 +1,8 @@ using Ocelot.Library.Configuration.Creator; -using Ocelot.Library.Configuration.Provider; using Ocelot.Library.Configuration.Repository; using Ocelot.Library.Responses; -namespace Ocelot.Library.Configuration.Yaml +namespace Ocelot.Library.Configuration.Provider { /// /// Register as singleton diff --git a/src/Ocelot.Library/Configuration/Yaml/ConfigurationValidationResult.cs b/src/Ocelot.Library/Configuration/Validator/ConfigurationValidationResult.cs similarity index 80% rename from src/Ocelot.Library/Configuration/Yaml/ConfigurationValidationResult.cs rename to src/Ocelot.Library/Configuration/Validator/ConfigurationValidationResult.cs index 31b6e1dc..3e40a412 100644 --- a/src/Ocelot.Library/Configuration/Yaml/ConfigurationValidationResult.cs +++ b/src/Ocelot.Library/Configuration/Validator/ConfigurationValidationResult.cs @@ -1,8 +1,8 @@ -namespace Ocelot.Library.Configuration.Yaml -{ - using System.Collections.Generic; - using Errors; +using System.Collections.Generic; +using Ocelot.Library.Errors; +namespace Ocelot.Library.Configuration.Validator +{ public class ConfigurationValidationResult { public ConfigurationValidationResult(bool isError) diff --git a/src/Ocelot.Library/Configuration/Yaml/ConfigurationValidator.cs b/src/Ocelot.Library/Configuration/Validator/ConfigurationValidator.cs similarity index 88% rename from src/Ocelot.Library/Configuration/Yaml/ConfigurationValidator.cs rename to src/Ocelot.Library/Configuration/Validator/ConfigurationValidator.cs index 38964f30..60beb06f 100644 --- a/src/Ocelot.Library/Configuration/Yaml/ConfigurationValidator.cs +++ b/src/Ocelot.Library/Configuration/Validator/ConfigurationValidator.cs @@ -1,12 +1,14 @@ -namespace Ocelot.Library.Configuration.Yaml -{ - using System; - using System.Collections.Generic; - using System.Linq; - using Authentication; - using Errors; - using Responses; +using System; +using System.Collections.Generic; +using System.Linq; +using Ocelot.Library.Authentication; +using Ocelot.Library.Authentication.Handler; +using Ocelot.Library.Configuration.Yaml; +using Ocelot.Library.Errors; +using Ocelot.Library.Responses; +namespace Ocelot.Library.Configuration.Validator +{ public class ConfigurationValidator : IConfigurationValidator { public Response IsValid(YamlConfiguration configuration) @@ -57,7 +59,7 @@ private bool IsSupportedAuthenticationProvider(string provider) { - SupportAuthenticationProviders supportedProvider; + SupportedAuthenticationProviders supportedProvider; return Enum.TryParse(provider, true, out supportedProvider); } diff --git a/src/Ocelot.Library/Configuration/Yaml/DownstreamTemplateAlreadyUsedError.cs b/src/Ocelot.Library/Configuration/Validator/DownstreamTemplateAlreadyUsedError.cs similarity index 74% rename from src/Ocelot.Library/Configuration/Yaml/DownstreamTemplateAlreadyUsedError.cs rename to src/Ocelot.Library/Configuration/Validator/DownstreamTemplateAlreadyUsedError.cs index 0ee8b6c8..ff9a44fa 100644 --- a/src/Ocelot.Library/Configuration/Yaml/DownstreamTemplateAlreadyUsedError.cs +++ b/src/Ocelot.Library/Configuration/Validator/DownstreamTemplateAlreadyUsedError.cs @@ -1,7 +1,7 @@ -namespace Ocelot.Library.Configuration.Yaml -{ - using Errors; +using Ocelot.Library.Errors; +namespace Ocelot.Library.Configuration.Validator +{ public class DownstreamTemplateAlreadyUsedError : Error { public DownstreamTemplateAlreadyUsedError(string message) : base(message, OcelotErrorCode.DownstreamTemplateAlreadyUsedError) diff --git a/src/Ocelot.Library/Configuration/Yaml/IConfigurationValidator.cs b/src/Ocelot.Library/Configuration/Validator/IConfigurationValidator.cs similarity index 54% rename from src/Ocelot.Library/Configuration/Yaml/IConfigurationValidator.cs rename to src/Ocelot.Library/Configuration/Validator/IConfigurationValidator.cs index 38baf36b..ddb2831d 100644 --- a/src/Ocelot.Library/Configuration/Yaml/IConfigurationValidator.cs +++ b/src/Ocelot.Library/Configuration/Validator/IConfigurationValidator.cs @@ -1,7 +1,8 @@ -namespace Ocelot.Library.Configuration.Yaml -{ - using Responses; +using Ocelot.Library.Configuration.Yaml; +using Ocelot.Library.Responses; +namespace Ocelot.Library.Configuration.Validator +{ public interface IConfigurationValidator { Response IsValid(YamlConfiguration configuration); diff --git a/src/Ocelot.Library/Configuration/Yaml/UnsupportedAuthenticationProviderError.cs b/src/Ocelot.Library/Configuration/Validator/UnsupportedAuthenticationProviderError.cs similarity index 75% rename from src/Ocelot.Library/Configuration/Yaml/UnsupportedAuthenticationProviderError.cs rename to src/Ocelot.Library/Configuration/Validator/UnsupportedAuthenticationProviderError.cs index 9a589ca2..e963cb17 100644 --- a/src/Ocelot.Library/Configuration/Yaml/UnsupportedAuthenticationProviderError.cs +++ b/src/Ocelot.Library/Configuration/Validator/UnsupportedAuthenticationProviderError.cs @@ -1,7 +1,7 @@ -namespace Ocelot.Library.Configuration.Yaml -{ - using Errors; +using Ocelot.Library.Errors; +namespace Ocelot.Library.Configuration.Validator +{ public class UnsupportedAuthenticationProviderError : Error { public UnsupportedAuthenticationProviderError(string message) diff --git a/src/Ocelot.Library/DependencyInjection/ServiceCollectionExtensions.cs b/src/Ocelot.Library/DependencyInjection/ServiceCollectionExtensions.cs index 882163c1..1452923b 100644 --- a/src/Ocelot.Library/DependencyInjection/ServiceCollectionExtensions.cs +++ b/src/Ocelot.Library/DependencyInjection/ServiceCollectionExtensions.cs @@ -1,7 +1,17 @@ -using Ocelot.Library.Configuration.Creator; +using Ocelot.Library.Authentication.Handler.Creator; +using Ocelot.Library.Authentication.Handler.Factory; +using Ocelot.Library.Configuration.Creator; using Ocelot.Library.Configuration.Parser; using Ocelot.Library.Configuration.Provider; using Ocelot.Library.Configuration.Repository; +using Ocelot.Library.Configuration.Validator; +using Ocelot.Library.DownstreamRouteFinder.Finder; +using Ocelot.Library.DownstreamRouteFinder.UrlMatcher; +using Ocelot.Library.DownstreamUrlCreator.UrlTemplateReplacer; +using Ocelot.Library.HeaderBuilder; +using Ocelot.Library.HeaderBuilder.Parser; +using Ocelot.Library.RequestBuilder.Builder; +using Ocelot.Library.ScopedData; namespace Ocelot.Library.DependencyInjection { @@ -12,12 +22,9 @@ namespace Ocelot.Library.DependencyInjection using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; - using Repository; using RequestBuilder; using Requester; using Responder; - using UrlMatcher; - using UrlTemplateReplacer; public static class ServiceCollectionExtensions { @@ -48,7 +55,7 @@ namespace Ocelot.Library.DependencyInjection services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); - services.AddSingleton(); + services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); diff --git a/src/Ocelot.Library/DownstreamRouteFinder/DownstreamRoute.cs b/src/Ocelot.Library/DownstreamRouteFinder/DownstreamRoute.cs index ca80f270..7f7fcc61 100644 --- a/src/Ocelot.Library/DownstreamRouteFinder/DownstreamRoute.cs +++ b/src/Ocelot.Library/DownstreamRouteFinder/DownstreamRoute.cs @@ -1,8 +1,9 @@ -namespace Ocelot.Library.DownstreamRouteFinder +using Ocelot.Library.DownstreamRouteFinder.UrlMatcher; + +namespace Ocelot.Library.DownstreamRouteFinder { using System.Collections.Generic; using Configuration; - using UrlMatcher; public class DownstreamRoute { diff --git a/src/Ocelot.Library/DownstreamRouteFinder/DownstreamRouteFinder.cs b/src/Ocelot.Library/DownstreamRouteFinder/Finder/DownstreamRouteFinder.cs similarity index 94% rename from src/Ocelot.Library/DownstreamRouteFinder/DownstreamRouteFinder.cs rename to src/Ocelot.Library/DownstreamRouteFinder/Finder/DownstreamRouteFinder.cs index 542f7341..340ca4d7 100644 --- a/src/Ocelot.Library/DownstreamRouteFinder/DownstreamRouteFinder.cs +++ b/src/Ocelot.Library/DownstreamRouteFinder/Finder/DownstreamRouteFinder.cs @@ -2,11 +2,11 @@ using System.Collections.Generic; using System.Linq; using Ocelot.Library.Configuration.Provider; +using Ocelot.Library.DownstreamRouteFinder.UrlMatcher; using Ocelot.Library.Errors; using Ocelot.Library.Responses; -using Ocelot.Library.UrlMatcher; -namespace Ocelot.Library.DownstreamRouteFinder +namespace Ocelot.Library.DownstreamRouteFinder.Finder { public class DownstreamRouteFinder : IDownstreamRouteFinder { diff --git a/src/Ocelot.Library/DownstreamRouteFinder/IDownstreamRouteFinder.cs b/src/Ocelot.Library/DownstreamRouteFinder/Finder/IDownstreamRouteFinder.cs similarity index 65% rename from src/Ocelot.Library/DownstreamRouteFinder/IDownstreamRouteFinder.cs rename to src/Ocelot.Library/DownstreamRouteFinder/Finder/IDownstreamRouteFinder.cs index 41e2ffe6..3e0cafb4 100644 --- a/src/Ocelot.Library/DownstreamRouteFinder/IDownstreamRouteFinder.cs +++ b/src/Ocelot.Library/DownstreamRouteFinder/Finder/IDownstreamRouteFinder.cs @@ -1,7 +1,7 @@ -namespace Ocelot.Library.DownstreamRouteFinder -{ - using Responses; +using Ocelot.Library.Responses; +namespace Ocelot.Library.DownstreamRouteFinder.Finder +{ public interface IDownstreamRouteFinder { Response FindDownstreamRoute(string upstreamUrlPath, string upstreamHttpMethod); diff --git a/src/Ocelot.Library/DownstreamRouteFinder/UnableToFindDownstreamRouteError.cs b/src/Ocelot.Library/DownstreamRouteFinder/Finder/UnableToFindDownstreamRouteError.cs similarity index 73% rename from src/Ocelot.Library/DownstreamRouteFinder/UnableToFindDownstreamRouteError.cs rename to src/Ocelot.Library/DownstreamRouteFinder/Finder/UnableToFindDownstreamRouteError.cs index e8aacb7b..92595ea2 100644 --- a/src/Ocelot.Library/DownstreamRouteFinder/UnableToFindDownstreamRouteError.cs +++ b/src/Ocelot.Library/DownstreamRouteFinder/Finder/UnableToFindDownstreamRouteError.cs @@ -1,7 +1,7 @@ -namespace Ocelot.Library.DownstreamRouteFinder -{ - using Errors; +using Ocelot.Library.Errors; +namespace Ocelot.Library.DownstreamRouteFinder.Finder +{ public class UnableToFindDownstreamRouteError : Error { public UnableToFindDownstreamRouteError() : base("UnableToFindDownstreamRouteError", OcelotErrorCode.UnableToFindDownstreamRouteError) diff --git a/src/Ocelot.Library/Middleware/DownstreamRouteFinderMiddleware.cs b/src/Ocelot.Library/DownstreamRouteFinder/Middleware/DownstreamRouteFinderMiddleware.cs similarity index 84% rename from src/Ocelot.Library/Middleware/DownstreamRouteFinderMiddleware.cs rename to src/Ocelot.Library/DownstreamRouteFinder/Middleware/DownstreamRouteFinderMiddleware.cs index f83e88ce..9dddc81a 100644 --- a/src/Ocelot.Library/Middleware/DownstreamRouteFinderMiddleware.cs +++ b/src/Ocelot.Library/DownstreamRouteFinder/Middleware/DownstreamRouteFinderMiddleware.cs @@ -1,10 +1,11 @@ -namespace Ocelot.Library.Middleware -{ - using System.Threading.Tasks; - using DownstreamRouteFinder; - using Microsoft.AspNetCore.Http; - using Repository; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; +using Ocelot.Library.DownstreamRouteFinder.Finder; +using Ocelot.Library.Middleware; +using Ocelot.Library.ScopedData; +namespace Ocelot.Library.DownstreamRouteFinder.Middleware +{ public class DownstreamRouteFinderMiddleware : OcelotMiddleware { private readonly RequestDelegate _next; diff --git a/src/Ocelot.Library/Middleware/DownstreamRouteFinderMiddlewareExtensions.cs b/src/Ocelot.Library/DownstreamRouteFinder/Middleware/DownstreamRouteFinderMiddlewareExtensions.cs similarity index 75% rename from src/Ocelot.Library/Middleware/DownstreamRouteFinderMiddlewareExtensions.cs rename to src/Ocelot.Library/DownstreamRouteFinder/Middleware/DownstreamRouteFinderMiddlewareExtensions.cs index b288d789..e07cbcc5 100644 --- a/src/Ocelot.Library/Middleware/DownstreamRouteFinderMiddlewareExtensions.cs +++ b/src/Ocelot.Library/DownstreamRouteFinder/Middleware/DownstreamRouteFinderMiddlewareExtensions.cs @@ -1,7 +1,7 @@ -namespace Ocelot.Library.Middleware -{ - using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Builder; +namespace Ocelot.Library.DownstreamRouteFinder.Middleware +{ public static class DownstreamRouteFinderMiddlewareExtensions { public static IApplicationBuilder UseDownstreamRouteFinderMiddleware(this IApplicationBuilder builder) diff --git a/src/Ocelot.Library/UrlMatcher/ITemplateVariableNameAndValueFinder.cs b/src/Ocelot.Library/DownstreamRouteFinder/UrlMatcher/ITemplateVariableNameAndValueFinder.cs similarity index 59% rename from src/Ocelot.Library/UrlMatcher/ITemplateVariableNameAndValueFinder.cs rename to src/Ocelot.Library/DownstreamRouteFinder/UrlMatcher/ITemplateVariableNameAndValueFinder.cs index ff8bb862..31136199 100644 --- a/src/Ocelot.Library/UrlMatcher/ITemplateVariableNameAndValueFinder.cs +++ b/src/Ocelot.Library/DownstreamRouteFinder/UrlMatcher/ITemplateVariableNameAndValueFinder.cs @@ -1,8 +1,8 @@ -namespace Ocelot.Library.UrlMatcher -{ - using System.Collections.Generic; - using Responses; +using System.Collections.Generic; +using Ocelot.Library.Responses; +namespace Ocelot.Library.DownstreamRouteFinder.UrlMatcher +{ public interface ITemplateVariableNameAndValueFinder { Response> Find(string upstreamUrlPath, string upstreamUrlPathTemplate); diff --git a/src/Ocelot.Library/UrlMatcher/IUrlPathToUrlTemplateMatcher.cs b/src/Ocelot.Library/DownstreamRouteFinder/UrlMatcher/IUrlPathToUrlTemplateMatcher.cs similarity index 63% rename from src/Ocelot.Library/UrlMatcher/IUrlPathToUrlTemplateMatcher.cs rename to src/Ocelot.Library/DownstreamRouteFinder/UrlMatcher/IUrlPathToUrlTemplateMatcher.cs index 996df64c..86af26bb 100644 --- a/src/Ocelot.Library/UrlMatcher/IUrlPathToUrlTemplateMatcher.cs +++ b/src/Ocelot.Library/DownstreamRouteFinder/UrlMatcher/IUrlPathToUrlTemplateMatcher.cs @@ -1,7 +1,7 @@ -namespace Ocelot.Library.UrlMatcher -{ - using Responses; +using Ocelot.Library.Responses; +namespace Ocelot.Library.DownstreamRouteFinder.UrlMatcher +{ public interface IUrlPathToUrlTemplateMatcher { Response Match(string upstreamUrlPath, string upstreamUrlPathTemplate); diff --git a/src/Ocelot.Library/UrlMatcher/RegExUrlMatcher.cs b/src/Ocelot.Library/DownstreamRouteFinder/UrlMatcher/RegExUrlMatcher.cs similarity index 76% rename from src/Ocelot.Library/UrlMatcher/RegExUrlMatcher.cs rename to src/Ocelot.Library/DownstreamRouteFinder/UrlMatcher/RegExUrlMatcher.cs index cfcd209d..0005c81a 100644 --- a/src/Ocelot.Library/UrlMatcher/RegExUrlMatcher.cs +++ b/src/Ocelot.Library/DownstreamRouteFinder/UrlMatcher/RegExUrlMatcher.cs @@ -1,8 +1,8 @@ -namespace Ocelot.Library.UrlMatcher -{ - using System.Text.RegularExpressions; - using Responses; +using System.Text.RegularExpressions; +using Ocelot.Library.Responses; +namespace Ocelot.Library.DownstreamRouteFinder.UrlMatcher +{ public class RegExUrlMatcher : IUrlPathToUrlTemplateMatcher { public Response Match(string upstreamUrlPath, string upstreamUrlPathTemplate) diff --git a/src/Ocelot.Library/UrlMatcher/TemplateVariableNameAndValue.cs b/src/Ocelot.Library/DownstreamRouteFinder/UrlMatcher/TemplateVariableNameAndValue.cs similarity index 87% rename from src/Ocelot.Library/UrlMatcher/TemplateVariableNameAndValue.cs rename to src/Ocelot.Library/DownstreamRouteFinder/UrlMatcher/TemplateVariableNameAndValue.cs index ba81b4fd..c2283720 100644 --- a/src/Ocelot.Library/UrlMatcher/TemplateVariableNameAndValue.cs +++ b/src/Ocelot.Library/DownstreamRouteFinder/UrlMatcher/TemplateVariableNameAndValue.cs @@ -1,4 +1,4 @@ -namespace Ocelot.Library.UrlMatcher +namespace Ocelot.Library.DownstreamRouteFinder.UrlMatcher { public class TemplateVariableNameAndValue { diff --git a/src/Ocelot.Library/UrlMatcher/TemplateVariableNameAndValueFinder.cs b/src/Ocelot.Library/DownstreamRouteFinder/UrlMatcher/TemplateVariableNameAndValueFinder.cs similarity index 96% rename from src/Ocelot.Library/UrlMatcher/TemplateVariableNameAndValueFinder.cs rename to src/Ocelot.Library/DownstreamRouteFinder/UrlMatcher/TemplateVariableNameAndValueFinder.cs index 34f66095..cffada4c 100644 --- a/src/Ocelot.Library/UrlMatcher/TemplateVariableNameAndValueFinder.cs +++ b/src/Ocelot.Library/DownstreamRouteFinder/UrlMatcher/TemplateVariableNameAndValueFinder.cs @@ -1,8 +1,8 @@ -namespace Ocelot.Library.UrlMatcher -{ - using System.Collections.Generic; - using Responses; +using System.Collections.Generic; +using Ocelot.Library.Responses; +namespace Ocelot.Library.DownstreamRouteFinder.UrlMatcher +{ public class TemplateVariableNameAndValueFinder : ITemplateVariableNameAndValueFinder { public Response> Find(string upstreamUrlPath, string upstreamUrlPathTemplate) diff --git a/src/Ocelot.Library/UrlMatcher/UrlMatch.cs b/src/Ocelot.Library/DownstreamRouteFinder/UrlMatcher/UrlMatch.cs similarity index 74% rename from src/Ocelot.Library/UrlMatcher/UrlMatch.cs rename to src/Ocelot.Library/DownstreamRouteFinder/UrlMatcher/UrlMatch.cs index 123b5091..55ebb807 100644 --- a/src/Ocelot.Library/UrlMatcher/UrlMatch.cs +++ b/src/Ocelot.Library/DownstreamRouteFinder/UrlMatcher/UrlMatch.cs @@ -1,4 +1,4 @@ -namespace Ocelot.Library.UrlMatcher +namespace Ocelot.Library.DownstreamRouteFinder.UrlMatcher { public class UrlMatch { diff --git a/src/Ocelot.Library/Middleware/DownstreamUrlCreatorMiddleware.cs b/src/Ocelot.Library/DownstreamUrlCreator/Middleware/DownstreamUrlCreatorMiddleware.cs similarity index 82% rename from src/Ocelot.Library/Middleware/DownstreamUrlCreatorMiddleware.cs rename to src/Ocelot.Library/DownstreamUrlCreator/Middleware/DownstreamUrlCreatorMiddleware.cs index 64ca55cc..604c9132 100644 --- a/src/Ocelot.Library/Middleware/DownstreamUrlCreatorMiddleware.cs +++ b/src/Ocelot.Library/DownstreamUrlCreator/Middleware/DownstreamUrlCreatorMiddleware.cs @@ -1,11 +1,12 @@ -namespace Ocelot.Library.Middleware -{ - using System.Threading.Tasks; - using DownstreamRouteFinder; - using Microsoft.AspNetCore.Http; - using Repository; - using UrlTemplateReplacer; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; +using Ocelot.Library.DownstreamRouteFinder; +using Ocelot.Library.DownstreamUrlCreator.UrlTemplateReplacer; +using Ocelot.Library.Middleware; +using Ocelot.Library.ScopedData; +namespace Ocelot.Library.DownstreamUrlCreator.Middleware +{ public class DownstreamUrlCreatorMiddleware : OcelotMiddleware { private readonly RequestDelegate _next; diff --git a/src/Ocelot.Library/Middleware/DownstreamUrlCreatorMiddlewareExtensions.cs b/src/Ocelot.Library/DownstreamUrlCreator/Middleware/DownstreamUrlCreatorMiddlewareExtensions.cs similarity index 75% rename from src/Ocelot.Library/Middleware/DownstreamUrlCreatorMiddlewareExtensions.cs rename to src/Ocelot.Library/DownstreamUrlCreator/Middleware/DownstreamUrlCreatorMiddlewareExtensions.cs index 19839eb2..63d847d2 100644 --- a/src/Ocelot.Library/Middleware/DownstreamUrlCreatorMiddlewareExtensions.cs +++ b/src/Ocelot.Library/DownstreamUrlCreator/Middleware/DownstreamUrlCreatorMiddlewareExtensions.cs @@ -1,7 +1,7 @@ -namespace Ocelot.Library.Middleware -{ - using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Builder; +namespace Ocelot.Library.DownstreamUrlCreator.Middleware +{ public static class DownstreamUrlCreatorMiddlewareExtensions { public static IApplicationBuilder UseDownstreamUrlCreatorMiddleware(this IApplicationBuilder builder) diff --git a/src/Ocelot.Library/UrlTemplateReplacer/DownstreamUrlTemplateVariableReplacer.cs b/src/Ocelot.Library/DownstreamUrlCreator/UrlTemplateReplacer/DownstreamUrlTemplateVariableReplacer.cs similarity index 80% rename from src/Ocelot.Library/UrlTemplateReplacer/DownstreamUrlTemplateVariableReplacer.cs rename to src/Ocelot.Library/DownstreamUrlCreator/UrlTemplateReplacer/DownstreamUrlTemplateVariableReplacer.cs index 94f1ab24..b8ff44d9 100644 --- a/src/Ocelot.Library/UrlTemplateReplacer/DownstreamUrlTemplateVariableReplacer.cs +++ b/src/Ocelot.Library/DownstreamUrlCreator/UrlTemplateReplacer/DownstreamUrlTemplateVariableReplacer.cs @@ -1,9 +1,9 @@ -namespace Ocelot.Library.UrlTemplateReplacer -{ - using System.Text; - using DownstreamRouteFinder; - using Responses; +using System.Text; +using Ocelot.Library.DownstreamRouteFinder; +using Ocelot.Library.Responses; +namespace Ocelot.Library.DownstreamUrlCreator.UrlTemplateReplacer +{ public class DownstreamUrlTemplateVariableReplacer : IDownstreamUrlTemplateVariableReplacer { public Response ReplaceTemplateVariables(DownstreamRoute downstreamRoute) diff --git a/src/Ocelot.Library/UrlTemplateReplacer/IDownstreamUrlPathTemplateVariableReplacer.cs b/src/Ocelot.Library/DownstreamUrlCreator/UrlTemplateReplacer/IDownstreamUrlPathTemplateVariableReplacer.cs similarity index 53% rename from src/Ocelot.Library/UrlTemplateReplacer/IDownstreamUrlPathTemplateVariableReplacer.cs rename to src/Ocelot.Library/DownstreamUrlCreator/UrlTemplateReplacer/IDownstreamUrlPathTemplateVariableReplacer.cs index 31c50726..ba92174a 100644 --- a/src/Ocelot.Library/UrlTemplateReplacer/IDownstreamUrlPathTemplateVariableReplacer.cs +++ b/src/Ocelot.Library/DownstreamUrlCreator/UrlTemplateReplacer/IDownstreamUrlPathTemplateVariableReplacer.cs @@ -1,8 +1,8 @@ -namespace Ocelot.Library.UrlTemplateReplacer -{ - using DownstreamRouteFinder; - using Responses; +using Ocelot.Library.DownstreamRouteFinder; +using Ocelot.Library.Responses; +namespace Ocelot.Library.DownstreamUrlCreator.UrlTemplateReplacer +{ public interface IDownstreamUrlTemplateVariableReplacer { Response ReplaceTemplateVariables(DownstreamRoute downstreamRoute); diff --git a/src/Ocelot.Library/RequestBuilder/AddHeadersToRequest.cs b/src/Ocelot.Library/HeaderBuilder/AddHeadersToRequest.cs similarity index 94% rename from src/Ocelot.Library/RequestBuilder/AddHeadersToRequest.cs rename to src/Ocelot.Library/HeaderBuilder/AddHeadersToRequest.cs index 88823097..6c2634fa 100644 --- a/src/Ocelot.Library/RequestBuilder/AddHeadersToRequest.cs +++ b/src/Ocelot.Library/HeaderBuilder/AddHeadersToRequest.cs @@ -3,9 +3,10 @@ using System.Linq; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Primitives; using Ocelot.Library.Configuration; +using Ocelot.Library.HeaderBuilder.Parser; using Ocelot.Library.Responses; -namespace Ocelot.Library.RequestBuilder +namespace Ocelot.Library.HeaderBuilder { public class AddHeadersToRequest : IAddHeadersToRequest { diff --git a/src/Ocelot.Library/RequestBuilder/IAddHeadersToRequest.cs b/src/Ocelot.Library/HeaderBuilder/IAddHeadersToRequest.cs similarity index 89% rename from src/Ocelot.Library/RequestBuilder/IAddHeadersToRequest.cs rename to src/Ocelot.Library/HeaderBuilder/IAddHeadersToRequest.cs index d1e96506..c958f199 100644 --- a/src/Ocelot.Library/RequestBuilder/IAddHeadersToRequest.cs +++ b/src/Ocelot.Library/HeaderBuilder/IAddHeadersToRequest.cs @@ -3,7 +3,7 @@ using Microsoft.AspNetCore.Http; using Ocelot.Library.Configuration; using Ocelot.Library.Responses; -namespace Ocelot.Library.RequestBuilder +namespace Ocelot.Library.HeaderBuilder { public interface IAddHeadersToRequest { diff --git a/src/Ocelot.Library/Middleware/HttpRequestHeadersBuilderMiddleware.cs b/src/Ocelot.Library/HeaderBuilder/Middleware/HttpRequestHeadersBuilderMiddleware.cs similarity index 82% rename from src/Ocelot.Library/Middleware/HttpRequestHeadersBuilderMiddleware.cs rename to src/Ocelot.Library/HeaderBuilder/Middleware/HttpRequestHeadersBuilderMiddleware.cs index 562f898b..001a424b 100644 --- a/src/Ocelot.Library/Middleware/HttpRequestHeadersBuilderMiddleware.cs +++ b/src/Ocelot.Library/HeaderBuilder/Middleware/HttpRequestHeadersBuilderMiddleware.cs @@ -1,15 +1,12 @@ -using System.Collections.Generic; -using System.Linq; -using Microsoft.Extensions.Primitives; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; using Ocelot.Library.DownstreamRouteFinder; -using Ocelot.Library.RequestBuilder; +using Ocelot.Library.Middleware; +using Ocelot.Library.ScopedData; -namespace Ocelot.Library.Middleware +namespace Ocelot.Library.HeaderBuilder.Middleware { - using System.Threading.Tasks; - using Microsoft.AspNetCore.Http; - using Repository; - public class HttpRequestHeadersBuilderMiddleware : OcelotMiddleware { private readonly RequestDelegate _next; diff --git a/src/Ocelot.Library/Middleware/HttpRequestHeadersBuilderMiddlewareExtensions.cs b/src/Ocelot.Library/HeaderBuilder/Middleware/HttpRequestHeadersBuilderMiddlewareExtensions.cs similarity index 77% rename from src/Ocelot.Library/Middleware/HttpRequestHeadersBuilderMiddlewareExtensions.cs rename to src/Ocelot.Library/HeaderBuilder/Middleware/HttpRequestHeadersBuilderMiddlewareExtensions.cs index d657add1..acb1cd28 100644 --- a/src/Ocelot.Library/Middleware/HttpRequestHeadersBuilderMiddlewareExtensions.cs +++ b/src/Ocelot.Library/HeaderBuilder/Middleware/HttpRequestHeadersBuilderMiddlewareExtensions.cs @@ -1,7 +1,7 @@ -namespace Ocelot.Library.Middleware -{ - using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Builder; +namespace Ocelot.Library.HeaderBuilder.Middleware +{ public static class HttpRequestHeadersBuilderMiddlewareExtensions { public static IApplicationBuilder UseHttpRequestHeadersBuilderMiddleware(this IApplicationBuilder builder) diff --git a/src/Ocelot.Library/RequestBuilder/CannotFindClaimError.cs b/src/Ocelot.Library/HeaderBuilder/Parser/CannotFindClaimError.cs similarity index 83% rename from src/Ocelot.Library/RequestBuilder/CannotFindClaimError.cs rename to src/Ocelot.Library/HeaderBuilder/Parser/CannotFindClaimError.cs index 0c9e3dac..f3270269 100644 --- a/src/Ocelot.Library/RequestBuilder/CannotFindClaimError.cs +++ b/src/Ocelot.Library/HeaderBuilder/Parser/CannotFindClaimError.cs @@ -1,6 +1,6 @@ using Ocelot.Library.Errors; -namespace Ocelot.Library.RequestBuilder +namespace Ocelot.Library.HeaderBuilder.Parser { public class CannotFindClaimError : Error { diff --git a/src/Ocelot.Library/RequestBuilder/ClaimsParser.cs b/src/Ocelot.Library/HeaderBuilder/Parser/ClaimsParser.cs similarity index 97% rename from src/Ocelot.Library/RequestBuilder/ClaimsParser.cs rename to src/Ocelot.Library/HeaderBuilder/Parser/ClaimsParser.cs index 504950e7..5ef6eab6 100644 --- a/src/Ocelot.Library/RequestBuilder/ClaimsParser.cs +++ b/src/Ocelot.Library/HeaderBuilder/Parser/ClaimsParser.cs @@ -4,7 +4,7 @@ using System.Security.Claims; using Ocelot.Library.Errors; using Ocelot.Library.Responses; -namespace Ocelot.Library.RequestBuilder +namespace Ocelot.Library.HeaderBuilder.Parser { public class ClaimsParser : IClaimsParser { diff --git a/src/Ocelot.Library/RequestBuilder/IClaimsParser.cs b/src/Ocelot.Library/HeaderBuilder/Parser/IClaimsParser.cs similarity index 84% rename from src/Ocelot.Library/RequestBuilder/IClaimsParser.cs rename to src/Ocelot.Library/HeaderBuilder/Parser/IClaimsParser.cs index c3cdd962..7f662d59 100644 --- a/src/Ocelot.Library/RequestBuilder/IClaimsParser.cs +++ b/src/Ocelot.Library/HeaderBuilder/Parser/IClaimsParser.cs @@ -2,7 +2,7 @@ using System.Security.Claims; using Ocelot.Library.Responses; -namespace Ocelot.Library.RequestBuilder +namespace Ocelot.Library.HeaderBuilder.Parser { public interface IClaimsParser { diff --git a/src/Ocelot.Library/Middleware/OcelotMiddleware.cs b/src/Ocelot.Library/Middleware/OcelotMiddleware.cs index 857d8369..eeccc65e 100644 --- a/src/Ocelot.Library/Middleware/OcelotMiddleware.cs +++ b/src/Ocelot.Library/Middleware/OcelotMiddleware.cs @@ -1,8 +1,9 @@ -namespace Ocelot.Library.Middleware +using Ocelot.Library.ScopedData; + +namespace Ocelot.Library.Middleware { using System.Collections.Generic; using Errors; - using Repository; public abstract class OcelotMiddleware { diff --git a/src/Ocelot.Library/Middleware/OcelotMiddlewareExtensions.cs b/src/Ocelot.Library/Middleware/OcelotMiddlewareExtensions.cs index e1c0ffe6..3fb320bd 100644 --- a/src/Ocelot.Library/Middleware/OcelotMiddlewareExtensions.cs +++ b/src/Ocelot.Library/Middleware/OcelotMiddlewareExtensions.cs @@ -1,4 +1,12 @@ -namespace Ocelot.Library.Middleware +using Ocelot.Library.Authentication.Middleware; +using Ocelot.Library.DownstreamRouteFinder.Middleware; +using Ocelot.Library.DownstreamUrlCreator.Middleware; +using Ocelot.Library.HeaderBuilder.Middleware; +using Ocelot.Library.RequestBuilder.Middleware; +using Ocelot.Library.Requester.Middleware; +using Ocelot.Library.Responder.Middleware; + +namespace Ocelot.Library.Middleware { using Microsoft.AspNetCore.Builder; diff --git a/src/Ocelot.Library/RequestBuilder/HttpRequestBuilder.cs b/src/Ocelot.Library/RequestBuilder/Builder/HttpRequestBuilder.cs similarity index 88% rename from src/Ocelot.Library/RequestBuilder/HttpRequestBuilder.cs rename to src/Ocelot.Library/RequestBuilder/Builder/HttpRequestBuilder.cs index d12fec2f..b1846e6e 100644 --- a/src/Ocelot.Library/RequestBuilder/HttpRequestBuilder.cs +++ b/src/Ocelot.Library/RequestBuilder/Builder/HttpRequestBuilder.cs @@ -1,14 +1,14 @@ -namespace Ocelot.Library.RequestBuilder -{ - using System; - using System.IO; - using System.Net; - using System.Net.Http; - using System.Net.Http.Headers; - using System.Threading.Tasks; - using Microsoft.AspNetCore.Http; - using Responses; +using System; +using System.IO; +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; +using Ocelot.Library.Responses; +namespace Ocelot.Library.RequestBuilder.Builder +{ public class HttpRequestBuilder : IRequestBuilder { public async Task> Build(string httpMethod, string downstreamUrl, Stream content, IHeaderDictionary headers, diff --git a/src/Ocelot.Library/RequestBuilder/IRequestBuilder.cs b/src/Ocelot.Library/RequestBuilder/Builder/IRequestBuilder.cs similarity index 66% rename from src/Ocelot.Library/RequestBuilder/IRequestBuilder.cs rename to src/Ocelot.Library/RequestBuilder/Builder/IRequestBuilder.cs index 353d438a..a2c51eb5 100644 --- a/src/Ocelot.Library/RequestBuilder/IRequestBuilder.cs +++ b/src/Ocelot.Library/RequestBuilder/Builder/IRequestBuilder.cs @@ -1,10 +1,10 @@ -namespace Ocelot.Library.RequestBuilder -{ - using System.IO; - using System.Threading.Tasks; - using Microsoft.AspNetCore.Http; - using Responses; +using System.IO; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; +using Ocelot.Library.Responses; +namespace Ocelot.Library.RequestBuilder.Builder +{ public interface IRequestBuilder { Task> Build(string httpMethod, diff --git a/src/Ocelot.Library/Middleware/HttpRequestBuilderMiddleware.cs b/src/Ocelot.Library/RequestBuilder/Middleware/HttpRequestBuilderMiddleware.cs similarity index 86% rename from src/Ocelot.Library/Middleware/HttpRequestBuilderMiddleware.cs rename to src/Ocelot.Library/RequestBuilder/Middleware/HttpRequestBuilderMiddleware.cs index f60f72d9..3d3be229 100644 --- a/src/Ocelot.Library/Middleware/HttpRequestBuilderMiddleware.cs +++ b/src/Ocelot.Library/RequestBuilder/Middleware/HttpRequestBuilderMiddleware.cs @@ -1,10 +1,11 @@ -namespace Ocelot.Library.Middleware -{ - using System.Threading.Tasks; - using Microsoft.AspNetCore.Http; - using Repository; - using RequestBuilder; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; +using Ocelot.Library.Middleware; +using Ocelot.Library.RequestBuilder.Builder; +using Ocelot.Library.ScopedData; +namespace Ocelot.Library.RequestBuilder.Middleware +{ public class HttpRequestBuilderMiddleware : OcelotMiddleware { private readonly RequestDelegate _next; diff --git a/src/Ocelot.Library/Middleware/HttpRequestBuilderMiddlewareExtensions.cs b/src/Ocelot.Library/RequestBuilder/Middleware/HttpRequestBuilderMiddlewareExtensions.cs similarity index 76% rename from src/Ocelot.Library/Middleware/HttpRequestBuilderMiddlewareExtensions.cs rename to src/Ocelot.Library/RequestBuilder/Middleware/HttpRequestBuilderMiddlewareExtensions.cs index 54877b09..b82d437e 100644 --- a/src/Ocelot.Library/Middleware/HttpRequestBuilderMiddlewareExtensions.cs +++ b/src/Ocelot.Library/RequestBuilder/Middleware/HttpRequestBuilderMiddlewareExtensions.cs @@ -1,7 +1,7 @@ -namespace Ocelot.Library.Middleware -{ - using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Builder; +namespace Ocelot.Library.RequestBuilder.Middleware +{ public static class HttpRequestBuilderMiddlewareExtensions { public static IApplicationBuilder UseHttpRequestBuilderMiddleware(this IApplicationBuilder builder) diff --git a/src/Ocelot.Library/Middleware/HttpRequesterMiddleware.cs b/src/Ocelot.Library/Requester/Middleware/HttpRequesterMiddleware.cs similarity index 85% rename from src/Ocelot.Library/Middleware/HttpRequesterMiddleware.cs rename to src/Ocelot.Library/Requester/Middleware/HttpRequesterMiddleware.cs index f9aac74b..b24995f4 100644 --- a/src/Ocelot.Library/Middleware/HttpRequesterMiddleware.cs +++ b/src/Ocelot.Library/Requester/Middleware/HttpRequesterMiddleware.cs @@ -1,11 +1,11 @@ -namespace Ocelot.Library.Middleware -{ - using System.Threading.Tasks; - using Microsoft.AspNetCore.Http; - using Repository; - using RequestBuilder; - using Requester; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; +using Ocelot.Library.Middleware; +using Ocelot.Library.RequestBuilder; +using Ocelot.Library.ScopedData; +namespace Ocelot.Library.Requester.Middleware +{ public class HttpRequesterMiddleware : OcelotMiddleware { private readonly RequestDelegate _next; diff --git a/src/Ocelot.Library/Middleware/HttpRequesterMiddlewareExtensions.cs b/src/Ocelot.Library/Requester/Middleware/HttpRequesterMiddlewareExtensions.cs similarity index 76% rename from src/Ocelot.Library/Middleware/HttpRequesterMiddlewareExtensions.cs rename to src/Ocelot.Library/Requester/Middleware/HttpRequesterMiddlewareExtensions.cs index 5ad921f2..73af0cd2 100644 --- a/src/Ocelot.Library/Middleware/HttpRequesterMiddlewareExtensions.cs +++ b/src/Ocelot.Library/Requester/Middleware/HttpRequesterMiddlewareExtensions.cs @@ -1,7 +1,7 @@ -namespace Ocelot.Library.Middleware -{ - using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Builder; +namespace Ocelot.Library.Requester.Middleware +{ public static class HttpRequesterMiddlewareExtensions { public static IApplicationBuilder UseHttpRequesterMiddleware(this IApplicationBuilder builder) diff --git a/src/Ocelot.Library/Middleware/HttpResponderMiddleware.cs b/src/Ocelot.Library/Responder/Middleware/HttpResponderMiddleware.cs similarity index 89% rename from src/Ocelot.Library/Middleware/HttpResponderMiddleware.cs rename to src/Ocelot.Library/Responder/Middleware/HttpResponderMiddleware.cs index 7d40e5e6..b822d6b7 100644 --- a/src/Ocelot.Library/Middleware/HttpResponderMiddleware.cs +++ b/src/Ocelot.Library/Responder/Middleware/HttpResponderMiddleware.cs @@ -1,11 +1,11 @@ -namespace Ocelot.Library.Middleware -{ - using System.Net.Http; - using System.Threading.Tasks; - using Microsoft.AspNetCore.Http; - using Repository; - using Responder; +using System.Net.Http; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; +using Ocelot.Library.Middleware; +using Ocelot.Library.ScopedData; +namespace Ocelot.Library.Responder.Middleware +{ public class HttpResponderMiddleware : OcelotMiddleware { private readonly RequestDelegate _next; diff --git a/src/Ocelot.Library/Middleware/HttpResponderMiddlewareExtensions.cs b/src/Ocelot.Library/Responder/Middleware/HttpResponderMiddlewareExtensions.cs similarity index 76% rename from src/Ocelot.Library/Middleware/HttpResponderMiddlewareExtensions.cs rename to src/Ocelot.Library/Responder/Middleware/HttpResponderMiddlewareExtensions.cs index 04640d51..7ef7db83 100644 --- a/src/Ocelot.Library/Middleware/HttpResponderMiddlewareExtensions.cs +++ b/src/Ocelot.Library/Responder/Middleware/HttpResponderMiddlewareExtensions.cs @@ -1,7 +1,7 @@ -namespace Ocelot.Library.Middleware -{ - using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Builder; +namespace Ocelot.Library.Responder.Middleware +{ public static class HttpResponderMiddlewareExtensions { public static IApplicationBuilder UseHttpResponderMiddleware(this IApplicationBuilder builder) diff --git a/src/Ocelot.Library/Repository/CannotAddDataError.cs b/src/Ocelot.Library/ScopedData/CannotAddDataError.cs similarity index 72% rename from src/Ocelot.Library/Repository/CannotAddDataError.cs rename to src/Ocelot.Library/ScopedData/CannotAddDataError.cs index f3bd42de..bcdd5c28 100644 --- a/src/Ocelot.Library/Repository/CannotAddDataError.cs +++ b/src/Ocelot.Library/ScopedData/CannotAddDataError.cs @@ -1,7 +1,7 @@ -namespace Ocelot.Library.Repository -{ - using Errors; +using Ocelot.Library.Errors; +namespace Ocelot.Library.ScopedData +{ public class CannotAddDataError : Error { public CannotAddDataError(string message) : base(message, OcelotErrorCode.CannotAddDataError) diff --git a/src/Ocelot.Library/Repository/CannotFindDataError.cs b/src/Ocelot.Library/ScopedData/CannotFindDataError.cs similarity index 73% rename from src/Ocelot.Library/Repository/CannotFindDataError.cs rename to src/Ocelot.Library/ScopedData/CannotFindDataError.cs index b61069b5..9daedcd4 100644 --- a/src/Ocelot.Library/Repository/CannotFindDataError.cs +++ b/src/Ocelot.Library/ScopedData/CannotFindDataError.cs @@ -1,7 +1,7 @@ -namespace Ocelot.Library.Repository -{ - using Errors; +using Ocelot.Library.Errors; +namespace Ocelot.Library.ScopedData +{ public class CannotFindDataError : Error { public CannotFindDataError(string message) : base(message, OcelotErrorCode.CannotFindDataError) diff --git a/src/Ocelot.Library/Repository/IScopedRequestDataRepository.cs b/src/Ocelot.Library/ScopedData/IScopedRequestDataRepository.cs similarity index 69% rename from src/Ocelot.Library/Repository/IScopedRequestDataRepository.cs rename to src/Ocelot.Library/ScopedData/IScopedRequestDataRepository.cs index f8e37133..852a6121 100644 --- a/src/Ocelot.Library/Repository/IScopedRequestDataRepository.cs +++ b/src/Ocelot.Library/ScopedData/IScopedRequestDataRepository.cs @@ -1,7 +1,7 @@ -namespace Ocelot.Library.Repository -{ - using Responses; +using Ocelot.Library.Responses; +namespace Ocelot.Library.ScopedData +{ public interface IScopedRequestDataRepository { Response Add(string key, T value); diff --git a/src/Ocelot.Library/Repository/ScopedRequestDataRepository.cs b/src/Ocelot.Library/ScopedData/ScopedRequestDataRepository.cs similarity index 87% rename from src/Ocelot.Library/Repository/ScopedRequestDataRepository.cs rename to src/Ocelot.Library/ScopedData/ScopedRequestDataRepository.cs index b242617e..928e1ebb 100644 --- a/src/Ocelot.Library/Repository/ScopedRequestDataRepository.cs +++ b/src/Ocelot.Library/ScopedData/ScopedRequestDataRepository.cs @@ -1,11 +1,11 @@ -namespace Ocelot.Library.Repository -{ - using System; - using System.Collections.Generic; - using Errors; - using Microsoft.AspNetCore.Http; - using Responses; +using System; +using System.Collections.Generic; +using Microsoft.AspNetCore.Http; +using Ocelot.Library.Errors; +using Ocelot.Library.Responses; +namespace Ocelot.Library.ScopedData +{ public class ScopedRequestDataRepository : IScopedRequestDataRepository { private readonly IHttpContextAccessor _httpContextAccessor; diff --git a/test/Ocelot.UnitTests/Authentication/AuthenticationHandlerFactoryTests.cs b/test/Ocelot.UnitTests/Authentication/AuthenticationHandlerFactoryTests.cs index fb6311c6..483857c8 100644 --- a/test/Ocelot.UnitTests/Authentication/AuthenticationHandlerFactoryTests.cs +++ b/test/Ocelot.UnitTests/Authentication/AuthenticationHandlerFactoryTests.cs @@ -3,6 +3,9 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Http; using Moq; +using Ocelot.Library.Authentication.Handler; +using Ocelot.Library.Authentication.Handler.Creator; +using Ocelot.Library.Authentication.Handler.Factory; using Shouldly; using TestStack.BDDfy; using Xunit; diff --git a/test/Ocelot.UnitTests/Middleware/AuthenticationMiddlewareTests.cs b/test/Ocelot.UnitTests/Authentication/AuthenticationMiddlewareTests.cs similarity index 89% rename from test/Ocelot.UnitTests/Middleware/AuthenticationMiddlewareTests.cs rename to test/Ocelot.UnitTests/Authentication/AuthenticationMiddlewareTests.cs index eebccfa3..89b84a1e 100644 --- a/test/Ocelot.UnitTests/Middleware/AuthenticationMiddlewareTests.cs +++ b/test/Ocelot.UnitTests/Authentication/AuthenticationMiddlewareTests.cs @@ -6,19 +6,18 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.TestHost; using Microsoft.Extensions.DependencyInjection; using Moq; +using Ocelot.Library.Authentication.Handler.Factory; +using Ocelot.Library.Authentication.Middleware; using Ocelot.Library.Configuration.Builder; +using Ocelot.Library.DownstreamRouteFinder; +using Ocelot.Library.DownstreamRouteFinder.UrlMatcher; +using Ocelot.Library.Responses; +using Ocelot.Library.ScopedData; using TestStack.BDDfy; using Xunit; -namespace Ocelot.UnitTests.Middleware +namespace Ocelot.UnitTests.Authentication { - using Library.Authentication; - using Library.DownstreamRouteFinder; - using Library.Middleware; - using Library.Repository; - using Library.Responses; - using Library.UrlMatcher; - public class AuthenticationMiddlewareTests : IDisposable { private readonly Mock _scopedRepository; diff --git a/test/Ocelot.UnitTests/RequestBuilder/ConfigurationHeadersExtractorTests.cs b/test/Ocelot.UnitTests/Configuration/ConfigurationHeadersExtractorTests.cs similarity index 98% rename from test/Ocelot.UnitTests/RequestBuilder/ConfigurationHeadersExtractorTests.cs rename to test/Ocelot.UnitTests/Configuration/ConfigurationHeadersExtractorTests.cs index d61daaa7..29f674be 100644 --- a/test/Ocelot.UnitTests/RequestBuilder/ConfigurationHeadersExtractorTests.cs +++ b/test/Ocelot.UnitTests/Configuration/ConfigurationHeadersExtractorTests.cs @@ -3,13 +3,12 @@ using System.Linq; using Ocelot.Library.Configuration; using Ocelot.Library.Configuration.Parser; using Ocelot.Library.Errors; -using Ocelot.Library.RequestBuilder; using Ocelot.Library.Responses; using Shouldly; using TestStack.BDDfy; using Xunit; -namespace Ocelot.UnitTests.RequestBuilder +namespace Ocelot.UnitTests.Configuration { public class ConfigurationHeadersExtractorTests { diff --git a/test/Ocelot.UnitTests/Configuration/ConfigurationValidationTests.cs b/test/Ocelot.UnitTests/Configuration/ConfigurationValidationTests.cs index a9650451..a9395a93 100644 --- a/test/Ocelot.UnitTests/Configuration/ConfigurationValidationTests.cs +++ b/test/Ocelot.UnitTests/Configuration/ConfigurationValidationTests.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using Ocelot.Library.Configuration.Validator; using Shouldly; using TestStack.BDDfy; using Xunit; diff --git a/test/Ocelot.UnitTests/Configuration/YamlConfigurationCreatorTests.cs b/test/Ocelot.UnitTests/Configuration/YamlConfigurationCreatorTests.cs index 4e6d5fa5..102b0eae 100644 --- a/test/Ocelot.UnitTests/Configuration/YamlConfigurationCreatorTests.cs +++ b/test/Ocelot.UnitTests/Configuration/YamlConfigurationCreatorTests.cs @@ -3,8 +3,10 @@ using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Moq; using Ocelot.Library.Configuration.Builder; +using Ocelot.Library.Configuration.Creator; using Ocelot.Library.Configuration.Parser; using Ocelot.Library.Configuration.Repository; +using Ocelot.Library.Configuration.Validator; using Ocelot.Library.RequestBuilder; using Shouldly; using TestStack.BDDfy; diff --git a/test/Ocelot.UnitTests/Middleware/DownstreamRouteFinderMiddlewareTests.cs b/test/Ocelot.UnitTests/DownstreamRouteFinder/DownstreamRouteFinderMiddlewareTests.cs similarity index 90% rename from test/Ocelot.UnitTests/Middleware/DownstreamRouteFinderMiddlewareTests.cs rename to test/Ocelot.UnitTests/DownstreamRouteFinder/DownstreamRouteFinderMiddlewareTests.cs index 898e1648..f3ab97cb 100644 --- a/test/Ocelot.UnitTests/Middleware/DownstreamRouteFinderMiddlewareTests.cs +++ b/test/Ocelot.UnitTests/DownstreamRouteFinder/DownstreamRouteFinderMiddlewareTests.cs @@ -7,17 +7,17 @@ using Microsoft.AspNetCore.TestHost; using Microsoft.Extensions.DependencyInjection; using Moq; using Ocelot.Library.Configuration.Builder; +using Ocelot.Library.DownstreamRouteFinder; +using Ocelot.Library.DownstreamRouteFinder.Finder; +using Ocelot.Library.DownstreamRouteFinder.Middleware; +using Ocelot.Library.DownstreamRouteFinder.UrlMatcher; +using Ocelot.Library.Responses; +using Ocelot.Library.ScopedData; using TestStack.BDDfy; using Xunit; -namespace Ocelot.UnitTests.Middleware +namespace Ocelot.UnitTests.DownstreamRouteFinder { - using Library.DownstreamRouteFinder; - using Library.Middleware; - using Library.Repository; - using Library.Responses; - using Library.UrlMatcher; - public class DownstreamRouteFinderMiddlewareTests : IDisposable { private readonly Mock _downstreamRouteFinder; diff --git a/test/Ocelot.UnitTests/DownstreamRouteFinder/DownstreamRouteFinderTests.cs b/test/Ocelot.UnitTests/DownstreamRouteFinder/DownstreamRouteFinderTests.cs index 24ef25e7..8ea8e581 100644 --- a/test/Ocelot.UnitTests/DownstreamRouteFinder/DownstreamRouteFinderTests.cs +++ b/test/Ocelot.UnitTests/DownstreamRouteFinder/DownstreamRouteFinderTests.cs @@ -2,6 +2,8 @@ using Moq; using Ocelot.Library.Configuration.Builder; using Ocelot.Library.Configuration.Provider; +using Ocelot.Library.DownstreamRouteFinder.Finder; +using Ocelot.Library.DownstreamRouteFinder.UrlMatcher; using Shouldly; using TestStack.BDDfy; using Xunit; @@ -11,7 +13,6 @@ namespace Ocelot.UnitTests.DownstreamRouteFinder using Library.Configuration; using Library.DownstreamRouteFinder; using Library.Responses; - using Library.UrlMatcher; public class DownstreamRouteFinderTests { @@ -30,7 +31,7 @@ namespace Ocelot.UnitTests.DownstreamRouteFinder _mockConfig = new Mock(); _mockMatcher = new Mock(); _finder = new Mock(); - _downstreamRouteFinder = new DownstreamRouteFinder(_mockConfig.Object, _mockMatcher.Object, _finder.Object); + _downstreamRouteFinder = new Library.DownstreamRouteFinder.Finder.DownstreamRouteFinder(_mockConfig.Object, _mockMatcher.Object, _finder.Object); } [Fact] diff --git a/test/Ocelot.UnitTests/UrlMatcher/RegExUrlMatcherTests.cs b/test/Ocelot.UnitTests/DownstreamRouteFinder/UrlMatcher/RegExUrlMatcherTests.cs similarity index 97% rename from test/Ocelot.UnitTests/UrlMatcher/RegExUrlMatcherTests.cs rename to test/Ocelot.UnitTests/DownstreamRouteFinder/UrlMatcher/RegExUrlMatcherTests.cs index 392df6e2..0b0c8b50 100644 --- a/test/Ocelot.UnitTests/UrlMatcher/RegExUrlMatcherTests.cs +++ b/test/Ocelot.UnitTests/DownstreamRouteFinder/UrlMatcher/RegExUrlMatcherTests.cs @@ -1,12 +1,11 @@ +using Ocelot.Library.DownstreamRouteFinder.UrlMatcher; +using Ocelot.Library.Responses; using Shouldly; using TestStack.BDDfy; using Xunit; -namespace Ocelot.UnitTests.UrlMatcher +namespace Ocelot.UnitTests.DownstreamRouteFinder.UrlMatcher { - using Library.Responses; - using Library.UrlMatcher; - public class RegExUrlMatcherTests { private readonly IUrlPathToUrlTemplateMatcher _urlMatcher; diff --git a/test/Ocelot.UnitTests/UrlMatcher/TemplateVariableNameAndValueFinderTests.cs b/test/Ocelot.UnitTests/DownstreamRouteFinder/UrlMatcher/TemplateVariableNameAndValueFinderTests.cs similarity index 97% rename from test/Ocelot.UnitTests/UrlMatcher/TemplateVariableNameAndValueFinderTests.cs rename to test/Ocelot.UnitTests/DownstreamRouteFinder/UrlMatcher/TemplateVariableNameAndValueFinderTests.cs index 3bb3b428..800f2024 100644 --- a/test/Ocelot.UnitTests/UrlMatcher/TemplateVariableNameAndValueFinderTests.cs +++ b/test/Ocelot.UnitTests/DownstreamRouteFinder/UrlMatcher/TemplateVariableNameAndValueFinderTests.cs @@ -1,14 +1,13 @@ using System.Collections.Generic; using System.Linq; +using Ocelot.Library.DownstreamRouteFinder.UrlMatcher; +using Ocelot.Library.Responses; using Shouldly; using TestStack.BDDfy; using Xunit; -namespace Ocelot.UnitTests.UrlMatcher +namespace Ocelot.UnitTests.DownstreamRouteFinder.UrlMatcher { - using Library.Responses; - using Library.UrlMatcher; - public class UrlPathToUrlTemplateMatcherTests { private readonly ITemplateVariableNameAndValueFinder _finder; diff --git a/test/Ocelot.UnitTests/Middleware/DownstreamUrlCreatorMiddlewareTests.cs b/test/Ocelot.UnitTests/DownstreamUrlCreator/DownstreamUrlCreatorMiddlewareTests.cs similarity index 83% rename from test/Ocelot.UnitTests/Middleware/DownstreamUrlCreatorMiddlewareTests.cs rename to test/Ocelot.UnitTests/DownstreamUrlCreator/DownstreamUrlCreatorMiddlewareTests.cs index 56c0493c..5ba07e06 100644 --- a/test/Ocelot.UnitTests/Middleware/DownstreamUrlCreatorMiddlewareTests.cs +++ b/test/Ocelot.UnitTests/DownstreamUrlCreator/DownstreamUrlCreatorMiddlewareTests.cs @@ -1,24 +1,23 @@ -using Ocelot.Library.Configuration.Builder; +using System; +using System.Collections.Generic; +using System.IO; +using System.Net.Http; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.TestHost; +using Microsoft.Extensions.DependencyInjection; +using Moq; +using Ocelot.Library.Configuration.Builder; +using Ocelot.Library.DownstreamRouteFinder; +using Ocelot.Library.DownstreamRouteFinder.UrlMatcher; +using Ocelot.Library.DownstreamUrlCreator.Middleware; +using Ocelot.Library.DownstreamUrlCreator.UrlTemplateReplacer; +using Ocelot.Library.Responses; +using Ocelot.Library.ScopedData; +using TestStack.BDDfy; +using Xunit; -namespace Ocelot.UnitTests.Middleware +namespace Ocelot.UnitTests.DownstreamUrlCreator { - using System; - using System.Collections.Generic; - using System.IO; - using System.Net.Http; - using Library.DownstreamRouteFinder; - using Library.Middleware; - using Library.Repository; - using Library.Responses; - using Library.UrlMatcher; - using Library.UrlTemplateReplacer; - using Microsoft.AspNetCore.Hosting; - using Microsoft.AspNetCore.TestHost; - using Microsoft.Extensions.DependencyInjection; - using Moq; - using TestStack.BDDfy; - using Xunit; - public class DownstreamUrlCreatorMiddlewareTests : IDisposable { private readonly Mock _downstreamUrlTemplateVariableReplacer; diff --git a/test/Ocelot.UnitTests/UrlTemplateReplacer/UpstreamUrlPathTemplateVariableReplacerTests.cs b/test/Ocelot.UnitTests/DownstreamUrlCreator/UrlTemplateReplacer/UpstreamUrlPathTemplateVariableReplacerTests.cs similarity index 95% rename from test/Ocelot.UnitTests/UrlTemplateReplacer/UpstreamUrlPathTemplateVariableReplacerTests.cs rename to test/Ocelot.UnitTests/DownstreamUrlCreator/UrlTemplateReplacer/UpstreamUrlPathTemplateVariableReplacerTests.cs index 3db2b611..c842a223 100644 --- a/test/Ocelot.UnitTests/UrlTemplateReplacer/UpstreamUrlPathTemplateVariableReplacerTests.cs +++ b/test/Ocelot.UnitTests/DownstreamUrlCreator/UrlTemplateReplacer/UpstreamUrlPathTemplateVariableReplacerTests.cs @@ -1,16 +1,15 @@ using System.Collections.Generic; using Ocelot.Library.Configuration.Builder; +using Ocelot.Library.DownstreamRouteFinder; +using Ocelot.Library.DownstreamRouteFinder.UrlMatcher; +using Ocelot.Library.DownstreamUrlCreator.UrlTemplateReplacer; +using Ocelot.Library.Responses; using Shouldly; using TestStack.BDDfy; using Xunit; -namespace Ocelot.UnitTests.UrlTemplateReplacer +namespace Ocelot.UnitTests.DownstreamUrlCreator.UrlTemplateReplacer { - using Library.DownstreamRouteFinder; - using Library.Responses; - using Library.UrlMatcher; - using Library.UrlTemplateReplacer; - public class UpstreamUrlPathTemplateVariableReplacerTests { private DownstreamRoute _downstreamRoute; diff --git a/test/Ocelot.UnitTests/RequestBuilder/AddHeadersToRequestTests.cs b/test/Ocelot.UnitTests/HeaderBuilder/AddHeadersToRequestTests.cs similarity index 97% rename from test/Ocelot.UnitTests/RequestBuilder/AddHeadersToRequestTests.cs rename to test/Ocelot.UnitTests/HeaderBuilder/AddHeadersToRequestTests.cs index 91359d28..2e277823 100644 --- a/test/Ocelot.UnitTests/RequestBuilder/AddHeadersToRequestTests.cs +++ b/test/Ocelot.UnitTests/HeaderBuilder/AddHeadersToRequestTests.cs @@ -6,13 +6,14 @@ using Microsoft.Extensions.Primitives; using Moq; using Ocelot.Library.Configuration; using Ocelot.Library.Errors; -using Ocelot.Library.RequestBuilder; +using Ocelot.Library.HeaderBuilder; +using Ocelot.Library.HeaderBuilder.Parser; using Ocelot.Library.Responses; using Shouldly; using TestStack.BDDfy; using Xunit; -namespace Ocelot.UnitTests.RequestBuilder +namespace Ocelot.UnitTests.HeaderBuilder { public class AddHeadersToRequestTests { diff --git a/test/Ocelot.UnitTests/RequestBuilder/ClaimParserTests.cs b/test/Ocelot.UnitTests/HeaderBuilder/ClaimParserTests.cs similarity index 96% rename from test/Ocelot.UnitTests/RequestBuilder/ClaimParserTests.cs rename to test/Ocelot.UnitTests/HeaderBuilder/ClaimParserTests.cs index 5daa7d6d..7be9226b 100644 --- a/test/Ocelot.UnitTests/RequestBuilder/ClaimParserTests.cs +++ b/test/Ocelot.UnitTests/HeaderBuilder/ClaimParserTests.cs @@ -1,13 +1,13 @@ using System.Collections.Generic; using System.Security.Claims; using Ocelot.Library.Errors; -using Ocelot.Library.RequestBuilder; +using Ocelot.Library.HeaderBuilder.Parser; using Ocelot.Library.Responses; using Shouldly; using TestStack.BDDfy; using Xunit; -namespace Ocelot.UnitTests.RequestBuilder +namespace Ocelot.UnitTests.HeaderBuilder { public class ClaimParserTests { @@ -21,7 +21,7 @@ namespace Ocelot.UnitTests.RequestBuilder public ClaimParserTests() { _claims = new List(); - _claimsParser = new Library.RequestBuilder.ClaimsParser(); + _claimsParser = new ClaimsParser(); } [Fact] diff --git a/test/Ocelot.UnitTests/Middleware/HttpRequestHeadersBuilderMiddlewareTests.cs b/test/Ocelot.UnitTests/HeaderBuilder/HttpRequestHeadersBuilderMiddlewareTests.cs similarity index 94% rename from test/Ocelot.UnitTests/Middleware/HttpRequestHeadersBuilderMiddlewareTests.cs rename to test/Ocelot.UnitTests/HeaderBuilder/HttpRequestHeadersBuilderMiddlewareTests.cs index ec0104cd..d7ab00b6 100644 --- a/test/Ocelot.UnitTests/Middleware/HttpRequestHeadersBuilderMiddlewareTests.cs +++ b/test/Ocelot.UnitTests/HeaderBuilder/HttpRequestHeadersBuilderMiddlewareTests.cs @@ -10,15 +10,15 @@ using Moq; using Ocelot.Library.Configuration; using Ocelot.Library.Configuration.Builder; using Ocelot.Library.DownstreamRouteFinder; -using Ocelot.Library.Middleware; -using Ocelot.Library.Repository; -using Ocelot.Library.RequestBuilder; +using Ocelot.Library.DownstreamRouteFinder.UrlMatcher; +using Ocelot.Library.HeaderBuilder; +using Ocelot.Library.HeaderBuilder.Middleware; using Ocelot.Library.Responses; -using Ocelot.Library.UrlMatcher; +using Ocelot.Library.ScopedData; using TestStack.BDDfy; using Xunit; -namespace Ocelot.UnitTests.Middleware +namespace Ocelot.UnitTests.HeaderBuilder { public class HttpRequestHeadersBuilderMiddlewareTests : IDisposable { diff --git a/test/Ocelot.UnitTests/Repository/ScopedRequestDataRepositoryTests.cs b/test/Ocelot.UnitTests/Repository/ScopedRequestDataRepositoryTests.cs index 9e688a30..53e573ad 100644 --- a/test/Ocelot.UnitTests/Repository/ScopedRequestDataRepositoryTests.cs +++ b/test/Ocelot.UnitTests/Repository/ScopedRequestDataRepositoryTests.cs @@ -1,11 +1,11 @@ using Microsoft.AspNetCore.Http; +using Ocelot.Library.ScopedData; using Shouldly; using TestStack.BDDfy; using Xunit; namespace Ocelot.UnitTests.Repository { - using Library.Repository; using Library.Responses; public class ScopedRequestDataRepositoryTests diff --git a/test/Ocelot.UnitTests/Middleware/HttpRequestBuilderMiddlewareTests.cs b/test/Ocelot.UnitTests/RequestBuilder/HttpRequestBuilderMiddlewareTests.cs similarity index 93% rename from test/Ocelot.UnitTests/Middleware/HttpRequestBuilderMiddlewareTests.cs rename to test/Ocelot.UnitTests/RequestBuilder/HttpRequestBuilderMiddlewareTests.cs index 9704fc6b..03a3d9a1 100644 --- a/test/Ocelot.UnitTests/Middleware/HttpRequestBuilderMiddlewareTests.cs +++ b/test/Ocelot.UnitTests/RequestBuilder/HttpRequestBuilderMiddlewareTests.cs @@ -7,16 +7,16 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.TestHost; using Microsoft.Extensions.DependencyInjection; using Moq; +using Ocelot.Library.RequestBuilder; +using Ocelot.Library.RequestBuilder.Builder; +using Ocelot.Library.RequestBuilder.Middleware; +using Ocelot.Library.Responses; +using Ocelot.Library.ScopedData; using TestStack.BDDfy; using Xunit; -namespace Ocelot.UnitTests.Middleware +namespace Ocelot.UnitTests.RequestBuilder { - using Library.Middleware; - using Library.Repository; - using Library.RequestBuilder; - using Library.Responses; - public class HttpRequestBuilderMiddlewareTests : IDisposable { private readonly Mock _requestBuilder; diff --git a/test/Ocelot.UnitTests/RequestBuilder/RequestBuilderTests.cs b/test/Ocelot.UnitTests/RequestBuilder/RequestBuilderTests.cs index 80740e97..224f9624 100644 --- a/test/Ocelot.UnitTests/RequestBuilder/RequestBuilderTests.cs +++ b/test/Ocelot.UnitTests/RequestBuilder/RequestBuilderTests.cs @@ -5,6 +5,7 @@ using System.Net; using System.Net.Http; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Internal; +using Ocelot.Library.RequestBuilder.Builder; using Shouldly; using TestStack.BDDfy; using Xunit; diff --git a/test/Ocelot.UnitTests/Middleware/HttpRequesterMiddlewareTests.cs b/test/Ocelot.UnitTests/Requester/HttpRequesterMiddlewareTests.cs similarity index 93% rename from test/Ocelot.UnitTests/Middleware/HttpRequesterMiddlewareTests.cs rename to test/Ocelot.UnitTests/Requester/HttpRequesterMiddlewareTests.cs index 99cf1691..2c7bdb8b 100644 --- a/test/Ocelot.UnitTests/Middleware/HttpRequesterMiddlewareTests.cs +++ b/test/Ocelot.UnitTests/Requester/HttpRequesterMiddlewareTests.cs @@ -6,17 +6,16 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.TestHost; using Microsoft.Extensions.DependencyInjection; using Moq; +using Ocelot.Library.RequestBuilder; +using Ocelot.Library.Requester; +using Ocelot.Library.Requester.Middleware; +using Ocelot.Library.Responses; +using Ocelot.Library.ScopedData; using TestStack.BDDfy; using Xunit; -namespace Ocelot.UnitTests.Middleware +namespace Ocelot.UnitTests.Requester { - using Library.Middleware; - using Library.Repository; - using Library.RequestBuilder; - using Library.Requester; - using Library.Responses; - public class HttpRequesterMiddlewareTests : IDisposable { private readonly Mock _requester; diff --git a/test/Ocelot.UnitTests/Middleware/HttpResponderMiddlewareTests.cs b/test/Ocelot.UnitTests/Responder/HttpResponderMiddlewareTests.cs similarity index 94% rename from test/Ocelot.UnitTests/Middleware/HttpResponderMiddlewareTests.cs rename to test/Ocelot.UnitTests/Responder/HttpResponderMiddlewareTests.cs index f4648700..b8c3c5eb 100644 --- a/test/Ocelot.UnitTests/Middleware/HttpResponderMiddlewareTests.cs +++ b/test/Ocelot.UnitTests/Responder/HttpResponderMiddlewareTests.cs @@ -6,16 +6,15 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.TestHost; using Microsoft.Extensions.DependencyInjection; using Moq; +using Ocelot.Library.Responder; +using Ocelot.Library.Responder.Middleware; +using Ocelot.Library.Responses; +using Ocelot.Library.ScopedData; using TestStack.BDDfy; using Xunit; -namespace Ocelot.UnitTests.Middleware +namespace Ocelot.UnitTests.Responder { - using Library.Middleware; - using Library.Repository; - using Library.Responder; - using Library.Responses; - public class HttpResponderMiddlewareTests : IDisposable { private readonly Mock _responder;