Skip to content
Tracon

IProductionProfileCheck

Namespace Tracon · Assembly Tracon.Abstractions.dll

Answers one production decision while the host starts, for RequireProductionProfile.

public interface IProductionProfileCheck

Checks are registered with TryAddEnumerable and are only resolved when an application actually called RequireProductionProfile, so contributing one costs a host that never calls it nothing.

More than one check may carry the same IProductionProfileCheck.Risk, and the strictest answer wins. That is how a package refines a decision the core cannot see the whole of: the core reads which ITenantContext is bound, the HTTP package adds whether tenant resolution is switched on, and a deployment that satisfies only one of the two is still reported as permissive.

A check is a COMPOSITION question, not a security proof. It reports that a feature is switched on; it says nothing about whether the policy behind it is right.

Lifetime: registered as a singleton and resolved once, while the host starts. It is never resolved again, so it holds no state between calls and needs no thread safety of its own.

Tenant mode: tenant-independent. The gate runs before the first request, so there is no ambient tenant to read and the question it answers is about the deployment rather than about one tenant’s data.

Delivery: no delivery guarantee applies. This is not a delivery seam; IProductionProfileCheck.Evaluate is called once per host start, and a host that never calls RequireProductionProfile never calls it at all.

Gets the decision this check answers.

TraconProductionRisk Risk { get; }

TraconProductionRisk

Answers the decision.

ProductionProfileResult Evaluate(IServiceProvider services)

services IServiceProvider

A SCOPED service provider, so a check may resolve a scoped service. It is valid only for the duration of the call.

ProductionProfileResult

What the check found.

Runs once, while the host starts. An exception thrown here stops the host and names this check: a gate that fails open is worse than no gate.