fix(build): disable OpenAPI key persistence
CI - Build & Test / Backend (.NET) (push) Failing after 18s
CI - Build & Test / Backend integration (PostgreSQL/Toxiproxy) (push) Failing after 18s
CI - Build & Test / Frontend (Vue/TS) (push) Has been cancelled
CI - Build & Test / Security Check (push) Has been cancelled
CI - Build & Test / Deploy Nexus (push) Has been cancelled

This commit is contained in:
AzuTear
2026-08-01 02:05:03 +02:00
parent 28917c17ef
commit 0d7e417846
2 changed files with 15 additions and 3 deletions
+12 -3
View File
@@ -32,8 +32,13 @@ jobs:
- name: Restore
run: dotnet restore backend-tests/Nexus.Api.Tests.csproj
- name: Build
run: dotnet build backend-tests/Nexus.Api.Tests.csproj --no-restore --configuration Release
- name: Build without contract-time key persistence
run: |
key_dir="$HOME/.aspnet/DataProtection-Keys"
before="$(find "$key_dir" -type f -name 'key-*.xml' 2>/dev/null | wc -l)"
dotnet build backend-tests/Nexus.Api.Tests.csproj --no-restore --configuration Release
after="$(find "$key_dir" -type f -name 'key-*.xml' 2>/dev/null | wc -l)"
test "$before" -eq "$after"
- name: Verify EF migration model
run: |
@@ -79,10 +84,14 @@ jobs:
- name: Verify Docker endpoint
run: docker info
- name: Restore and build
- name: Restore and build without contract-time key persistence
run: |
dotnet restore backend-tests/Nexus.Api.Tests.csproj
key_dir="$HOME/.aspnet/DataProtection-Keys"
before="$(find "$key_dir" -type f -name 'key-*.xml' 2>/dev/null | wc -l)"
dotnet build backend-tests/Nexus.Api.Tests.csproj --no-restore --configuration Release
after="$(find "$key_dir" -type f -name 'key-*.xml' 2>/dev/null | wc -l)"
test "$before" -eq "$after"
- name: Run all container-backed contracts
run: >-
+3
View File
@@ -1,6 +1,7 @@
using Nexus.Api.Extensions;
using Nexus.Api.Http;
using Microsoft.AspNetCore.DataProtection;
using Microsoft.AspNetCore.DataProtection.KeyManagement;
using System.Reflection;
var builder = WebApplication.CreateBuilder(args);
@@ -14,6 +15,8 @@ if (isOpenApiGeneration)
"openapi-contract-generation-only-000000000000000000";
builder.Services.AddDataProtection()
.UseEphemeralDataProtectionProvider();
builder.Services.Configure<KeyManagementOptions>(options =>
options.AutoGenerateKeys = false);
}
// --- Service Registration ---