V26 · Firebase emulator thật hơn

Chuẩn hóa luồng local emulator trước khi chạm môi trường thật.

V26 gom Auth emulator, Firestore emulator, seed, rules, submit API, audit viewer và CI vào một runtime local có boundary rõ.

Tóm tắt

3 service · 4 gate · firebase emulators:start --only auth,firestore

Chỉ dùng local emulator; không seed demo vào development/staging/production.

127.0.0.1:9099

auth

Mô phỏng Firebase Auth và custom claims trong local.

127.0.0.1:8080

firestore

Lưu dữ liệu demo, chạy security rules, kiểm thử write path.

127.0.0.1:4000

ui

Quan sát dữ liệu local không chứa dữ liệu thật.

quality gate

npm run firestore:rules:test:v26

Trước khi: deploy security.rules

Security rules chưa bảo vệ đúng boundary participant/organization/audit.

quality gate

npm run firestore:seed:admin:v26

Trước khi: manual QA hoặc API demo

Seed local không đúng collection schema hoặc đang cố seed ngoài emulator.

quality gate

npm run api:firestore-emulator-submit:check

Trước khi: kết nối API với Firestore adapter thật

Submit path có nguy cơ bỏ qua auth/consent/audit.

quality gate

npm run audit:firestore-viewer:check

Trước khi: mở dashboard audit nội bộ

Audit viewer có nguy cơ lộ dữ liệu cá nhân thô hoặc cho role không phù hợp.