Refactor code structure and optimize performance across multiple modules

This commit is contained in:
StellaOps Bot
2025-12-26 20:03:22 +02:00
parent c786faae84
commit b4fc66feb6
3353 changed files with 88254 additions and 1590657 deletions

View File

@@ -2,6 +2,7 @@ using System.Security.Claims;
using Microsoft.Extensions.Options;
using StellaOps.Registry.TokenService;
using StellaOps.TestKit;
namespace StellaOps.Registry.TokenService.Tests;
public sealed class PlanRegistryTests
@@ -59,7 +60,8 @@ public sealed class PlanRegistryTests
};
}
[Fact]
[Trait("Category", TestCategories.Unit)]
[Fact]
public void Authorize_AllowsMatchingPlan()
{
var options = CreateOptions();
@@ -85,7 +87,8 @@ public sealed class PlanRegistryTests
Assert.True(decision.Allowed);
}
[Fact]
[Trait("Category", TestCategories.Unit)]
[Fact]
public void Authorize_DeniesUnknownPlan()
{
var options = CreateOptions();

View File

@@ -1,11 +1,13 @@
using Microsoft.AspNetCore.Http;
using StellaOps.Registry.TokenService;
using StellaOps.TestKit;
namespace StellaOps.Registry.TokenService.Tests;
public sealed class RegistryScopeParserTests
{
[Fact]
[Trait("Category", TestCategories.Unit)]
[Fact]
public void Parse_SingleScope_DefaultsPull()
{
var query = new QueryCollection(new Dictionary<string, Microsoft.Extensions.Primitives.StringValues>
@@ -21,7 +23,8 @@ public sealed class RegistryScopeParserTests
Assert.Equal(new[] { "pull" }, result[0].Actions);
}
[Fact]
[Trait("Category", TestCategories.Unit)]
[Fact]
public void Parse_MultipleScopes()
{
var query = new QueryCollection(new Dictionary<string, Microsoft.Extensions.Primitives.StringValues>

View File

@@ -5,13 +5,16 @@ using Microsoft.Extensions.Options;
using StellaOps.Registry.TokenService;
using StellaOps.Registry.TokenService.Observability;
using StellaOps.TestKit;
namespace StellaOps.Registry.TokenService.Tests;
public sealed class RegistryTokenIssuerTests : IDisposable
{
private readonly List<string> _tempFiles = new();
[Fact]
[Trait("Category", TestCategories.Unit)]
[Fact]
public void IssueToken_GeneratesJwtWithAccessClaim()
{
var pemPath = CreatePemKey();

View File

@@ -24,6 +24,7 @@
<ItemGroup>
<ProjectReference Include="../../StellaOps.Registry.TokenService/StellaOps.Registry.TokenService.csproj" />
<ProjectReference Include="../../../__Libraries/StellaOps.TestKit/StellaOps.TestKit.csproj" />
</ItemGroup>
</Project>

View File

@@ -1,8 +1,10 @@
namespace StellaOps.Registry.TokenService.Tests;
using StellaOps.TestKit;
namespace StellaOps.Registry.TokenService.Tests;
public class UnitTest1
{
[Fact]
[Trait("Category", TestCategories.Unit)]
[Fact]
public void Test1()
{