feat(api): Implement Console Export Client and Models
Some checks failed
AOC Guard CI / aoc-guard (push) Has been cancelled
AOC Guard CI / aoc-verify (push) Has been cancelled
Concelier Attestation Tests / attestation-tests (push) Has been cancelled
Docs CI / lint-and-preview (push) Has been cancelled
Policy Lint & Smoke / policy-lint (push) Has been cancelled
Findings Ledger CI / build-test (push) Has been cancelled
Findings Ledger CI / migration-validation (push) Has been cancelled
Findings Ledger CI / generate-manifest (push) Has been cancelled
mock-dev-release / package-mock-release (push) Has been cancelled

- Added ConsoleExportClient for managing export requests and responses.
- Introduced ConsoleExportRequest and ConsoleExportResponse models.
- Implemented methods for creating and retrieving exports with appropriate headers.

feat(crypto): Add Software SM2/SM3 Cryptography Provider

- Implemented SmSoftCryptoProvider for software-only SM2/SM3 cryptography.
- Added support for signing and verification using SM2 algorithm.
- Included hashing functionality with SM3 algorithm.
- Configured options for loading keys from files and environment gate checks.

test(crypto): Add unit tests for SmSoftCryptoProvider

- Created comprehensive tests for signing, verifying, and hashing functionalities.
- Ensured correct behavior for key management and error handling.

feat(api): Enhance Console Export Models

- Expanded ConsoleExport models to include detailed status and event types.
- Added support for various export formats and notification options.

test(time): Implement TimeAnchorPolicyService tests

- Developed tests for TimeAnchorPolicyService to validate time anchors.
- Covered scenarios for anchor validation, drift calculation, and policy enforcement.
This commit is contained in:
StellaOps Bot
2025-12-07 00:27:33 +02:00
parent 9bd6a73926
commit 0de92144d2
229 changed files with 32351 additions and 1481 deletions

View File

@@ -28536,13 +28536,63 @@ stella policy test {policyName}.stella
}
else if (!verifyOnly)
{
// In a real implementation, this would:
// 1. Copy artifacts to the local data store
// 2. Register exports in the database
// 3. Update metadata indexes
// For now, log success
logger.LogInformation("Air-gap bundle imported: domain={Domain}, exports={Exports}, scope={Scope}",
manifest.DomainId, manifest.Exports?.Count ?? 0, scopeDescription);
// CLI-AIRGAP-56-001: Use MirrorBundleImportService for real import
var importService = scope.ServiceProvider.GetService<IMirrorBundleImportService>();
if (importService is not null)
{
var importRequest = new MirrorImportRequest
{
BundlePath = bundlePath,
TenantId = effectiveTenant ?? (globalScope ? "global" : "default"),
TrustRootsPath = null, // Use bundled trust roots
DryRun = false,
Force = force
};
var importResult = await importService.ImportAsync(importRequest, cancellationToken).ConfigureAwait(false);
if (!importResult.Success)
{
AnsiConsole.MarkupLine($"[red]Import failed:[/] {Markup.Escape(importResult.Error ?? "Unknown error")}");
CliMetrics.RecordOfflineKitImport("import_failed");
return ExitGeneralError;
}
// Show DSSE verification status if applicable
if (importResult.DsseVerification is not null)
{
var dsseStatus = importResult.DsseVerification.IsValid ? "[green]VERIFIED[/]" : "[yellow]NOT VERIFIED[/]";
AnsiConsole.MarkupLine($"[grey]DSSE Signature:[/] {dsseStatus}");
if (!string.IsNullOrEmpty(importResult.DsseVerification.KeyId))
{
AnsiConsole.MarkupLine($"[grey] Key ID:[/] {Markup.Escape(TruncateMirrorDigest(importResult.DsseVerification.KeyId))}");
}
}
// Show imported paths in verbose mode
if (verbose && importResult.ImportedPaths.Count > 0)
{
AnsiConsole.WriteLine();
AnsiConsole.MarkupLine("[bold]Imported files:[/]");
foreach (var path in importResult.ImportedPaths.Take(10))
{
AnsiConsole.MarkupLine($" [grey]{Markup.Escape(Path.GetFileName(path))}[/]");
}
if (importResult.ImportedPaths.Count > 10)
{
AnsiConsole.MarkupLine($" [grey]... and {importResult.ImportedPaths.Count - 10} more files[/]");
}
}
logger.LogInformation("Air-gap bundle imported: domain={Domain}, exports={Exports}, scope={Scope}, files={FileCount}",
manifest.DomainId, manifest.Exports?.Count ?? 0, scopeDescription, importResult.ImportedPaths.Count);
}
else
{
// Fallback: log success without actual import
logger.LogInformation("Air-gap bundle imported (catalog-only): domain={Domain}, exports={Exports}, scope={Scope}",
manifest.DomainId, manifest.Exports?.Count ?? 0, scopeDescription);
}
}
}