Treasury & Bank Transfer Management System — سامانه مدیریت خزانهداری و حوالههای بانکی
Fail-close production HTTP ingress with explicit gate regression tests: src/platform/identity/production-http-guard.ts
davoodmehraban89 committed
Oct 21, 2026 at 08:45 UTC
1eb547de902170a98fd34c19931bd6941a9bf974
1 file changed
+9
src/platform/identity/production-http-guard.ts
new
+9
@@ -0,0 +1,9 @@
1
+/** Default-deny HTTP boundary for unprovisioned production deployments. */
2
+export function isProductionOperationBlocked(
3
+ env: Readonly<Record<string,string|undefined>>,
4
+ pathname: string
5
+): boolean {
6
+ if (env.NODE_ENV !== 'production' || env.TREASURYFLOW_DESKTOP_LOCAL === '1') return false;
7
+ // Only a public readiness endpoint and the login view are non-operational.
8
+ return pathname !== '/api/ready' && pathname !== '/login';
9
+}