mirror of
				https://github.com/nsnail/Ocelot.git
				synced 2025-11-04 11:30:49 +08:00 
			
		
		
		
	hacked together load balancing reroutes in fileconfig (#211)
* hacked together load balancing reroutes in fileconfig * some renaming and refactoring * more renames * hacked away the old config json * test for issue 213 * renamed key * dont share ports * oops * updated docs * mvoed docs around * port being used
This commit is contained in:
		@@ -1,63 +1,63 @@
 | 
			
		||||
namespace Ocelot.UnitTests.TestData
 | 
			
		||||
{
 | 
			
		||||
    using System.Collections.Generic;
 | 
			
		||||
    using Ocelot.Configuration.File;
 | 
			
		||||
 | 
			
		||||
    public class AuthenticationConfigTestData
 | 
			
		||||
    {
 | 
			
		||||
        public static IEnumerable<object[]> GetAuthenticationData()
 | 
			
		||||
        {
 | 
			
		||||
            yield return new object[] 
 | 
			
		||||
            {
 | 
			
		||||
                new FileConfiguration
 | 
			
		||||
                {
 | 
			
		||||
                    ReRoutes = new List<FileReRoute>
 | 
			
		||||
                    {
 | 
			
		||||
                        new FileReRoute
 | 
			
		||||
                        {
 | 
			
		||||
                            UpstreamPathTemplate = "/api/products/{productId}",
 | 
			
		||||
                            DownstreamPathTemplate = "/products/{productId}",
 | 
			
		||||
                            UpstreamHttpMethod = new List<string> { "Get" },
 | 
			
		||||
                            ReRouteIsCaseSensitive = true,
 | 
			
		||||
                            AuthenticationOptions = new FileAuthenticationOptions
 | 
			
		||||
                            {
 | 
			
		||||
                                AuthenticationProviderKey = "Test",
 | 
			
		||||
                                AllowedScopes = new List<string>(),
 | 
			
		||||
                            },
 | 
			
		||||
                            AddHeadersToRequest =
 | 
			
		||||
                            {
 | 
			
		||||
                                { "CustomerId", "Claims[CustomerId] > value" },
 | 
			
		||||
                            }
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            };
 | 
			
		||||
 | 
			
		||||
            yield return new object[]
 | 
			
		||||
            {
 | 
			
		||||
                new FileConfiguration
 | 
			
		||||
                {
 | 
			
		||||
                    ReRoutes = new List<FileReRoute>
 | 
			
		||||
                    {
 | 
			
		||||
                        new FileReRoute
 | 
			
		||||
                        {
 | 
			
		||||
                            UpstreamPathTemplate = "/api/products/{productId}",
 | 
			
		||||
                            DownstreamPathTemplate = "/products/{productId}",
 | 
			
		||||
                            UpstreamHttpMethod = new List<string> { "Get" },
 | 
			
		||||
                            ReRouteIsCaseSensitive = true,
 | 
			
		||||
                            AuthenticationOptions = new FileAuthenticationOptions
 | 
			
		||||
                            {
 | 
			
		||||
                                AuthenticationProviderKey = "Test",
 | 
			
		||||
                                AllowedScopes = new List<string>(),
 | 
			
		||||
                            },
 | 
			
		||||
                            AddHeadersToRequest =
 | 
			
		||||
                            {
 | 
			
		||||
                                { "CustomerId", "Claims[CustomerId] > value" },
 | 
			
		||||
                            }
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            };
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
namespace Ocelot.UnitTests.TestData
 | 
			
		||||
{
 | 
			
		||||
    using System.Collections.Generic;
 | 
			
		||||
    using Ocelot.Configuration.File;
 | 
			
		||||
 | 
			
		||||
    public class AuthenticationConfigTestData
 | 
			
		||||
    {
 | 
			
		||||
        public static IEnumerable<object[]> GetAuthenticationData()
 | 
			
		||||
        {
 | 
			
		||||
            yield return new object[] 
 | 
			
		||||
            {
 | 
			
		||||
                new FileConfiguration
 | 
			
		||||
                {
 | 
			
		||||
                    ReRoutes = new List<FileReRoute>
 | 
			
		||||
                    {
 | 
			
		||||
                        new FileReRoute
 | 
			
		||||
                        {
 | 
			
		||||
                            UpstreamPathTemplate = "/api/products/{productId}",
 | 
			
		||||
                            DownstreamPathTemplate = "/products/{productId}",
 | 
			
		||||
                            UpstreamHttpMethod = new List<string> { "Get" },
 | 
			
		||||
                            ReRouteIsCaseSensitive = true,
 | 
			
		||||
                            AuthenticationOptions = new FileAuthenticationOptions
 | 
			
		||||
                            {
 | 
			
		||||
                                AuthenticationProviderKey = "Test",
 | 
			
		||||
                                AllowedScopes = new List<string>(),
 | 
			
		||||
                            },
 | 
			
		||||
                            AddHeadersToRequest =
 | 
			
		||||
                            {
 | 
			
		||||
                                { "CustomerId", "Claims[CustomerId] > value" },
 | 
			
		||||
                            }
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            };
 | 
			
		||||
 | 
			
		||||
            yield return new object[]
 | 
			
		||||
            {
 | 
			
		||||
                new FileConfiguration
 | 
			
		||||
                {
 | 
			
		||||
                    ReRoutes = new List<FileReRoute>
 | 
			
		||||
                    {
 | 
			
		||||
                        new FileReRoute
 | 
			
		||||
                        {
 | 
			
		||||
                            UpstreamPathTemplate = "/api/products/{productId}",
 | 
			
		||||
                            DownstreamPathTemplate = "/products/{productId}",
 | 
			
		||||
                            UpstreamHttpMethod = new List<string> { "Get" },
 | 
			
		||||
                            ReRouteIsCaseSensitive = true,
 | 
			
		||||
                            AuthenticationOptions = new FileAuthenticationOptions
 | 
			
		||||
                            {
 | 
			
		||||
                                AuthenticationProviderKey = "Test",
 | 
			
		||||
                                AllowedScopes = new List<string>(),
 | 
			
		||||
                            },
 | 
			
		||||
                            AddHeadersToRequest =
 | 
			
		||||
                            {
 | 
			
		||||
                                { "CustomerId", "Claims[CustomerId] > value" },
 | 
			
		||||
                            }
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            };
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user