mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-04-22 18:22:49 +08:00
Feature/remove id server (#551)
* removed idserver4 * some files I missed removing
This commit is contained in:
parent
373a3927f2
commit
18ded25b0e
@ -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<string> { "admin", "openid", "offline_access" },
|
|
||||||
credentialsSigningCertificateLocation,
|
|
||||||
credentialsSigningCertificatePassword
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -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; }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,14 +0,0 @@
|
|||||||
namespace Ocelot.Configuration
|
|
||||||
{
|
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
public interface IIdentityServerConfiguration
|
|
||||||
{
|
|
||||||
string ApiName { get; }
|
|
||||||
string ApiSecret { get; }
|
|
||||||
bool RequireHttps { get; }
|
|
||||||
List<string> AllowedScopes { get; }
|
|
||||||
string CredentialsSigningCertificateLocation { get; }
|
|
||||||
string CredentialsSigningCertificatePassword { get; }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,30 +0,0 @@
|
|||||||
namespace Ocelot.Configuration
|
|
||||||
{
|
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
public class IdentityServerConfiguration : IIdentityServerConfiguration
|
|
||||||
{
|
|
||||||
public IdentityServerConfiguration(
|
|
||||||
string apiName,
|
|
||||||
bool requireHttps,
|
|
||||||
string apiSecret,
|
|
||||||
List<string> 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<string> AllowedScopes { get; }
|
|
||||||
public string ApiSecret { get; }
|
|
||||||
public string CredentialsSigningCertificateLocation { get; }
|
|
||||||
public string CredentialsSigningCertificatePassword { get; }
|
|
||||||
}
|
|
||||||
}
|
|
@ -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");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user