30 lines
864 B
C#
30 lines
864 B
C#
using System.Collections.Immutable;
|
|
|
|
namespace StellaOps.Aoc;
|
|
|
|
public sealed record AocGuardOptions
|
|
{
|
|
private static readonly ImmutableHashSet<string> DefaultRequiredTopLevel = new[]
|
|
{
|
|
"tenant",
|
|
"source",
|
|
"upstream",
|
|
"content",
|
|
"linkset",
|
|
}.ToImmutableHashSet(StringComparer.OrdinalIgnoreCase);
|
|
|
|
public static AocGuardOptions Default { get; } = new();
|
|
|
|
public ImmutableHashSet<string> RequiredTopLevelFields { get; init; } = DefaultRequiredTopLevel;
|
|
|
|
/// <summary>
|
|
/// When true, signature metadata is required under upstream.signature.
|
|
/// </summary>
|
|
public bool RequireSignatureMetadata { get; init; } = true;
|
|
|
|
/// <summary>
|
|
/// When true, tenant must be a non-empty string.
|
|
/// </summary>
|
|
public bool RequireTenant { get; init; } = true;
|
|
}
|