diff --git a/.gitignore b/.gitignore index 836e0bfe..476938f0 100644 --- a/.gitignore +++ b/.gitignore @@ -243,7 +243,7 @@ tools/ .DS_Store # Ocelot acceptance test config -test/Ocelot.AcceptanceTests/configuration.json +test/Ocelot.AcceptanceTests/ocelot.json # Read the docstates _build/ @@ -251,4 +251,4 @@ _static/ _templates/ # JetBrains Rider -.idea/ \ No newline at end of file +.idea/ diff --git a/docs/features/configuration.rst b/docs/features/configuration.rst index 8a1e61a1..6bc05f66 100644 --- a/docs/features/configuration.rst +++ b/docs/features/configuration.rst @@ -1,7 +1,7 @@ Configuration ============ -An example configuration can be found `here `_. +An example configuration can be found `here `_. There are two sections to the configuration. An array of ReRoutes and a GlobalConfiguration. The ReRoutes are the objects that tell Ocelot how to treat an upstream request. The Global configuration is a bit hacky and allows overrides of ReRoute specific settings. It's useful @@ -99,12 +99,12 @@ to you .SetBasePath(hostingContext.HostingEnvironment.ContentRootPath) .AddJsonFile("appsettings.json", true, true) .AddJsonFile($"appsettings.{hostingContext.HostingEnvironment.EnvironmentName}.json", true, true) - .AddJsonFile("configuration.json") + .AddJsonFile("ocelot.json") .AddJsonFile($"configuration.{hostingContext.HostingEnvironment.EnvironmentName}.json") .AddEnvironmentVariables(); }) -Ocelot should now use the environment specific configuration and fall back to configuration.json if there isnt one. +Ocelot should now use the environment specific configuration and fall back to ocelot.json if there isnt one. You also need to set the corresponding environment variable which is ASPNETCORE_ENVIRONMENT. More info on this can be found in the `asp.net core docs `_. @@ -119,7 +119,7 @@ If you add the following when you register your services Ocelot will attempt to .AddOcelot() .AddStoreOcelotConfigurationInConsul(); -You also need to add the following to your configuration.json. This is how Ocelot +You also need to add the following to your ocelot.json. This is how Ocelot finds your Consul agent and interacts to load and store the configuration from Consul. .. code-block:: json diff --git a/docs/features/delegatinghandlers.rst b/docs/features/delegatinghandlers.rst index 80dfa16b..445a46fb 100644 --- a/docs/features/delegatinghandlers.rst +++ b/docs/features/delegatinghandlers.rst @@ -40,7 +40,7 @@ Or transient as below... .AddTransientDelegatingHandler() Both of these Add methods have a default parameter called global which is set to false. If it is false then the intent of -the DelegatingHandler is to be applied to specific ReRoutes via configuration.json (more on that later). If it is set to true +the DelegatingHandler is to be applied to specific ReRoutes via ocelot.json (more on that later). If it is set to true then it becomes a global handler and will be applied to all ReRoutes. e.g. @@ -58,7 +58,7 @@ Or transient as below... .AddTransientDelegatingHandler(true) Finally if you want ReRoute specific DelegatingHandlers or to order your specific and / or global (more on this later) DelegatingHandlers -then you must add the following json to the specific ReRoute in configuration.json. The names in the array must match the class names of your +then you must add the following json to the specific ReRoute in ocelot.json. The names in the array must match the class names of your DelegatingHandlers for Ocelot to match them together. .. code-block:: json @@ -70,8 +70,8 @@ DelegatingHandlers for Ocelot to match them together. You can have as many DelegatingHandlers as you want and they are run in the following order: -1. Any globals that are left in the order they were added to services and are not in the DelegatingHandlers array from configuration.json. -2. Any non global DelegatingHandlers plus any globals that were in the DelegatingHandlers array from configuration.json ordered as they are in the DelegatingHandlers array. +1. Any globals that are left in the order they were added to services and are not in the DelegatingHandlers array from ocelot.json. +2. Any non global DelegatingHandlers plus any globals that were in the DelegatingHandlers array from ocelot.json ordered as they are in the DelegatingHandlers array. 3. Tracing DelegatingHandler if enabled (see tracing docs). 4. QoS DelegatingHandler if enabled (see QoS docs). 5. The HttpClient sends the HttpRequestMessage. diff --git a/docs/features/headerstransformation.rst b/docs/features/headerstransformation.rst index 6a333141..06ece33a 100644 --- a/docs/features/headerstransformation.rst +++ b/docs/features/headerstransformation.rst @@ -9,7 +9,7 @@ Add to Response This feature was requested in `GitHub #280 `_. I have only implemented for responses but could add for requests in the future. -If you want to add a header to your downstream response please add the following to a ReRoute in configuration.json.. +If you want to add a header to your downstream response please add the following to a ReRoute in ocelot.json.. .. code-block:: json @@ -41,7 +41,7 @@ The key is "Test" and the value is "http://www.bbc.co.uk/, http://ocelot.com/". Pre Downstream Request ^^^^^^^^^^^^^^^^^^^^^^ -Add the following to a ReRoute in configuration.json in order to replace http://www.bbc.co.uk/ with http://ocelot.com/. This header will be changed before the request downstream and will be sent to the downstream server. +Add the following to a ReRoute in ocelot.json in order to replace http://www.bbc.co.uk/ with http://ocelot.com/. This header will be changed before the request downstream and will be sent to the downstream server. .. code-block:: json @@ -52,7 +52,7 @@ Add the following to a ReRoute in configuration.json in order to replace http:// Post Downstream Request ^^^^^^^^^^^^^^^^^^^^^^ -Add the following to a ReRoute in configuration.json in order to replace http://www.bbc.co.uk/ with http://ocelot.com/. This transformation will take place after Ocelot has received the response from the downstream service. +Add the following to a ReRoute in ocelot.json in order to replace http://www.bbc.co.uk/ with http://ocelot.com/. This transformation will take place after Ocelot has received the response from the downstream service. .. code-block:: json diff --git a/docs/features/loadbalancer.rst b/docs/features/loadbalancer.rst index f587aa22..c2cc0f26 100644 --- a/docs/features/loadbalancer.rst +++ b/docs/features/loadbalancer.rst @@ -16,7 +16,7 @@ You must choose in your configuration which load balancer to use. Configuration ^^^^^^^^^^^^^ -The following shows how to set up multiple downstream services for a ReRoute using configuration.json and then select the LeadConnection load balancer. This is the simplest way to get load balancing set up. +The following shows how to set up multiple downstream services for a ReRoute using ocelot.json and then select the LeadConnection load balancer. This is the simplest way to get load balancing set up. .. code-block:: json diff --git a/docs/features/ratelimiting.rst b/docs/features/ratelimiting.rst index d929c905..7f9c0768 100644 --- a/docs/features/ratelimiting.rst +++ b/docs/features/ratelimiting.rst @@ -23,7 +23,7 @@ Period - This value specifies the period, such as 1s, 5m, 1h,1d and so on. PeriodTimespan - This value specifies that we can retry after a certain number of seconds. Limit - This value specifies the maximum number of requests that a client can make in a defined period. -You can also set the following in the GlobalConfiguration part of configuration.json +You can also set the following in the GlobalConfiguration part of ocelot.json .. code-block:: json diff --git a/docs/features/requestaggregation.rst b/docs/features/requestaggregation.rst index c3c7ad13..a5ca30f6 100644 --- a/docs/features/requestaggregation.rst +++ b/docs/features/requestaggregation.rst @@ -7,7 +7,7 @@ architecture with Ocelot. This feature was requested as part of `Issue 79 `_ and further improvements were made as part of `Issue 298 `_. -In order to set this up you must do something like the following in your configuration.json. Here we have specified two normal ReRoutes and each one has a Key property. +In order to set this up you must do something like the following in your ocelot.json. Here we have specified two normal ReRoutes and each one has a Key property. We then specify an Aggregate that composes the two ReRoutes using their keys in the ReRouteKeys list and says then we have the UpstreamPathTemplate which works like a normal ReRoute. Obviously you cannot have duplicate UpstreamPathTemplates between ReRoutes and Aggregates. You can use all of Ocelot's normal ReRoute options apart from RequestIdKey (explained in gotchas below). @@ -17,7 +17,7 @@ Advanced register your own Aggregators Ocelot started with just the basic request aggregation and since then we have added a more advanced method that let's the user take in the responses from the downstream services and then aggregate them into a response object. -The configuration.json setup is pretty much the same as the basic aggregation approach apart from you need to add an Aggregator property like below. +The ocelot.json setup is pretty much the same as the basic aggregation approach apart from you need to add an Aggregator property like below. .. code-block:: json diff --git a/docs/features/requestid.rst b/docs/features/requestid.rst index 6e4f239b..37752eda 100644 --- a/docs/features/requestid.rst +++ b/docs/features/requestid.rst @@ -12,7 +12,7 @@ In order to use the reques tid feature you have two options. *Global* -In your configuration.json set the following in the GlobalConfiguration section. This will be used for all requests into Ocelot. +In your ocelot.json set the following in the GlobalConfiguration section. This will be used for all requests into Ocelot. .. code-block:: json @@ -24,7 +24,7 @@ I reccomend using the GlobalConfiguration unless you really need it to be ReRout *ReRoute* -If you want to override this for a specific ReRoute add the following to configuration.json for the specific ReRoute. +If you want to override this for a specific ReRoute add the following to ocelot.json for the specific ReRoute. .. code-block:: json diff --git a/docs/features/routing.rst b/docs/features/routing.rst index b414d6c5..664021a6 100644 --- a/docs/features/routing.rst +++ b/docs/features/routing.rst @@ -145,9 +145,9 @@ Priority ^^^^^^^^ In `Issue 270 `_ I finally decided to expose the ReRoute priority in -configuration.json. This means you can decide in what order you want your ReRoutes to match the Upstream HttpRequest. +ocelot.json. This means you can decide in what order you want your ReRoutes to match the Upstream HttpRequest. -In order to get this working add the following to a ReRoute in configuration.json, 0 is just an example value here but will explain below. +In order to get this working add the following to a ReRoute in ocelot.json, 0 is just an example value here but will explain below. .. code-block:: json diff --git a/docs/features/tracing.rst b/docs/features/tracing.rst index 0a896d45..aa4b1fd3 100644 --- a/docs/features/tracing.rst +++ b/docs/features/tracing.rst @@ -20,7 +20,7 @@ In your ConfigureServices method option.Service = "Ocelot"; }); -Then in your configuration.json add the following to the ReRoute you want to trace.. +Then in your ocelot.json add the following to the ReRoute you want to trace.. .. code-block:: json diff --git a/docs/features/websockets.rst b/docs/features/websockets.rst index 828d1051..624f42a9 100644 --- a/docs/features/websockets.rst +++ b/docs/features/websockets.rst @@ -15,7 +15,7 @@ In your Configure method you need to tell your application to use WebSockets. app.UseOcelot().Wait(); }) -Then in your configuration.json add the following to proxy a ReRoute using websockets. +Then in your ocelot.json add the following to proxy a ReRoute using websockets. .. code-block:: json diff --git a/docs/introduction/gettingstarted.rst b/docs/introduction/gettingstarted.rst index 7f81cb51..0c11f40d 100644 --- a/docs/introduction/gettingstarted.rst +++ b/docs/introduction/gettingstarted.rst @@ -18,7 +18,7 @@ All versions can be found `here `_. **Configuration** -The following is a very basic configuration.json. It won't do anything but should get Ocelot starting. +The following is a very basic ocelot.json. It won't do anything but should get Ocelot starting. .. code-block:: json @@ -55,7 +55,7 @@ AddOcelot() (adds ocelot services), UseOcelot().Wait() (sets up all the Ocelot m .SetBasePath(hostingContext.HostingEnvironment.ContentRootPath) .AddJsonFile("appsettings.json", true, true) .AddJsonFile($"appsettings.{hostingContext.HostingEnvironment.EnvironmentName}.json", true, true) - .AddJsonFile("configuration.json") + .AddJsonFile("ocelot.json") .AddEnvironmentVariables(); }) .ConfigureServices(s => { @@ -87,7 +87,7 @@ All versions can be found `here `_. **Configuration** -The following is a very basic configuration.json. It won't do anything but should get Ocelot starting. +The following is a very basic ocelot.json. It won't do anything but should get Ocelot starting. .. code-block:: json @@ -135,7 +135,7 @@ An example startup using a json file for configuration can be seen below. .SetBasePath(env.ContentRootPath) .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true) - .AddJsonFile("configuration.json") + .AddJsonFile("ocelot.json") .AddEnvironmentVariables(); Configuration = builder.Build(); diff --git a/docs/introduction/notsupported.rst b/docs/introduction/notsupported.rst index 37e5b5eb..e578bca2 100644 --- a/docs/introduction/notsupported.rst +++ b/docs/introduction/notsupported.rst @@ -7,7 +7,7 @@ Ocelot does not support... * Fowarding a host header - The host header that you send to Ocelot will not be forwarded to the downstream service. Obviously this would break everything :( -* Swagger - I have looked multiple times at building swagger.json out of the Ocelot configuration.json but it doesnt fit into the vision +* Swagger - I have looked multiple times at building swagger.json out of the Ocelot ocelot.json but it doesnt fit into the vision I have for Ocelot. If you would like to have Swagger in Ocelot then you must roll your own swagger.json and do the following in your Startup.cs or Program.cs. The code sample below registers a piece of middleware that loads your hand rolled swagger.json and returns it on /swagger/v1/swagger.json. It then registers the SwaggerUI middleware from Swashbuckle.AspNetCore @@ -28,8 +28,8 @@ it on /swagger/v1/swagger.json. It then registers the SwaggerUI middleware from app.UseOcelot().Wait(); -The main reasons why I don't think Swagger makes sense is we already hand roll our definition in configuration.json. -If we want people developing against Ocelot to be able to see what routes are available then either share the configuration.json +The main reasons why I don't think Swagger makes sense is we already hand roll our definition in ocelot.json. +If we want people developing against Ocelot to be able to see what routes are available then either share the ocelot.json with them (This should be as easy as granting access to a repo etc) or use the Ocelot administration API so that they can query Ocelot for the configuration. In addition to this many people will configure Ocelot to proxy all traffic like /products/{everything} to there product service @@ -40,4 +40,4 @@ package doesnt reload swagger.json if it changes during runtime. Ocelot's config information would not match. Unless I rolled my own Swagger implementation. If the user wants something to easily test against the Ocelot API then I suggest using Postman as a simple way to do this. It might -even be possible to write something that maps configuration.json to the postman json spec. However I don't intend to do this. \ No newline at end of file +even be possible to write something that maps ocelot.json to the postman json spec. However I don't intend to do this. \ No newline at end of file diff --git a/samples/OcelotGraphQL/OcelotGraphQL.csproj b/samples/OcelotGraphQL/OcelotGraphQL.csproj index 2f29e395..ec015d1b 100644 --- a/samples/OcelotGraphQL/OcelotGraphQL.csproj +++ b/samples/OcelotGraphQL/OcelotGraphQL.csproj @@ -3,7 +3,7 @@ netcoreapp2.0 - + PreserveNewest diff --git a/samples/OcelotGraphQL/Program.cs b/samples/OcelotGraphQL/Program.cs index 94e1295b..81938f9c 100644 --- a/samples/OcelotGraphQL/Program.cs +++ b/samples/OcelotGraphQL/Program.cs @@ -106,7 +106,7 @@ namespace OcelotGraphQL .SetBasePath(hostingContext.HostingEnvironment.ContentRootPath) .AddJsonFile("appsettings.json", true, true) .AddJsonFile($"appsettings.{hostingContext.HostingEnvironment.EnvironmentName}.json", true, true) - .AddJsonFile("configuration.json") + .AddJsonFile("ocelot.json") .AddEnvironmentVariables(); }) .ConfigureServices(s => { diff --git a/samples/OcelotGraphQL/README.md b/samples/OcelotGraphQL/README.md index 06ec668a..b2101d56 100644 --- a/samples/OcelotGraphQL/README.md +++ b/samples/OcelotGraphQL/README.md @@ -47,7 +47,7 @@ RESPONSE ## Notes -Please note this project never goes out to another service, it just gets the data for GraphQL in memory. You would need to add the details of your GraphQL server in configuration.json e.g. +Please note this project never goes out to another service, it just gets the data for GraphQL in memory. You would need to add the details of your GraphQL server in ocelot.json e.g. ```json { diff --git a/samples/OcelotGraphQL/configuration.json b/samples/OcelotGraphQL/ocelot.json similarity index 100% rename from samples/OcelotGraphQL/configuration.json rename to samples/OcelotGraphQL/ocelot.json diff --git a/samples/OcelotServiceFabric/.gitignore b/samples/OcelotServiceFabric/.gitignore index 733dbb07..84aa4b08 100644 --- a/samples/OcelotServiceFabric/.gitignore +++ b/samples/OcelotServiceFabric/.gitignore @@ -13,7 +13,7 @@ # Service fabric OcelotApplicationApiGatewayPkg/Code OcelotApplication/OcelotApplicationApiGatewayPkg/Code/appsettings.json -OcelotApplication/OcelotApplicationApiGatewayPkg/Code/configuration.json +OcelotApplication/OcelotApplicationApiGatewayPkg/Code/ocelot.json OcelotApplication/OcelotApplicationApiGatewayPkg/Code/runtimes/ OcelotApplicationServicePkg/Code OcelotApplication/OcelotApplicationApiGatewayPkg/Code/web.config diff --git a/samples/OcelotServiceFabric/src/OcelotApplicationApiGateway/OcelotApplicationApiGateway.csproj b/samples/OcelotServiceFabric/src/OcelotApplicationApiGateway/OcelotApplicationApiGateway.csproj index 1ff69c09..08324cbe 100644 --- a/samples/OcelotServiceFabric/src/OcelotApplicationApiGateway/OcelotApplicationApiGateway.csproj +++ b/samples/OcelotServiceFabric/src/OcelotApplicationApiGateway/OcelotApplicationApiGateway.csproj @@ -8,7 +8,7 @@ OcelotApplicationApiGateway - + PreserveNewest diff --git a/samples/OcelotServiceFabric/src/OcelotApplicationApiGateway/WebCommunicationListener.cs b/samples/OcelotServiceFabric/src/OcelotApplicationApiGateway/WebCommunicationListener.cs index 6685e11f..7d913cfa 100644 --- a/samples/OcelotServiceFabric/src/OcelotApplicationApiGateway/WebCommunicationListener.cs +++ b/samples/OcelotServiceFabric/src/OcelotApplicationApiGateway/WebCommunicationListener.cs @@ -67,7 +67,7 @@ namespace OcelotApplicationApiGateway .SetBasePath(hostingContext.HostingEnvironment.ContentRootPath) .AddJsonFile("appsettings.json", true, true) .AddJsonFile($"appsettings.{hostingContext.HostingEnvironment.EnvironmentName}.json", true, true) - .AddJsonFile("configuration.json") + .AddJsonFile("ocelot.json") .AddEnvironmentVariables(); }) .ConfigureLogging((hostingContext, logging) => diff --git a/samples/OcelotServiceFabric/src/OcelotApplicationApiGateway/configuration.json b/samples/OcelotServiceFabric/src/OcelotApplicationApiGateway/ocelot.json similarity index 100% rename from samples/OcelotServiceFabric/src/OcelotApplicationApiGateway/configuration.json rename to samples/OcelotServiceFabric/src/OcelotApplicationApiGateway/ocelot.json diff --git a/src/Ocelot/Configuration/Provider/FileConfigurationProvider.cs b/src/Ocelot/Configuration/Provider/FileConfigurationProvider.cs index fdcd949b..2d4cad8b 100644 --- a/src/Ocelot/Configuration/Provider/FileConfigurationProvider.cs +++ b/src/Ocelot/Configuration/Provider/FileConfigurationProvider.cs @@ -1,7 +1,4 @@ -using System; -using System.IO; using System.Threading.Tasks; -using Newtonsoft.Json; using Ocelot.Configuration.File; using Ocelot.Configuration.Repository; using Ocelot.Responses; @@ -10,7 +7,7 @@ namespace Ocelot.Configuration.Provider { public class FileConfigurationProvider : IFileConfigurationProvider { - private IFileConfigurationRepository _repo; + private readonly IFileConfigurationRepository _repo; public FileConfigurationProvider(IFileConfigurationRepository repo) { @@ -23,4 +20,4 @@ namespace Ocelot.Configuration.Provider return new OkResponse(fileConfig.Data); } } -} \ No newline at end of file +} diff --git a/src/Ocelot/Configuration/Repository/FileConfigurationRepository.cs b/src/Ocelot/Configuration/Repository/FileConfigurationRepository.cs index ff5e3876..9619984f 100644 --- a/src/Ocelot/Configuration/Repository/FileConfigurationRepository.cs +++ b/src/Ocelot/Configuration/Repository/FileConfigurationRepository.cs @@ -12,10 +12,12 @@ namespace Ocelot.Configuration.Repository private readonly string _configFilePath; private static readonly object _lock = new object(); - + + private const string ConfigurationFileName = "ocelot"; + public FileConfigurationRepository(IHostingEnvironment hostingEnvironment) { - _configFilePath = $"{AppContext.BaseDirectory}/configuration{(string.IsNullOrEmpty(hostingEnvironment.EnvironmentName) ? string.Empty : ".")}{hostingEnvironment.EnvironmentName}.json"; + _configFilePath = $"{AppContext.BaseDirectory}/{ConfigurationFileName}{(string.IsNullOrEmpty(hostingEnvironment.EnvironmentName) ? string.Empty : ".")}{hostingEnvironment.EnvironmentName}.json"; } public Task> Get() diff --git a/src/Ocelot/DependencyInjection/ConfigurationBuilderExtensions.cs b/src/Ocelot/DependencyInjection/ConfigurationBuilderExtensions.cs index 56360ad5..c5c5ee4d 100644 --- a/src/Ocelot/DependencyInjection/ConfigurationBuilderExtensions.cs +++ b/src/Ocelot/DependencyInjection/ConfigurationBuilderExtensions.cs @@ -7,7 +7,7 @@ namespace Ocelot.DependencyInjection { public static class ConfigurationBuilderExtensions { - [Obsolete("Please set BaseUrl in configuration.json GlobalConfiguration.BaseUrl")] + [Obsolete("Please set BaseUrl in ocelot.json GlobalConfiguration.BaseUrl")] public static IConfigurationBuilder AddOcelotBaseUrl(this IConfigurationBuilder builder, string baseUrl) { var memorySource = new MemoryConfigurationSource(); diff --git a/test/Ocelot.AcceptanceTests/CustomMiddlewareTests.cs b/test/Ocelot.AcceptanceTests/CustomMiddlewareTests.cs index 341986fe..422348d0 100644 --- a/test/Ocelot.AcceptanceTests/CustomMiddlewareTests.cs +++ b/test/Ocelot.AcceptanceTests/CustomMiddlewareTests.cs @@ -26,7 +26,7 @@ namespace Ocelot.AcceptanceTests { _counter = 0; _steps = new Steps(); - _configurationPath = "configuration.json"; + _configurationPath = "ocelot.json"; } [Fact] diff --git a/test/Ocelot.AcceptanceTests/Ocelot.AcceptanceTests.csproj b/test/Ocelot.AcceptanceTests/Ocelot.AcceptanceTests.csproj index 4f67b970..e1e16688 100644 --- a/test/Ocelot.AcceptanceTests/Ocelot.AcceptanceTests.csproj +++ b/test/Ocelot.AcceptanceTests/Ocelot.AcceptanceTests.csproj @@ -15,7 +15,7 @@ - + PreserveNewest diff --git a/test/Ocelot.AcceptanceTests/Steps.cs b/test/Ocelot.AcceptanceTests/Steps.cs index ba0da5d1..f5c186ca 100644 --- a/test/Ocelot.AcceptanceTests/Steps.cs +++ b/test/Ocelot.AcceptanceTests/Steps.cs @@ -66,7 +66,7 @@ namespace Ocelot.AcceptanceTests var env = hostingContext.HostingEnvironment; config.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true); - config.AddJsonFile("configuration.json"); + config.AddJsonFile("ocelot.json"); config.AddEnvironmentVariables(); }) .ConfigureLogging((hostingContext, logging) => @@ -124,7 +124,7 @@ namespace Ocelot.AcceptanceTests var env = hostingContext.HostingEnvironment; config.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true); - config.AddJsonFile("configuration.json"); + config.AddJsonFile("ocelot.json"); config.AddEnvironmentVariables(); }) .ConfigureServices(s => @@ -152,7 +152,7 @@ namespace Ocelot.AcceptanceTests var env = hostingContext.HostingEnvironment; config.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true); - config.AddJsonFile("configuration.json"); + config.AddJsonFile("ocelot.json"); config.AddEnvironmentVariables(); }) .ConfigureServices(s => @@ -190,7 +190,7 @@ namespace Ocelot.AcceptanceTests var env = hostingContext.HostingEnvironment; config.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true); - config.AddJsonFile("configuration.json"); + config.AddJsonFile("ocelot.json"); config.AddEnvironmentVariables(); }) .ConfigureServices(s => @@ -221,7 +221,7 @@ namespace Ocelot.AcceptanceTests var env = hostingContext.HostingEnvironment; config.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true); - config.AddJsonFile("configuration.json"); + config.AddJsonFile("ocelot.json"); config.AddEnvironmentVariables(); }) .ConfigureServices(s => @@ -254,7 +254,7 @@ namespace Ocelot.AcceptanceTests var env = hostingContext.HostingEnvironment; config.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true); - config.AddJsonFile("configuration.json"); + config.AddJsonFile("ocelot.json"); config.AddEnvironmentVariables(); }) .ConfigureServices(s => @@ -287,7 +287,7 @@ namespace Ocelot.AcceptanceTests var env = hostingContext.HostingEnvironment; config.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true); - config.AddJsonFile("configuration.json"); + config.AddJsonFile("ocelot.json"); config.AddEnvironmentVariables(); }) .ConfigureServices(s => @@ -319,7 +319,7 @@ namespace Ocelot.AcceptanceTests var env = hostingContext.HostingEnvironment; config.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true); - config.AddJsonFile("configuration.json"); + config.AddJsonFile("ocelot.json"); config.AddEnvironmentVariables(); }) .ConfigureServices(s => @@ -358,7 +358,7 @@ namespace Ocelot.AcceptanceTests var env = hostingContext.HostingEnvironment; config.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true); - config.AddJsonFile("configuration.json"); + config.AddJsonFile("ocelot.json"); config.AddEnvironmentVariables(); }) .ConfigureServices(s => @@ -400,7 +400,7 @@ namespace Ocelot.AcceptanceTests var env = hostingContext.HostingEnvironment; config.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true); - config.AddJsonFile("configuration.json"); + config.AddJsonFile("ocelot.json"); config.AddEnvironmentVariables(); }) .ConfigureServices(s => @@ -437,7 +437,7 @@ namespace Ocelot.AcceptanceTests var env = hostingContext.HostingEnvironment; config.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true); - config.AddJsonFile("configuration.json"); + config.AddJsonFile("ocelot.json"); config.AddEnvironmentVariables(); }) .ConfigureServices(s => @@ -465,7 +465,7 @@ namespace Ocelot.AcceptanceTests var env = hostingContext.HostingEnvironment; config.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true); - config.AddJsonFile("configuration.json"); + config.AddJsonFile("ocelot.json"); config.AddEnvironmentVariables(); }) .ConfigureServices(s => @@ -525,7 +525,7 @@ namespace Ocelot.AcceptanceTests var builder = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) - .AddJsonFile("configuration.json") + .AddJsonFile("ocelot.json") .AddEnvironmentVariables(); var configuration = builder.Build(); diff --git a/test/Ocelot.AcceptanceTests/TestConfiguration.cs b/test/Ocelot.AcceptanceTests/TestConfiguration.cs index 5f29d1bd..6f5818ca 100644 --- a/test/Ocelot.AcceptanceTests/TestConfiguration.cs +++ b/test/Ocelot.AcceptanceTests/TestConfiguration.cs @@ -5,6 +5,6 @@ namespace Ocelot.AcceptanceTests { public static class TestConfiguration { - public static string ConfigurationPath => Path.Combine(AppContext.BaseDirectory, "configuration.json"); + public static string ConfigurationPath => Path.Combine(AppContext.BaseDirectory, "ocelot.json"); } } diff --git a/test/Ocelot.AcceptanceTests/configuration.json b/test/Ocelot.AcceptanceTests/configuration.json deleted file mode 100755 index 027025b0..00000000 --- a/test/Ocelot.AcceptanceTests/configuration.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "ReRoutes": [ - { - "DownstreamPathTemplate": "41879/", - "UpstreamPathTemplate": "/", - "UpstreamHttpMethod": "Get", - "AuthenticationOptions": { - "Provider": null, - "ProviderRootUrl": null, - "ApiName": null, - "RequireHttps": false, - "AllowedScopes": [], - "ApiSecret": null - }, - "AddHeadersToRequest": {}, - "AddClaimsToRequest": {}, - "RouteClaimsRequirement": {}, - "AddQueriesToRequest": {}, - "RequestIdKey": null, - "FileCacheOptions": { - "TtlSeconds": 0 - }, - "ReRouteIsCaseSensitive": false, - "ServiceName": null, - "DownstreamScheme": "http", - "DownstreamHost": "localhost", - "DownstreamPort": 41879, - "QoSOptions": { - "ExceptionsAllowedBeforeBreaking": 0, - "DurationOfBreak": 0, - "TimeoutValue": 0 - }, - "LoadBalancer": null, - "RateLimitOptions": { - "ClientWhitelist": [], - "EnableRateLimiting": false, - "Period": null, - "PeriodTimespan": 0, - "Limit": 0 - } - } - ], - "GlobalConfiguration": { - "RequestIdKey": null, - "ServiceDiscoveryProvider": { - "Provider": null, - "Host": null, - "Port": 0 - }, - "AdministrationPath": null, - "RateLimitOptions": { - "ClientIdHeader": "ClientId", - "QuotaExceededMessage": null, - "RateLimitCounterPrefix": "ocelot", - "DisableRateLimitHeaders": false, - "HttpStatusCode": 429 - } - } -} \ No newline at end of file diff --git a/test/Ocelot.IntegrationTests/AdministrationTests.cs b/test/Ocelot.IntegrationTests/AdministrationTests.cs index 763d642c..84b0c0bb 100644 --- a/test/Ocelot.IntegrationTests/AdministrationTests.cs +++ b/test/Ocelot.IntegrationTests/AdministrationTests.cs @@ -461,7 +461,7 @@ namespace Ocelot.IntegrationTests var env = hostingContext.HostingEnvironment; config.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true); - config.AddJsonFile("configuration.json"); + config.AddJsonFile("ocelot.json"); config.AddEnvironmentVariables(); }) .ConfigureServices(x => @@ -579,7 +579,7 @@ namespace Ocelot.IntegrationTests var env = hostingContext.HostingEnvironment; config.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true); - config.AddJsonFile("configuration.json"); + config.AddJsonFile("ocelot.json"); config.AddEnvironmentVariables(); }) .ConfigureServices(x => { @@ -612,7 +612,7 @@ namespace Ocelot.IntegrationTests var env = hostingContext.HostingEnvironment; config.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true); - config.AddJsonFile("configuration.json"); + config.AddJsonFile("ocelot.json"); config.AddEnvironmentVariables(); }) .ConfigureServices(x => @@ -652,7 +652,7 @@ namespace Ocelot.IntegrationTests var env = hostingContext.HostingEnvironment; config.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true); - config.AddJsonFile("configuration.json"); + config.AddJsonFile("ocelot.json"); config.AddEnvironmentVariables(); }) .ConfigureServices(x => { @@ -675,7 +675,7 @@ namespace Ocelot.IntegrationTests private void GivenThereIsAConfiguration(FileConfiguration fileConfiguration) { - var configurationPath = $"{Directory.GetCurrentDirectory()}/configuration.json"; + var configurationPath = $"{Directory.GetCurrentDirectory()}/ocelot.json"; var jsonConfiguration = JsonConvert.SerializeObject(fileConfiguration); @@ -688,7 +688,7 @@ namespace Ocelot.IntegrationTests var text = File.ReadAllText(configurationPath); - configurationPath = $"{AppContext.BaseDirectory}/configuration.json"; + configurationPath = $"{AppContext.BaseDirectory}/ocelot.json"; if (File.Exists(configurationPath)) { diff --git a/test/Ocelot.IntegrationTests/Ocelot.IntegrationTests.csproj b/test/Ocelot.IntegrationTests/Ocelot.IntegrationTests.csproj index 644d217b..5fc9947b 100644 --- a/test/Ocelot.IntegrationTests/Ocelot.IntegrationTests.csproj +++ b/test/Ocelot.IntegrationTests/Ocelot.IntegrationTests.csproj @@ -14,7 +14,7 @@ ..\..\codeanalysis.ruleset - + PreserveNewest diff --git a/test/Ocelot.IntegrationTests/RaftTests.cs b/test/Ocelot.IntegrationTests/RaftTests.cs index 3dc01bb9..baad5091 100644 --- a/test/Ocelot.IntegrationTests/RaftTests.cs +++ b/test/Ocelot.IntegrationTests/RaftTests.cs @@ -301,7 +301,7 @@ namespace Ocelot.IntegrationTests private void GivenThereIsAConfiguration(FileConfiguration fileConfiguration) { - var configurationPath = $"{Directory.GetCurrentDirectory()}/configuration.json"; + var configurationPath = $"{Directory.GetCurrentDirectory()}/ocelot.json"; var jsonConfiguration = JsonConvert.SerializeObject(fileConfiguration); @@ -314,7 +314,7 @@ namespace Ocelot.IntegrationTests var text = File.ReadAllText(configurationPath); - configurationPath = $"{AppContext.BaseDirectory}/configuration.json"; + configurationPath = $"{AppContext.BaseDirectory}/ocelot.json"; if (File.Exists(configurationPath)) { @@ -340,7 +340,7 @@ namespace Ocelot.IntegrationTests var env = hostingContext.HostingEnvironment; config.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true); - config.AddJsonFile("configuration.json"); + config.AddJsonFile("ocelot.json"); config.AddJsonFile("peers.json", optional: true, reloadOnChange: true); #pragma warning disable CS0618 config.AddOcelotBaseUrl(url); diff --git a/test/Ocelot.IntegrationTests/ThreadSafeHeadersTests.cs b/test/Ocelot.IntegrationTests/ThreadSafeHeadersTests.cs index e61fa63b..ed125aa4 100644 --- a/test/Ocelot.IntegrationTests/ThreadSafeHeadersTests.cs +++ b/test/Ocelot.IntegrationTests/ThreadSafeHeadersTests.cs @@ -108,7 +108,7 @@ namespace Ocelot.IntegrationTests var env = hostingContext.HostingEnvironment; config.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true); - config.AddJsonFile("configuration.json"); + config.AddJsonFile("ocelot.json"); config.AddEnvironmentVariables(); }) .ConfigureServices(x => @@ -138,7 +138,7 @@ namespace Ocelot.IntegrationTests private void GivenThereIsAConfiguration(FileConfiguration fileConfiguration) { - var configurationPath = $"{Directory.GetCurrentDirectory()}/configuration.json"; + var configurationPath = $"{Directory.GetCurrentDirectory()}/ocelot.json"; var jsonConfiguration = JsonConvert.SerializeObject(fileConfiguration); @@ -151,7 +151,7 @@ namespace Ocelot.IntegrationTests var text = File.ReadAllText(configurationPath); - configurationPath = $"{AppContext.BaseDirectory}/configuration.json"; + configurationPath = $"{AppContext.BaseDirectory}/ocelot.json"; if (File.Exists(configurationPath)) { diff --git a/test/Ocelot.IntegrationTests/configuration.json b/test/Ocelot.IntegrationTests/ocelot.json old mode 100755 new mode 100644 similarity index 100% rename from test/Ocelot.IntegrationTests/configuration.json rename to test/Ocelot.IntegrationTests/ocelot.json diff --git a/test/Ocelot.ManualTest/Ocelot.ManualTest.csproj b/test/Ocelot.ManualTest/Ocelot.ManualTest.csproj index d2e3e7bc..a43e6b23 100644 --- a/test/Ocelot.ManualTest/Ocelot.ManualTest.csproj +++ b/test/Ocelot.ManualTest/Ocelot.ManualTest.csproj @@ -16,7 +16,7 @@ - + PreserveNewest diff --git a/test/Ocelot.ManualTest/Program.cs b/test/Ocelot.ManualTest/Program.cs index 3bab21b7..966b1097 100644 --- a/test/Ocelot.ManualTest/Program.cs +++ b/test/Ocelot.ManualTest/Program.cs @@ -21,7 +21,7 @@ namespace Ocelot.ManualTest .SetBasePath(hostingContext.HostingEnvironment.ContentRootPath) .AddJsonFile("appsettings.json", true, true) .AddJsonFile($"appsettings.{hostingContext.HostingEnvironment.EnvironmentName}.json", true, true) - .AddJsonFile("configuration.json") + .AddJsonFile("ocelot.json") .AddEnvironmentVariables(); }) .ConfigureServices(s => { diff --git a/test/Ocelot.ManualTest/configuration.json b/test/Ocelot.ManualTest/ocelot.json similarity index 100% rename from test/Ocelot.ManualTest/configuration.json rename to test/Ocelot.ManualTest/ocelot.json diff --git a/test/Ocelot.UnitTests/Configuration/FileConfigurationRepositoryTests.cs b/test/Ocelot.UnitTests/Configuration/FileConfigurationRepositoryTests.cs index 15dd3729..b27015e3 100644 --- a/test/Ocelot.UnitTests/Configuration/FileConfigurationRepositoryTests.cs +++ b/test/Ocelot.UnitTests/Configuration/FileConfigurationRepositoryTests.cs @@ -113,7 +113,7 @@ namespace Ocelot.UnitTests.Configuration private void GivenTheConfigurationIs(FileConfiguration fileConfiguration) { - var configurationPath = $"{AppContext.BaseDirectory}/configuration{(string.IsNullOrEmpty(_environmentName) ? string.Empty : ".")}{_environmentName}.json"; + var configurationPath = $"{AppContext.BaseDirectory}/ocelot{(string.IsNullOrEmpty(_environmentName) ? string.Empty : ".")}{_environmentName}.json"; var jsonConfiguration = JsonConvert.SerializeObject(fileConfiguration); diff --git a/test/Ocelot.UnitTests/configuration.json b/test/Ocelot.UnitTests/ocelot.json old mode 100755 new mode 100644 similarity index 100% rename from test/Ocelot.UnitTests/configuration.json rename to test/Ocelot.UnitTests/ocelot.json