From 18ded25b0eba4dabce88ebc397482f63bdad9855 Mon Sep 17 00:00:00 2001 From: Tom Pallister Date: Tue, 14 Aug 2018 18:39:18 +0100 Subject: [PATCH] Feature/remove id server (#551) * removed idserver4 * some files I missed removing --- .../IdentityServerConfigurationCreator.cs | 23 -------------- .../File/FileIdentityServerConfig.cs | 10 ------- .../IIdentityServerConfiguration.cs | 14 --------- .../IdentityServerConfiguration.cs | 30 ------------------- ...IdentityServerConfigurationCreatorTests.cs | 16 ---------- 5 files changed, 93 deletions(-) delete mode 100644 src/Ocelot/Configuration/Creator/IdentityServerConfigurationCreator.cs delete mode 100644 src/Ocelot/Configuration/File/FileIdentityServerConfig.cs delete mode 100644 src/Ocelot/Configuration/IIdentityServerConfiguration.cs delete mode 100644 src/Ocelot/Configuration/IdentityServerConfiguration.cs delete mode 100644 test/Ocelot.UnitTests/Configuration/IdentityServerConfigurationCreatorTests.cs diff --git a/src/Ocelot/Configuration/Creator/IdentityServerConfigurationCreator.cs b/src/Ocelot/Configuration/Creator/IdentityServerConfigurationCreator.cs deleted file mode 100644 index 8569001ec..000000000 --- a/src/Ocelot/Configuration/Creator/IdentityServerConfigurationCreator.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Ocelot.Configuration.Creator -{ - public static class IdentityServerConfigurationCreator - { - public static IdentityServerConfiguration GetIdentityServerConfiguration(string secret) - { - var credentialsSigningCertificateLocation = Environment.GetEnvironmentVariable("OCELOT_CERTIFICATE"); - var credentialsSigningCertificatePassword = Environment.GetEnvironmentVariable("OCELOT_CERTIFICATE_PASSWORD"); - - return new IdentityServerConfiguration( - "admin", - false, - secret, - new List { "admin", "openid", "offline_access" }, - credentialsSigningCertificateLocation, - credentialsSigningCertificatePassword - ); - } - } -} diff --git a/src/Ocelot/Configuration/File/FileIdentityServerConfig.cs b/src/Ocelot/Configuration/File/FileIdentityServerConfig.cs deleted file mode 100644 index a07edab13..000000000 --- a/src/Ocelot/Configuration/File/FileIdentityServerConfig.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace Ocelot.Configuration.File -{ - public class FileIdentityServerConfig - { - public string ProviderRootUrl { get; set; } - public string ApiName { get; set; } - public bool RequireHttps { get; set; } - public string ApiSecret { get; set; } - } -} \ No newline at end of file diff --git a/src/Ocelot/Configuration/IIdentityServerConfiguration.cs b/src/Ocelot/Configuration/IIdentityServerConfiguration.cs deleted file mode 100644 index 0eb703470..000000000 --- a/src/Ocelot/Configuration/IIdentityServerConfiguration.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Ocelot.Configuration -{ - using System.Collections.Generic; - - public interface IIdentityServerConfiguration - { - string ApiName { get; } - string ApiSecret { get; } - bool RequireHttps { get; } - List AllowedScopes { get; } - string CredentialsSigningCertificateLocation { get; } - string CredentialsSigningCertificatePassword { get; } - } -} diff --git a/src/Ocelot/Configuration/IdentityServerConfiguration.cs b/src/Ocelot/Configuration/IdentityServerConfiguration.cs deleted file mode 100644 index b8b00ea2d..000000000 --- a/src/Ocelot/Configuration/IdentityServerConfiguration.cs +++ /dev/null @@ -1,30 +0,0 @@ -namespace Ocelot.Configuration -{ - using System.Collections.Generic; - - public class IdentityServerConfiguration : IIdentityServerConfiguration - { - public IdentityServerConfiguration( - string apiName, - bool requireHttps, - string apiSecret, - List allowedScopes, - string credentialsSigningCertificateLocation, - string credentialsSigningCertificatePassword) - { - ApiName = apiName; - RequireHttps = requireHttps; - ApiSecret = apiSecret; - AllowedScopes = allowedScopes; - CredentialsSigningCertificateLocation = credentialsSigningCertificateLocation; - CredentialsSigningCertificatePassword = credentialsSigningCertificatePassword; - } - - public string ApiName { get; } - public bool RequireHttps { get; } - public List AllowedScopes { get; } - public string ApiSecret { get; } - public string CredentialsSigningCertificateLocation { get; } - public string CredentialsSigningCertificatePassword { get; } - } -} diff --git a/test/Ocelot.UnitTests/Configuration/IdentityServerConfigurationCreatorTests.cs b/test/Ocelot.UnitTests/Configuration/IdentityServerConfigurationCreatorTests.cs deleted file mode 100644 index 5f8d3210f..000000000 --- a/test/Ocelot.UnitTests/Configuration/IdentityServerConfigurationCreatorTests.cs +++ /dev/null @@ -1,16 +0,0 @@ -using Ocelot.Configuration.Creator; -using Shouldly; -using Xunit; - -namespace Ocelot.UnitTests.Configuration -{ - public class IdentityServerConfigurationCreatorTests - { - [Fact] - public void happy_path_only_exists_for_test_coverage_even_uncle_bob_probably_wouldnt_test_this() - { - var result = IdentityServerConfigurationCreator.GetIdentityServerConfiguration("secret"); - result.ApiName.ShouldBe("admin"); - } - } -} \ No newline at end of file