Fix build and code structure improvements. New but essential UI functionality. CI improvements. Documentation improvements. AI module improvements.

This commit is contained in:
StellaOps Bot
2025-12-26 21:54:17 +02:00
parent 335ff7da16
commit c2b9cd8d1f
3717 changed files with 264714 additions and 48202 deletions

View File

@@ -10,16 +10,10 @@
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="8.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.0" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<PackageReference Include="FluentAssertions" />
<PackageReference Include="Moq" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="../../__Libraries/StellaOps.Authority.Core/StellaOps.Authority.Core.csproj" />
</ItemGroup>
</Project>
</Project>

View File

@@ -9,13 +9,13 @@ using FluentAssertions;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options;
using Npgsql;
using StellaOps.Authority.Storage.Postgres;
using StellaOps.Authority.Storage.Postgres.Models;
using StellaOps.Authority.Storage.Postgres.Repositories;
using StellaOps.Authority.Persistence.Postgres;
using StellaOps.Authority.Persistence.Postgres.Models;
using StellaOps.Authority.Persistence.Postgres.Repositories;
using StellaOps.TestKit;
using Xunit;
namespace StellaOps.Authority.Storage.Postgres.Tests;
namespace StellaOps.Authority.Persistence.Tests;
/// <summary>
/// Concurrency tests for API key storage operations.

View File

