Frontend gaps fill work. Testing fixes work. Auditing in progress.
This commit is contained in:
@@ -18,7 +18,6 @@ using StellaOps.Authority.Plugin.Ldap.Monitoring;
|
||||
using StellaOps.Authority.Plugin.Ldap.Tests.Fakes;
|
||||
using StellaOps.Authority.Plugin.Ldap.Tests.TestHelpers;
|
||||
using Xunit;
|
||||
using Xunit.Abstractions;
|
||||
|
||||
namespace StellaOps.Authority.Plugin.Ldap.Tests.Resilience;
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@ using StellaOps.Authority.Plugin.Ldap.Monitoring;
|
||||
using StellaOps.Authority.Plugin.Ldap.Tests.Fakes;
|
||||
using StellaOps.Authority.Plugin.Ldap.Tests.TestHelpers;
|
||||
using Xunit;
|
||||
using Xunit.Abstractions;
|
||||
|
||||
namespace StellaOps.Authority.Plugin.Ldap.Tests.Security;
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@ using StellaOps.Authority.Plugin.Ldap.Credentials;
|
||||
using StellaOps.Authority.Plugin.Ldap.Tests.Fakes;
|
||||
using StellaOps.Authority.Plugin.Ldap.Tests.TestHelpers;
|
||||
using Xunit;
|
||||
using Xunit.Abstractions;
|
||||
|
||||
namespace StellaOps.Authority.Plugin.Ldap.Tests.Snapshots;
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@ using StellaOps.Authority.Plugin.Oidc;
|
||||
using StellaOps.Authority.Plugin.Oidc.Credentials;
|
||||
using StellaOps.Authority.Plugins.Abstractions;
|
||||
using Xunit;
|
||||
using Xunit.Abstractions;
|
||||
|
||||
namespace StellaOps.Authority.Plugin.Oidc.Tests.Resilience;
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@ using Microsoft.IdentityModel.Tokens;
|
||||
using StellaOps.Authority.Plugin.Oidc;
|
||||
using StellaOps.Authority.Plugins.Abstractions;
|
||||
using Xunit;
|
||||
using Xunit.Abstractions;
|
||||
|
||||
namespace StellaOps.Authority.Plugin.Oidc.Tests.Security;
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@ using Microsoft.Extensions.Logging.Abstractions;
|
||||
using Microsoft.Extensions.Options;
|
||||
using StellaOps.Authority.Plugin.Oidc;
|
||||
using Xunit;
|
||||
using Xunit.Abstractions;
|
||||
|
||||
namespace StellaOps.Authority.Plugin.Oidc.Tests.Snapshots;
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@ using Microsoft.Extensions.Caching.Memory;
|
||||
using StellaOps.Authority.Plugin.Saml;
|
||||
using StellaOps.Authority.Plugins.Abstractions;
|
||||
using Xunit;
|
||||
using Xunit.Abstractions;
|
||||
|
||||
namespace StellaOps.Authority.Plugin.Saml.Tests.Resilience;
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@ using Microsoft.Extensions.Caching.Memory;
|
||||
using StellaOps.Authority.Plugin.Saml;
|
||||
using StellaOps.Authority.Plugins.Abstractions;
|
||||
using Xunit;
|
||||
using Xunit.Abstractions;
|
||||
|
||||
namespace StellaOps.Authority.Plugin.Saml.Tests.Security;
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@ using System.Threading.Tasks;
|
||||
using System.Xml;
|
||||
using FluentAssertions;
|
||||
using Xunit;
|
||||
using Xunit.Abstractions;
|
||||
|
||||
namespace StellaOps.Authority.Plugin.Saml.Tests.Snapshots;
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ using StellaOps.Authority.Persistence.Documents;
|
||||
using StellaOps.Authority.Persistence.InMemory.Stores;
|
||||
using StellaOps.Authority.Persistence.Sessions;
|
||||
using Xunit;
|
||||
using Xunit.Abstractions;
|
||||
|
||||
using StellaOps.TestKit;
|
||||
namespace StellaOps.Authority.Plugin.Standard.Tests;
|
||||
|
||||
@@ -206,11 +206,11 @@ public class StandardUserCredentialStoreTests : IAsyncLifetime
|
||||
Assert.Equal("Invalid credentials.", auditEntry.Reason);
|
||||
}
|
||||
|
||||
public Task InitializeAsync() => Task.CompletedTask;
|
||||
public ValueTask InitializeAsync() => ValueTask.CompletedTask;
|
||||
|
||||
public Task DisposeAsync()
|
||||
public ValueTask DisposeAsync()
|
||||
{
|
||||
return Task.CompletedTask;
|
||||
return ValueTask.CompletedTask;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -248,3 +248,7 @@ internal sealed class TestAuditLogger : IStandardCredentialAuditLogger
|
||||
string? Reason,
|
||||
IReadOnlyList<AuthEventProperty> Properties);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -135,7 +135,7 @@ public sealed class AuthorityWebApplicationFactory : WebApplicationFactory<Progr
|
||||
return base.CreateHost(builder);
|
||||
}
|
||||
|
||||
public Task InitializeAsync() => Task.CompletedTask;
|
||||
public ValueTask InitializeAsync() => ValueTask.CompletedTask;
|
||||
|
||||
private static string LocateRepositoryRoot()
|
||||
{
|
||||
@@ -193,5 +193,7 @@ public sealed class AuthorityWebApplicationFactory : WebApplicationFactory<Progr
|
||||
await base.DisposeAsync();
|
||||
}
|
||||
|
||||
Task IAsyncLifetime.DisposeAsync() => DisposeAsync().AsTask();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -8,9 +8,7 @@
|
||||
<IsPackable>false</IsPackable>
|
||||
<IsTestProject>true</IsTestProject>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Using Include="Xunit.Abstractions" />
|
||||
</ItemGroup>
|
||||
<ItemGroup> </ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="FluentAssertions" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" />
|
||||
|
||||
@@ -40,7 +40,7 @@ public sealed class ApiKeyConcurrencyTests : IAsyncLifetime
|
||||
_fixture = fixture;
|
||||
}
|
||||
|
||||
public async Task InitializeAsync()
|
||||
public async ValueTask InitializeAsync()
|
||||
{
|
||||
await _fixture.TruncateAllTablesAsync();
|
||||
|
||||
@@ -54,7 +54,7 @@ public sealed class ApiKeyConcurrencyTests : IAsyncLifetime
|
||||
await SeedUserAsync();
|
||||
}
|
||||
|
||||
public async Task DisposeAsync()
|
||||
public async ValueTask DisposeAsync()
|
||||
{
|
||||
await _npgsqlDataSource.DisposeAsync();
|
||||
}
|
||||
@@ -279,3 +279,6 @@ public sealed class ApiKeyConcurrencyTests : IAsyncLifetime
|
||||
$"VALUES ('{_userId}', '{_tenantId}', 'user-{_userId:N}', 'active') " +
|
||||
"ON CONFLICT (id) DO NOTHING;");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ public sealed class ApiKeyIdempotencyTests : IAsyncLifetime
|
||||
_fixture = fixture;
|
||||
}
|
||||
|
||||
public async Task InitializeAsync()
|
||||
public async ValueTask InitializeAsync()
|
||||
{
|
||||
await _fixture.TruncateAllTablesAsync();
|
||||
|
||||
@@ -54,7 +54,7 @@ public sealed class ApiKeyIdempotencyTests : IAsyncLifetime
|
||||
await SeedUserAsync();
|
||||
}
|
||||
|
||||
public async Task DisposeAsync()
|
||||
public async ValueTask DisposeAsync()
|
||||
{
|
||||
await _npgsqlDataSource.DisposeAsync();
|
||||
}
|
||||
@@ -243,3 +243,6 @@ public sealed class ApiKeyIdempotencyTests : IAsyncLifetime
|
||||
$"VALUES ('{_userId}', '{_tenantId}', 'user-{_userId:N}', 'active') " +
|
||||
"ON CONFLICT (id) DO NOTHING;");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -25,13 +25,13 @@ public sealed class ApiKeyRepositoryTests : IAsyncLifetime
|
||||
_repository = new ApiKeyRepository(dataSource, NullLogger<ApiKeyRepository>.Instance);
|
||||
}
|
||||
|
||||
public async Task InitializeAsync()
|
||||
public async ValueTask InitializeAsync()
|
||||
{
|
||||
await _fixture.TruncateAllTablesAsync();
|
||||
await SeedTenantAsync();
|
||||
}
|
||||
|
||||
public Task DisposeAsync() => Task.CompletedTask;
|
||||
public ValueTask DisposeAsync() => ValueTask.CompletedTask;
|
||||
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
@@ -163,3 +163,6 @@ public sealed class ApiKeyRepositoryTests : IAsyncLifetime
|
||||
return _fixture.ExecuteSqlAsync(statements);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -25,8 +25,8 @@ public sealed class AuditRepositoryTests : IAsyncLifetime
|
||||
_repository = new AuditRepository(dataSource, NullLogger<AuditRepository>.Instance);
|
||||
}
|
||||
|
||||
public Task InitializeAsync() => _fixture.TruncateAllTablesAsync();
|
||||
public Task DisposeAsync() => Task.CompletedTask;
|
||||
public ValueTask InitializeAsync() => new(_fixture.TruncateAllTablesAsync());
|
||||
public ValueTask DisposeAsync() => ValueTask.CompletedTask;
|
||||
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
@@ -198,3 +198,6 @@ public sealed class AuditRepositoryTests : IAsyncLifetime
|
||||
ResourceId = Guid.NewGuid().ToString()
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ public sealed class AuthorityTestKitPostgresFixture : IAsyncLifetime
|
||||
set => _fixture.IsolationMode = value;
|
||||
}
|
||||
|
||||
public async Task InitializeAsync()
|
||||
public async ValueTask InitializeAsync()
|
||||
{
|
||||
_fixture = new TestKitPostgresFixture
|
||||
{
|
||||
@@ -81,7 +81,7 @@ public sealed class AuthorityTestKitPostgresFixture : IAsyncLifetime
|
||||
await _fixture.ApplyMigrationsFromAssemblyAsync(migrationAssembly, "authority", "Migrations");
|
||||
}
|
||||
|
||||
public async Task DisposeAsync()
|
||||
public async ValueTask DisposeAsync()
|
||||
{
|
||||
await _fixture.DisposeAsync();
|
||||
}
|
||||
@@ -106,3 +106,6 @@ public sealed class AuthorityTestKitPostgresCollection : ICollectionFixture<Auth
|
||||
{
|
||||
public const string Name = "AuthorityTestKitPostgres";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -24,8 +24,8 @@ public sealed class OfflineKitAuditRepositoryTests : IAsyncLifetime
|
||||
_repository = new OfflineKitAuditRepository(dataSource, NullLogger<OfflineKitAuditRepository>.Instance);
|
||||
}
|
||||
|
||||
public Task InitializeAsync() => _fixture.TruncateAllTablesAsync();
|
||||
public Task DisposeAsync() => Task.CompletedTask;
|
||||
public ValueTask InitializeAsync() => new(_fixture.TruncateAllTablesAsync());
|
||||
public ValueTask DisposeAsync() => ValueTask.CompletedTask;
|
||||
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
@@ -129,3 +129,6 @@ public sealed class OfflineKitAuditRepositoryTests : IAsyncLifetime
|
||||
tenantBResults[0].TenantId.Should().Be(tenantB);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -25,13 +25,13 @@ public sealed class PermissionRepositoryTests : IAsyncLifetime
|
||||
_repository = new PermissionRepository(dataSource, NullLogger<PermissionRepository>.Instance);
|
||||
}
|
||||
|
||||
public async Task InitializeAsync()
|
||||
public async ValueTask InitializeAsync()
|
||||
{
|
||||
await _fixture.TruncateAllTablesAsync();
|
||||
await SeedTenantAsync();
|
||||
}
|
||||
|
||||
public Task DisposeAsync() => Task.CompletedTask;
|
||||
public ValueTask DisposeAsync() => ValueTask.CompletedTask;
|
||||
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
@@ -126,3 +126,6 @@ public sealed class PermissionRepositoryTests : IAsyncLifetime
|
||||
$"VALUES ('{_tenantId}', 'Tenant {_tenantId}', 'active', '{{}}', '{{}}') " +
|
||||
"ON CONFLICT (tenant_id) DO NOTHING;");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -26,13 +26,13 @@ public sealed class RefreshTokenRepositoryTests : IAsyncLifetime
|
||||
_repository = new RefreshTokenRepository(dataSource, NullLogger<RefreshTokenRepository>.Instance);
|
||||
}
|
||||
|
||||
public async Task InitializeAsync()
|
||||
public async ValueTask InitializeAsync()
|
||||
{
|
||||
await _fixture.TruncateAllTablesAsync();
|
||||
await SeedTenantAsync();
|
||||
}
|
||||
|
||||
public Task DisposeAsync() => Task.CompletedTask;
|
||||
public ValueTask DisposeAsync() => ValueTask.CompletedTask;
|
||||
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
@@ -217,3 +217,6 @@ public sealed class RefreshTokenRepositoryTests : IAsyncLifetime
|
||||
return _fixture.ExecuteSqlAsync(statements);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ public sealed class RoleBasedAccessTests : IAsyncLifetime
|
||||
_fixture = fixture;
|
||||
}
|
||||
|
||||
public async Task InitializeAsync()
|
||||
public async ValueTask InitializeAsync()
|
||||
{
|
||||
await _fixture.TruncateAllTablesAsync();
|
||||
|
||||
@@ -53,7 +53,7 @@ public sealed class RoleBasedAccessTests : IAsyncLifetime
|
||||
await SeedTenantAsync();
|
||||
}
|
||||
|
||||
public Task DisposeAsync() => Task.CompletedTask;
|
||||
public ValueTask DisposeAsync() => ValueTask.CompletedTask;
|
||||
|
||||
#region User-Role Assignment Tests
|
||||
|
||||
@@ -457,3 +457,6 @@ public sealed class RoleBasedAccessTests : IAsyncLifetime
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -25,13 +25,13 @@ public sealed class RoleRepositoryTests : IAsyncLifetime
|
||||
_repository = new RoleRepository(dataSource, NullLogger<RoleRepository>.Instance);
|
||||
}
|
||||
|
||||
public async Task InitializeAsync()
|
||||
public async ValueTask InitializeAsync()
|
||||
{
|
||||
await _fixture.TruncateAllTablesAsync();
|
||||
await SeedTenantAsync();
|
||||
}
|
||||
|
||||
public Task DisposeAsync() => Task.CompletedTask;
|
||||
public ValueTask DisposeAsync() => ValueTask.CompletedTask;
|
||||
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
@@ -126,3 +126,6 @@ public sealed class RoleRepositoryTests : IAsyncLifetime
|
||||
$"VALUES ('{_tenantId}', 'Tenant {_tenantId}', 'active', '{{}}', '{{}}') " +
|
||||
"ON CONFLICT (tenant_id) DO NOTHING;");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -25,13 +25,13 @@ public sealed class SessionRepositoryTests : IAsyncLifetime
|
||||
_repository = new SessionRepository(dataSource, NullLogger<SessionRepository>.Instance);
|
||||
}
|
||||
|
||||
public async Task InitializeAsync()
|
||||
public async ValueTask InitializeAsync()
|
||||
{
|
||||
await _fixture.TruncateAllTablesAsync();
|
||||
await SeedTenantAsync();
|
||||
}
|
||||
|
||||
public Task DisposeAsync() => Task.CompletedTask;
|
||||
public ValueTask DisposeAsync() => ValueTask.CompletedTask;
|
||||
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
@@ -106,3 +106,6 @@ public sealed class SessionRepositoryTests : IAsyncLifetime
|
||||
return _fixture.ExecuteSqlAsync(statements);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -26,12 +26,12 @@ public sealed class TokenRepositoryTests : IAsyncLifetime
|
||||
_repository = new TokenRepository(dataSource, NullLogger<TokenRepository>.Instance);
|
||||
}
|
||||
|
||||
public async Task InitializeAsync()
|
||||
public async ValueTask InitializeAsync()
|
||||
{
|
||||
await _fixture.TruncateAllTablesAsync();
|
||||
await SeedTenantAsync();
|
||||
}
|
||||
public Task DisposeAsync() => Task.CompletedTask;
|
||||
public ValueTask DisposeAsync() => ValueTask.CompletedTask;
|
||||
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
@@ -231,3 +231,6 @@ public sealed class TokenRepositoryTests : IAsyncLifetime
|
||||
return _fixture.ExecuteSqlAsync(statements);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user