Repository navigation
security: version Firestore rules/indexes; dev and CI on emulators (PR 1.3) - #11
Merged
Jeston10 merged 2 commits intoSep 20, 2026
Merged
Conversation
PR 1.3 of docs/MILESTONES.md (SECURITY §2.7). - firebase/firestore.rules: deny-all for the client SDK (data access is admin-only). Integration test with @firebase/rules-unit-testing asserts anonymous and owner reads/writes are denied. - firebase/firestore.indexes.json: the three composite indexes mirrored from the production project via the Firestore Admin API; every app query probed read-only against production (RISKS R17 closed: the `userId !=` + orderBy query is valid and indexed). - Emulator mode: FIRESTORE_EMULATOR_HOST / FIREBASE_AUTH_EMULATOR_HOST make the service account optional (cross-field check in config/env.ts, server-only); firebase-admin initialises without credentials; the browser Auth SDK connects to the emulator via NEXT_PUBLIC_FIREBASE_AUTH_EMULATOR_HOST. - scripts/seed-emulator.ts (refuses to run against a real project) and `pnpm dev:emulators` / `pnpm emulators` / `pnpm seed:emulators`. - CI: integration job runs the rules test inside emulators:exec; e2e job now runs the app in emulator mode with seeded data instead of skipping env validation at runtime. firebase-tools pinned as a devDependency. `pnpm test` runs the unit project only. Verified: pnpm lint, typecheck, knip, vitest 24/24 (unit), next build in normal mode, in emulator mode without a service account, and the named error when neither is configured. Rules test runs in CI (local JDK is 19; emulator needs 21). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch had an error being deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR 1.3 of
docs/MILESTONES.md(Phase 1). SECURITY §2.7 — Firestore locked to admin-only access, indexes versioned, and the emulators wired into dev and CI.firebase/firestore.rules— deny-all for the client SDK;tests/integration/firestore-rules.test.ts(rules-unit-testing) asserts anonymous and owner reads/writes are deniedfirebase/firestore.indexes.json— the three composite indexes mirrored from production via the Firestore Admin API (read-only); every query probed against productionconfig/env.ts, server-only); cert-less Admin init; browser Auth SDK → emulatorscripts/seed-emulator.ts(refuses non-emulator targets) +pnpm dev:emulators/pnpm emulators/pnpm seed:emulators;firebase/README.mdSKIP_ENV_VALIDATIONat runtime);firebase-toolspinned;pnpm test= unit project onlyType
Verification
pnpm lint✔ ·typecheck✔ ·knip✔ ·vitest24/24 unit ✔next build: normal mode ✔ · emulator mode with no service account ✔ · neither configured → fails with the named error ✔Server checklist
firebase/README.mdtable)process.env(tooling override, documented); app code still cannotRisk watch-list
Docs
firebase/README.md,CONTRIBUTING.md(emulator workflow),.env.example,docs/RISKS.md🤖 Generated with Claude Code