| | | 1 | | using System.Collections.Frozen; |
| | | 2 | | |
| | | 3 | | namespace AsiBackbone.Signing.ManagedKey; |
| | | 4 | | |
| | | 5 | | internal static class ManagedKeyDiagnosticMetadataKeyClassifier |
| | | 6 | | { |
| | 2 | 7 | | private static readonly FrozenSet<string> ReservedKeys = |
| | 2 | 8 | | new[] |
| | 2 | 9 | | { |
| | 2 | 10 | | "failure_code", |
| | 2 | 11 | | "failure_exception_type", |
| | 2 | 12 | | "failure_message", |
| | 2 | 13 | | "failure_retryable", |
| | 2 | 14 | | "last_retry_delay_milliseconds", |
| | 2 | 15 | | "last_retry_failure_code", |
| | 2 | 16 | | "last_retry_failure_exception_type", |
| | 2 | 17 | | "max_retry_attempts", |
| | 2 | 18 | | "max_retry_delay_milliseconds", |
| | 2 | 19 | | "provider_attempts", |
| | 2 | 20 | | "provider_kind", |
| | 2 | 21 | | "provider_operation_id", |
| | 2 | 22 | | "raw_private_key_loaded", |
| | 2 | 23 | | "remote_key_material", |
| | 2 | 24 | | "retry_attempts", |
| | 2 | 25 | | "retry_backoff_strategy", |
| | 2 | 26 | | "retry_delay_applied", |
| | 2 | 27 | | "retry_delay_configured", |
| | 2 | 28 | | "retry_delay_count", |
| | 2 | 29 | | "retry_delay_milliseconds", |
| | 2 | 30 | | "signature_algorithm", |
| | 2 | 31 | | "signing_status", |
| | 2 | 32 | | "total_retry_delay_milliseconds" |
| | 2 | 33 | | }.ToFrozenSet(StringComparer.Ordinal); |
| | | 34 | | |
| | | 35 | | public static bool IsReserved(string? key) |
| | | 36 | | { |
| | 156 | 37 | | return !string.IsNullOrWhiteSpace(key) |
| | 156 | 38 | | && ReservedKeys.Contains(key.Trim()); |
| | | 39 | | } |
| | | 40 | | } |