Treasury & Bank Transfer Management System — سامانه مدیریت خزانهداری و حوالههای بانکی
Run branch-contained comprehensive production HTTP guard tests and real local HTTP denial checks
davoodmehraban89 committed
Oct 21, 2026 at 08:46 UTC
5e5eeefef1c6be10b7d8ff99b33e555c7162b48f
1 file changed
+53
.github/workflows/v7-production-http-guard-once.yml
new
+53
@@ -0,0 +1,53 @@
1
+name: V7 foundation production fail-closed HTTP gate regression
2
+on:
3
+ push:
4
+ paths:
5
+ - .github/workflows/v7-production-http-guard-once.yml
6
+ workflow_dispatch:
7
+permissions:
8
+ contents: read
9
+jobs:
10
+ gate:
11
+ runs-on: ubuntu-22.04
12
+ timeout-minutes: 25
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+ with:
16
+ persist-credentials: false
17
+ - uses: actions/setup-node@v4
18
+ with:
19
+ node-version: '22'
20
+ - name: Install
21
+ run: npm ci --ignore-scripts
22
+ - name: Unit tests and typecheck
23
+ run: |
24
+ npm test
25
+ npm run typecheck
26
+ npm run lint
27
+ - name: Production compile
28
+ env:
29
+ NEXT_TELEMETRY_DISABLED: '1'
30
+ run: npm run build
31
+ - name: Exact production smoke with operational denial
32
+ run: npm run smoke
33
+ - name: Production unauthorized API direct HTTP probes
34
+ shell: bash
35
+ run: |
36
+ set -euo pipefail
37
+ export DATABASE_URL=evidence-ref IDENTITY_PROVIDER=oidc-ref AUTH_PROXY_HMAC_SECRET=smoke-secret KMS_KEY_ID=kms-ref SIEM_ENDPOINT=siem-ref WAF_POLICY_ID=waf-ref ALERT_CHANNEL=ops-ref BANK_ADAPTER_MODE=disabled
38
+ node_modules/.bin/next start -p 3102 > /tmp/ts-guard.log 2>&1 &
39
+ pid=$!
40
+ trap 'kill "$pid" 2>/dev/null || true' EXIT
41
+ for i in $(seq 1 40); do
42
+ if curl -fsS http://127.0.0.1:3102/api/ready > /dev/null; then break; fi
43
+ sleep 0.5
44
+ done
45
+ test "$(curl -s -o /dev/null -w '%{http_code}' http://127.0.0.1:3102/api/ready)" = 200
46
+ for endpoint in / /dashboard /payments /accounts /api/transfer/submit /reports/export; do
47
+ status=$(curl -s -o /tmp/ts-gate-response -w '%{http_code}' "http://127.0.0.1:3102$endpoint")
48
+ test "$status" = 403
49
+ grep -q 'دسترسی عملیاتی مسدود است' /tmp/ts-gate-response
50
+ done
51
+ echo 'GATE_PASS_PRODUCTION_ACCESS_DENIES_OPERATIONAL_ROUTES_AND_API'
52
+ - name: No V7 deployment claim
53
+ run: echo 'GATE_PASS_REPO_HTTP_PRODUCTION_GATE_ONLY_NOT_V7_RELEASE'