31 lines
841 B
C#
31 lines
841 B
C#
using System;
|
|
using static StellaOps.Localization.T;
|
|
|
|
namespace StellaOps.Configuration;
|
|
|
|
/// <summary>
|
|
/// Options controlling escalation enforcement for acknowledgement flows.
|
|
/// </summary>
|
|
public sealed class AuthorityEscalationOptions
|
|
{
|
|
/// <summary>
|
|
/// Scope required to mint or execute escalation-bearing ack tokens.
|
|
/// </summary>
|
|
public string Scope { get; set; } = "notify.escalate";
|
|
|
|
/// <summary>
|
|
/// When true, escalation requires the caller to also possess <c>notify.admin</c>.
|
|
/// </summary>
|
|
public bool RequireAdminScope { get; set; } = true;
|
|
|
|
internal void Validate()
|
|
{
|
|
if (string.IsNullOrWhiteSpace(Scope))
|
|
{
|
|
throw new InvalidOperationException(_t("config.escalation.scope_required"));
|
|
}
|
|
|
|
Scope = Scope.Trim().ToLowerInvariant();
|
|
}
|
|
}
|