w4c-workflows-api/Services/Security/NodeQuotaOptions.cs
2026-09-12 01:02:46 +03:00

27 lines
1 KiB
C#

namespace w4c_workflows.Services.Security;
/// <summary>
/// Resource ceilings for node execution, bound from the <c>Nodes:Quotas</c>
/// configuration section. These are safety limits, not feature flags: they stop
/// a runaway loop or an oversized response from exhausting the worker. A value
/// of <c>0</c> disables the corresponding limit.
/// </summary>
public sealed class NodeQuotaOptions
{
/// <summary>Configuration section this policy binds from.</summary>
public const string SectionName = "Nodes:Quotas";
/// <summary>
/// Outbound requests a single run may issue across all its HTTP nodes,
/// redirect hops included. Guards against a mis-wired loop hammering an
/// external service.
/// </summary>
public int MaxRequestsPerRun { get; set; } = 100;
/// <summary>
/// Largest response body a node will buffer, in bytes. Responses above the
/// cap fail the node instead of being loaded into memory.
/// </summary>
public long MaxResponseBytes { get; set; } = 8 * 1024 * 1024;
}