Class GovernanceMetadataBudgetValidator
Provides optional normalization and budget validation helpers for host-owned governance metadata.
public static class GovernanceMetadataBudgetValidator
- Inheritance
-
GovernanceMetadataBudgetValidator
- Inherited Members
Remarks
This helper does not classify, redact, encrypt, or sanitize sensitive values. Hosts should treat successful validation as a bounded-shape check only and still apply their own privacy, DLP, retention, and signing policies before durable storage or emission.
Methods
EstimateSerializedSizeBytes(IReadOnlyDictionary<string, string>?)
Estimates the UTF-8 serialized size of normalized metadata for budget comparison.
public static int EstimateSerializedSizeBytes(IReadOnlyDictionary<string, string>? metadata)
Parameters
metadataIReadOnlyDictionary<string, string>
Returns
Normalize(IReadOnlyDictionary<string, string>?)
Normalizes metadata by trimming keys and values, removing blank keys, and using ordinal key comparison.
public static IReadOnlyDictionary<string, string> Normalize(IReadOnlyDictionary<string, string>? metadata)
Parameters
metadataIReadOnlyDictionary<string, string>
Returns
NormalizeAndValidate(IReadOnlyDictionary<string, string>?, GovernanceMetadataBudget?, string?)
Normalizes and validates metadata, throwing when the supplied metadata exceeds the budget.
public static IReadOnlyDictionary<string, string> NormalizeAndValidate(IReadOnlyDictionary<string, string>? metadata, GovernanceMetadataBudget? budget = null, string? parameterName = null)
Parameters
metadataIReadOnlyDictionary<string, string>budgetGovernanceMetadataBudgetparameterNamestring
Returns
Validate(IReadOnlyDictionary<string, string>?, GovernanceMetadataBudget?)
Validates metadata against the recommended budget or a host-supplied budget.
public static GovernanceMetadataBudgetValidationResult Validate(IReadOnlyDictionary<string, string>? metadata, GovernanceMetadataBudget? budget = null)
Parameters
metadataIReadOnlyDictionary<string, string>budgetGovernanceMetadataBudget