search and ai stabilization work, localization stablized.

This commit is contained in:
master
2026-02-24 23:29:36 +02:00
parent 4f947a8b61
commit b07d27772e
766 changed files with 55299 additions and 3221 deletions

View File

@@ -4,6 +4,7 @@ using System.Linq;
using System.Security.Cryptography;
using System.Threading;
using System.Threading.Tasks;
using static StellaOps.Localization.T;
namespace StellaOps.Cryptography.Kms;
@@ -17,11 +18,11 @@ public sealed partial class FileKmsClient
try
{
var record = await LoadOrCreateMetadataAsync(keyId, cancellationToken, createIfMissing: true).ConfigureAwait(false)
?? throw new InvalidOperationException("Failed to create or load key metadata.");
?? throw new InvalidOperationException(_t("crypto.kms.metadata_failed"));
if (record.State == KmsKeyState.Revoked)
{
throw new InvalidOperationException($"Key '{keyId}' has been revoked and cannot be rotated.");
throw new InvalidOperationException(_t("crypto.kms.key_revoked", keyId));
}
var timestamp = _timeProvider.GetUtcNow();
@@ -76,7 +77,7 @@ public sealed partial class FileKmsClient
try
{
var record = await LoadOrCreateMetadataAsync(keyId, cancellationToken, createIfMissing: false).ConfigureAwait(false)
?? throw new InvalidOperationException($"Key '{keyId}' does not exist.");
?? throw new InvalidOperationException(_t("crypto.kms.key_not_found", keyId));
var timestamp = _timeProvider.GetUtcNow();
record.State = KmsKeyState.Revoked;