Namespace Titanium.Web.Proxy.Options
Classes
ProxyPolicyModes
Immutable snapshot of the PolicyMode selected for each PolicyFamily, plus the one deliberately-separate AllowAmbiguousFraming escape hatch. Read live by enforcement call sites through PolicyModes, which the plan's rollout section requires to be a runtime switch: replacing the whole snapshot (see PolicyModes's setter) rather than mutating a field lets an operator drop every family to Observe without redeploying, while every in-flight request that already read the previous snapshot keeps behaving consistently with whichever snapshot it observed.
AllowAmbiguousFraming is not a PolicyFamily member and has no
corresponding PolicyMode: framing, chunk parsing and
Content-Length/Transfer-Encoding resolution have no safe "detect but let it
through" middle ground, so this is a single named, binary, off-by-default flag that
relays malformed framing instead of rejecting it - useful only for security research that
needs to observe how a client or origin reacts to smuggling-shaped input through the
proxy. No profile sets it: Create(PolicyMode, PolicyMode, PolicyMode, PolicyMode, PolicyMode) never accepts it as a parameter, and the
only way to turn it on is the explicit WithAllowAmbiguousFramingEnabled()
call, so enabling it can never be a side effect of selecting a profile.
ProxyProfileSettings
The full bundle of settings one ProxyProfile applies to a ProxyServer as a single atomic assignment via Profile. Deliberately a plain data bundle, not a type with behavior: applying it is ProxyServer's job (see Profile's setter), so this type has no back-reference and no side effects of its own, per the plan's "Constraints on the policy layer" section.
ProxyResourceLimits
Immutable, validated snapshot of the resource bounds a peer can make the proxy allocate: header shape, body/decompression budgets, concurrency and abuse-rate ceilings, and pool / certificate-cache sizing. Constructed only through Create(long, int, long, long?, long?, double?, int?, int, int?, int, TimeSpan, bool, int, int?), which validates every field up front, so an invalid limit is a construction-time exception rather than a runtime surprise discovered mid-connection.
A limit that can legitimately be turned off is typed as nullable with
null meaning "disabled" - an explicit state - rather than overloading
0 or a negative number to mean the same thing. Limits that must always be
enforced because disabling them would leave the proxy itself exploitable (the
concurrent-stream cap, the open-header-block frame bound) are non-nullable and always
validated to be strictly positive.
This type has no back-reference to ProxyServer and no mutable state after construction: it is meant to be handed down to subsystems by value, not looked up through a service locator or an ambient static, so the dependency graph among consumers stays acyclic per the plan's "Constraints on the policy layer" section.
ProxyTimeoutOptions
Immutable, validated snapshot of every deadline the proxy enforces across a request's
lifetime, expressed consistently as TimeSpan rather than the mixture of
"seconds as int" properties this replaces
(ConnectionTimeOutSeconds, ConnectTimeOutSeconds, ...). A deadline that can be
legitimately unbounded is nullable, with null meaning "no deadline" as an
explicit state rather than Zero or a magic sentinel duration.
This type only holds values; it does not decide which deadline fired first when several are composed for one request. That is the responsibility of the per-request deadline registry described in the plan's "Deadline composition" section, introduced alongside the header-parsing deadlines in a later item so it can be exercised by a real caller instead of landing as unused scaffolding.
ResolvedSessionPolicy
Read-only snapshot combining ProxyResourceLimits and ProxyTimeoutOptions into the single object H1/H2/H3/WebSocket subsystems are handed, so runtime mutation of either half cannot produce inconsistent enforcement partway through a request that started under a different combination of the two.
Per the plan's "Constraints on the policy layer" section, this type is deliberately inert: no back-pointer to ProxyServer, no service-locator lookup, no mutable fields, no static ambient accessor. Subsystems receive it as a constructor argument or method parameter only, so the dependency graph among consumers stays acyclic - the opposite of how ProxyServer itself is reached today.
Per the plan's "Two-phase policy resolution" section, a single resolution per connection is
not correct: SessionEventArgs.MaxBufferedBodyBytes is contractually settable from
BeforeRequest, and HTTP/3 already reads the request body before BeforeRequest
fires. This type does not itself perform either resolution phase - that is the
responsibility of the call sites introduced in later hardening-plan items, once there is a
real per-session override path to resolve against - but it is deliberately shaped so a
caller can hold one instance at headers-complete time (ResourceLimits's
framing/header-shape fields, which are never overridable) and, if a session lowers a body or
streaming budget in BeforeRequest, build a second instance via Create(ProxyResourceLimits, ProxyTimeoutOptions)
that shares the same Timeouts but substitutes a ProxyResourceLimits
reflecting the override, rather than mutating the first instance in place.
Enums
PolicyFamily
The resource-bound policy families that support an PolicyMode other than
Enforce, per the plan's rollout section. Framing, chunk parsing and
Content-Length/Transfer-Encoding resolution are deliberately not members of this
enum: they are always enforced and never consult a mode, because there is no safe
Observe action for an ambiguous or malformed message - see
ProxyPolicyModes and AllowAmbiguousFraming for the one explicit,
isolated escape hatch from that rule.
PolicyMode
How a resource-bound policy family is applied once its numeric limit is breached, per the plan's "Rollout, profiles and documentation" section.
Not every family supports every mode. Framing, chunk parsing and
Content-Length/Transfer-Encoding resolution have no Observe
mode at all: an ambiguous chunk size or a conflicting length can only be forwarded (a
desync) or rejected, so those call sites are unconditionally enforced and never consult a
PolicyMode. ProxyPolicyModes exists for the families where a
safe "detect but let it through" middle ground is actually possible.
ProxyProfile
The three shipped profiles, per the plan's "Rollout, profiles and documentation" section. Selecting a profile via Profile applies its ProxyProfileSettings atomically to resource limits, policy modes, TLS protocols, private-network blocking, admission caps, and deadline-second properties, so a caller can never observe a half-applied profile.