سامانه صدور فاکتور و حسابداری
docs: isolate admin provisioning mock QA success from unapproved production auth deployment
davoodmehraban89 committed
Oct 11, 2026 at 20:25 UTC
dbfba6539c02e6fb99514c2fdfd4ebaca3e492ad
1 file changed
+5
PROJECT_STATE.md
+5
@@ -215,3 +215,8 @@ Owner reports login blocked with generic 'check internet/VPN' network error on l
215
- Same-SHA GitHub workflows: Quality `38154361473` **SUCCESS**, Security `38154361524` **SUCCESS**, Release gate `38154485595` **SUCCESS**, gated Pages `38154503667` **SUCCESS**. An earlier duplicate release gate was canceled and earlier Pages job skipped due to workflow concurrency; only these successful runs certify release.
216
- Remote Desktop Commander `DESKTOP-71SJ63M` real Chromium: `npx playwright test scripts/phase0-invoice-persistence.spec.js --reporter=line --workers=1 --timeout=25000` **PASS 2/2 (25.31 s)**. Control sample pre-invoice QA-PINV-0001 saved to disposable fake server, reloaded and edited (3000→4500), persisted once; second sample survived one injected RPC network failure and retry without duplication. No real finance history, live Auth/RLS, Stripe, production data or schema changed.
217
- **Phase 0 remains OPEN / F0-03 controlled QA passed, production-authenticated verification OPEN.** Next: test owner-authenticated sign-in network fault `F0-01`, live tenant product selection `F0-02` and existing invoice print `F0-04` on authorized user session, plus safe-scope actual server persistence for F0-03 if separately authorized. No claim of real live invoice save success.
218
+
219
+## 2026-10-11 Owner central-admin direct user creation — separated security-gated work
220
+- Owner requested creation of normal user account directly from central license panel without requiring prior public self-registration. Existing Supabase Edge Function `admin-user-management` version 1 is ACTIVE with valid JWT requirement, but its deployed v1 contract expects `password` rather than the new `temporary_password`; this branch is **NOT deployed** to avoid frontend/backend mismatch.
221
+- Built server-only function in `supabase/functions/admin-user-management/index.ts` (verified bearer token, profile.role==='admin' fetched server-side, service-role secret confined to runtime, origin allowlist, input validation, strong initial password, creates ordinary new user with existing auth trigger). UI includes a modal and direct admin action. Browser Playwright `scripts/admin-provisioning.spec.js` **PASS 2/2** on remote `DESKTOP-71SJ63M` with mocked edge invocation; static `scripts/admin-provisioning-contract.mjs` PASS, syntax 54 JS/51 MJS PASS. A mock test initially intercepted by login overlay and then Supabase functions getter is fixed; no claim real server creation occurred.
222
+- **SECURITY GATE OPEN / NOT RELEASED:** exact edge function version deployment, QA of non-admin denial and legitimate admin provisioning against an isolated authorized Auth sandbox, quota/uniqueness and failure rollback, safe initial credential transfer and forced reset semantics. Until approved and certified, no real user was created, no credentials handled, no membership RLS changed, no new authorization granted. Do not merge the UI while backend contract remains the deployed v1.