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
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:
@@ -32,8 +32,13 @@ jobs:
|
|||||||
- name: Restore
|
- name: Restore
|
||||||
run: dotnet restore backend-tests/Nexus.Api.Tests.csproj
|
run: dotnet restore backend-tests/Nexus.Api.Tests.csproj
|
||||||
|
|
||||||
- name: Build
|
- name: Build without contract-time key persistence
|
||||||
run: dotnet build backend-tests/Nexus.Api.Tests.csproj --no-restore --configuration Release
|
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
|
- name: Verify EF migration model
|
||||||
run: |
|
run: |
|
||||||
@@ -79,10 +84,14 @@ jobs:
|
|||||||
- name: Verify Docker endpoint
|
- name: Verify Docker endpoint
|
||||||
run: docker info
|
run: docker info
|
||||||
|
|
||||||
- name: Restore and build
|
- name: Restore and build without contract-time key persistence
|
||||||
run: |
|
run: |
|
||||||
dotnet restore backend-tests/Nexus.Api.Tests.csproj
|
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
|
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
|
- name: Run all container-backed contracts
|
||||||
run: >-
|
run: >-
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using Nexus.Api.Extensions;
|
using Nexus.Api.Extensions;
|
||||||
using Nexus.Api.Http;
|
using Nexus.Api.Http;
|
||||||
using Microsoft.AspNetCore.DataProtection;
|
using Microsoft.AspNetCore.DataProtection;
|
||||||
|
using Microsoft.AspNetCore.DataProtection.KeyManagement;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
@@ -14,6 +15,8 @@ if (isOpenApiGeneration)
|
|||||||
"openapi-contract-generation-only-000000000000000000";
|
"openapi-contract-generation-only-000000000000000000";
|
||||||
builder.Services.AddDataProtection()
|
builder.Services.AddDataProtection()
|
||||||
.UseEphemeralDataProtectionProvider();
|
.UseEphemeralDataProtectionProvider();
|
||||||
|
builder.Services.Configure<KeyManagementOptions>(options =>
|
||||||
|
options.AutoGenerateKeys = false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- Service Registration ---
|
// --- Service Registration ---
|
||||||
|
|||||||
Reference in New Issue
Block a user