@@ -9,13 +9,13 @@ using FluentAssertions;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options;
using Npgsql;
using StellaOps.Authority.Storage.Postgres;
using StellaOps.Authority.Storage.Postgres.Models;
using StellaOps.Authority.Storage.Postgres.Repositories;
using StellaOps.Authority.Persistence.Postgres;
using StellaOps.Authority.Persistence.Postgres.Models;
using StellaOps.Authority.Persistence.Postgres.Repositories;
using StellaOps.TestKit;
using Xunit;
namespace StellaOps.Authority.Storage.Postgres.Tests;
namespace StellaOps.Authority.Persistence.Tests;
/// <summary>
/// Idempotency tests for API key storage operations.
@@ -95,10 +95,8 @@ public sealed class ApiKeyIdempotencyTests : IAsyncLifetime
{
// Arrange
var prefix = "sk_unique_" + Guid.NewGuid().ToString("N")[..6];
var key1 = CreateApiKeyEntity(Guid.NewGuid(), "Key One");
key1.KeyPrefix = prefix;
var key2 = CreateApiKeyEntity(Guid.NewGuid(), "Key Two");
key2.KeyPrefix = prefix; // Same prefix
var key1 = CreateApiKeyEntityWithPrefix(Guid.NewGuid(), "Key One", prefix);
var key2 = CreateApiKeyEntityWithPrefix(Guid.NewGuid(), "Key Two", prefix);
// Act
await _repository.CreateAsync(_tenantId, key1);
@@ -220,6 +218,19 @@ public sealed class ApiKeyIdempotencyTests : IAsyncLifetime
ExpiresAt = DateTimeOffset.UtcNow.AddMonths(6)
};
private ApiKeyEntity CreateApiKeyEntityWithPrefix(Guid id, string name, string keyPrefix) => new()
{
Id = id,
TenantId = _tenantId,
UserId = _userId,
Name = name,
KeyHash = "sha256_" + Guid.NewGuid().ToString("N"),
KeyPrefix = keyPrefix,
Scopes = ["read"],
Status = ApiKeyStatus.Active,
ExpiresAt = DateTimeOffset.UtcNow.AddMonths(6)
};
private Task SeedTenantAsync() =>
_fixture.ExecuteSqlAsync(
$"INSERT INTO authority.tenants (tenant_id, name, status, settings, metadata) " +

View File

@@ -1,12 +1,12 @@
using FluentAssertions;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options;
using StellaOps.Authority.Storage.Postgres.Models;
using StellaOps.Authority.Storage.Postgres.Repositories;
using Xunit;
using StellaOps.Authority.Persistence.Postgres;
using StellaOps.Authority.Persistence.Postgres.Models;
using StellaOps.Authority.Persistence.Postgres.Repositories;
using StellaOps.TestKit;
namespace StellaOps.Authority.Storage.Postgres.Tests;
using Xunit;
namespace StellaOps.Authority.Persistence.Tests;
[Collection(AuthorityPostgresCollection.Name)]
public sealed class ApiKeyRepositoryTests : IAsyncLifetime

View File

@@ -1,12 +1,12 @@
using FluentAssertions;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options;
using StellaOps.Authority.Storage.Postgres.Models;
using StellaOps.Authority.Storage.Postgres.Repositories;
using Xunit;
using StellaOps.Authority.Persistence.Postgres;
using StellaOps.Authority.Persistence.Postgres.Models;
using StellaOps.Authority.Persistence.Postgres.Repositories;
using StellaOps.TestKit;
namespace StellaOps.Authority.Storage.Postgres.Tests;
using Xunit;
namespace StellaOps.Authority.Persistence.Tests;
[Collection(AuthorityPostgresCollection.Name)]
public sealed class AuditRepositoryTests : IAsyncLifetime

View File

@@ -1,10 +1,10 @@
using FluentAssertions;
using FluentAssertions;
using Npgsql;
using Xunit;
using StellaOps.TestKit;
namespace StellaOps.Authority.Storage.Postgres.Tests;
namespace StellaOps.Authority.Persistence.Tests;
/// <summary>
/// Tests that verify Authority module migrations run successfully.
@@ -56,7 +56,6 @@ public sealed class AuthorityMigrationTests
{
// Arrange
await using var connection = new NpgsqlConnection(_fixture.ConnectionString);
using StellaOps.TestKit;
await connection.OpenAsync();
// Act - Check schema_migrations table

View File

@@ -6,7 +6,7 @@
// -----------------------------------------------------------------------------
using System.Reflection;
using StellaOps.Authority.Storage.Postgres;
using StellaOps.Authority.Persistence.Postgres;
using StellaOps.Infrastructure.Postgres.Testing;
using StellaOps.TestKit;
using StellaOps.TestKit.Fixtures;
@@ -16,7 +16,7 @@ using Xunit;
using TestKitPostgresFixture = StellaOps.TestKit.Fixtures.PostgresFixture;
using TestKitPostgresIsolationMode = StellaOps.TestKit.Fixtures.PostgresIsolationMode;
namespace StellaOps.Authority.Storage.Postgres.Tests;
namespace StellaOps.Authority.Persistence.Tests;
/// <summary>
/// PostgreSQL integration test fixture for the Authority module.

View File

@@ -1,12 +1,12 @@
using FluentAssertions;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options;
using StellaOps.Authority.Storage.Postgres.Models;
using StellaOps.Authority.Storage.Postgres.Repositories;
using Xunit;
using StellaOps.Authority.Persistence.Postgres;
using StellaOps.Authority.Persistence.Postgres.Models;
using StellaOps.Authority.Persistence.Postgres.Repositories;
using StellaOps.TestKit;
namespace StellaOps.Authority.Storage.Postgres.Tests;
using Xunit;
namespace StellaOps.Authority.Persistence.Tests;
[Collection(AuthorityPostgresCollection.Name)]
public sealed class OfflineKitAuditRepositoryTests : IAsyncLifetime

View File

@@ -1,12 +1,12 @@
using FluentAssertions;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options;
using StellaOps.Authority.Storage.Postgres.Models;
using StellaOps.Authority.Storage.Postgres.Repositories;
using Xunit;
using StellaOps.Authority.Persistence.Postgres;
using StellaOps.Authority.Persistence.Postgres.Models;
using StellaOps.Authority.Persistence.Postgres.Repositories;
using StellaOps.TestKit;
namespace StellaOps.Authority.Storage.Postgres.Tests;
using Xunit;
namespace StellaOps.Authority.Persistence.Tests;
[Collection(AuthorityPostgresCollection.Name)]
public sealed class PermissionRepositoryTests : IAsyncLifetime

View File

@@ -2,12 +2,12 @@ using System.Linq;
using FluentAssertions;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options;
using StellaOps.Authority.Storage.Postgres.Models;
using StellaOps.Authority.Storage.Postgres.Repositories;
using Xunit;
using StellaOps.Authority.Persistence.Postgres;
using StellaOps.Authority.Persistence.Postgres.Models;
using StellaOps.Authority.Persistence.Postgres.Repositories;
using StellaOps.TestKit;
namespace StellaOps.Authority.Storage.Postgres.Tests;
using Xunit;
namespace StellaOps.Authority.Persistence.Tests;
[Collection(AuthorityPostgresCollection.Name)]
public sealed class RefreshTokenRepositoryTests : IAsyncLifetime

View File

@@ -8,13 +8,13 @@
using FluentAssertions;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options;
using StellaOps.Authority.Storage.Postgres;
using StellaOps.Authority.Storage.Postgres.Models;
using StellaOps.Authority.Storage.Postgres.Repositories;
using StellaOps.Authority.Persistence.Postgres;
using StellaOps.Authority.Persistence.Postgres.Models;
using StellaOps.Authority.Persistence.Postgres.Repositories;
using Xunit;
using StellaOps.TestKit;
namespace StellaOps.Authority.Storage.Postgres.Tests;
namespace StellaOps.Authority.Persistence.Tests;
/// <summary>
/// Role-based access control (RBAC) tests for Authority module.

View File

@@ -1,12 +1,12 @@
using FluentAssertions;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options;
using StellaOps.Authority.Storage.Postgres.Models;
using StellaOps.Authority.Storage.Postgres.Repositories;
using Xunit;
using StellaOps.Authority.Persistence.Postgres;
using StellaOps.Authority.Persistence.Postgres.Models;
using StellaOps.Authority.Persistence.Postgres.Repositories;
using StellaOps.TestKit;
namespace StellaOps.Authority.Storage.Postgres.Tests;
using Xunit;
namespace StellaOps.Authority.Persistence.Tests;
[Collection(AuthorityPostgresCollection.Name)]
public sealed class RoleRepositoryTests : IAsyncLifetime

View File

@@ -1,12 +1,12 @@
using FluentAssertions;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options;
using StellaOps.Authority.Storage.Postgres.Models;
using StellaOps.Authority.Storage.Postgres.Repositories;
using Xunit;
using StellaOps.Authority.Persistence.Postgres;
using StellaOps.Authority.Persistence.Postgres.Models;
using StellaOps.Authority.Persistence.Postgres.Repositories;
using StellaOps.TestKit;
namespace StellaOps.Authority.Storage.Postgres.Tests;
using Xunit;
namespace StellaOps.Authority.Persistence.Tests;
[Collection(AuthorityPostgresCollection.Name)]
public sealed class SessionRepositoryTests : IAsyncLifetime

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" ?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>preview</LangVersion>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<RootNamespace>StellaOps.Authority.Persistence.Tests</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" />
<PackageReference Include="Microsoft.Extensions.Options" />
<PackageReference Include="Moq" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\__Libraries\StellaOps.Authority.Persistence\StellaOps.Authority.Persistence.csproj" />
<ProjectReference Include="..\..\..\__Tests\__Libraries\StellaOps.Infrastructure.Postgres.Testing\StellaOps.Infrastructure.Postgres.Testing.csproj" />
<ProjectReference Include="..\..\..\__Libraries\StellaOps.TestKit\StellaOps.TestKit.csproj" />
</ItemGroup>
</Project>

View File

@@ -1,8 +1,8 @@
using StellaOps.Authority.Storage.Postgres.Models;
using StellaOps.Authority.Storage.Postgres.Repositories;
using StellaOps.Authority.Persistence.Postgres.Models;
using StellaOps.Authority.Persistence.Postgres.Repositories;
using System.Collections.Concurrent;
namespace StellaOps.Authority.Storage.Postgres.Tests.TestDoubles;
namespace StellaOps.Authority.Persistence.Tests.TestDoubles;
internal sealed class InMemoryTokenRepository : ITokenRepository
{

View File

@@ -2,12 +2,12 @@ using System.Linq;
using FluentAssertions;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options;
using StellaOps.Authority.Storage.Postgres.Models;
using StellaOps.Authority.Storage.Postgres.Repositories;
using Xunit;
using StellaOps.Authority.Persistence.Postgres;
using StellaOps.Authority.Persistence.Postgres.Models;
using StellaOps.Authority.Persistence.Postgres.Repositories;
using StellaOps.TestKit;
namespace StellaOps.Authority.Storage.Postgres.Tests;
using Xunit;
namespace StellaOps.Authority.Persistence.Tests;
[Collection(AuthorityPostgresCollection.Name)]
public sealed class TokenRepositoryTests : IAsyncLifetime

View File

@@ -1,36 +0,0 @@
<?xml version="1.0" ?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>preview</LangVersion>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="10.0.0" />
<PackageReference Include="Moq" Version="4.20.70" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.4">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\__Libraries\StellaOps.Authority.Storage.Postgres\StellaOps.Authority.Storage.Postgres.csproj" />
<ProjectReference Include="..\..\..\__Tests\__Libraries\StellaOps.Infrastructure.Postgres.Testing\StellaOps.Infrastructure.Postgres.Testing.csproj" />
<ProjectReference Include="..\..\..\__Libraries\StellaOps.TestKit\StellaOps.TestKit.csproj" />
</ItemGroup>
</Project>