forked from gongxuegit/tiku-backend.net
feat(security): add distributed authorization foundation
This commit is contained in:
@@ -34,8 +34,17 @@ public sealed class ApiTestFactory(
|
||||
{
|
||||
private readonly PostgresTestDatabase database = PostgresTestDatabase.Create();
|
||||
|
||||
public string DatabaseConnectionString => database.ConnectionString;
|
||||
|
||||
protected override void ConfigureWebHost(Microsoft.AspNetCore.Hosting.IWebHostBuilder builder)
|
||||
{
|
||||
if (configurationOverrides is not null)
|
||||
{
|
||||
foreach (var pair in configurationOverrides.Where(pair => pair.Value is not null))
|
||||
{
|
||||
builder.UseSetting(pair.Key, pair.Value);
|
||||
}
|
||||
}
|
||||
builder.ConfigureAppConfiguration((_, configuration) =>
|
||||
{
|
||||
var values = new Dictionary<string, string?>
|
||||
@@ -61,7 +70,7 @@ public sealed class ApiTestFactory(
|
||||
descriptor.ServiceType == typeof(NpgsqlDataSource) ||
|
||||
descriptor.ServiceType == typeof(TenantIsolationSaveChangesInterceptor) ||
|
||||
descriptor.ServiceType == typeof(DbContextOptions<TikuDbContext>) ||
|
||||
descriptor.ServiceType.FullName?.Contains(nameof(TikuDbContext), StringComparison.Ordinal) == true)
|
||||
descriptor.ServiceType == typeof(TikuDbContext))
|
||||
.ToArray())
|
||||
{
|
||||
services.Remove(descriptor);
|
||||
|
||||
Reference in New Issue
Block a user