Repository navigation
Activation 2/3: dry-run operator CLI for trusted claims, organizations and memberships - #29
Merged
Merged
Conversation
…ships V2 authority lives in server-managed organization memberships and a Firebase Auth operator claim, but nothing in the repository could create them. This adds a reviewed operator path that runs only with the project owner's local Admin credentials: - inspect / audit-legacy-admins: read-only authority reports that flag forged legacy profile admin flags without trusting them - grant-operator / revoke-operator: set or remove the is_super_admin claim, preserving other claims; revocation also revokes sessions - provision-org / add-member: create schema-validated organization, published context and membership records with append-only audit events; never overwrite, optimistic re-check before membership updates All commands are dry runs unless --apply is given, and --project must equal FIREBASE_PROJECT_ID. Merges the V2 collection-group field overrides into the deployable index file and documents the ordered activation runbook. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017SrzLVR7J3b9nCU177esz8
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f1f3349457
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
This branch was successfully 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.
Why
V2 authority comes from two things: server-managed organization memberships, and the Firebase Auth
is_super_adminclaim that has governed legacy administration since #24. Nothing in the repo could create either one, so no account, including the owner's, can use the redesigned workspace. This adds a reviewed operator path that runs only with the project owner's local Admin credentials. There is no browser or public API.Independent of #28 (server credentials); the two can merge in either order.
What
npm run operator -- <command> --project P ...(scripts/operator.ts, with the logic inserver/v2/operator.ts):inspect --email/--uidis_super_adminwithout trusting it, and lists V2 memberships.audit-legacy-adminsgrant-operator/revoke-operatorprovision-orgorganizations/{id}and a publishedcontext_versions/context-v1. Never overwrites; an existing org with a different name is refused.add-member --rolesSafety:
--apply, and prints the exact before/after changes.--projectmust equalFIREBASE_PROJECT_ID.Organization,ContextVersion,Membership).organizations/{id}/audit_eventsin the same transaction, in the same shape as the existing command-service events.Also:
firestore.v2.indexes.jsonare merged intofirestore.indexes.jsonas a minimal diff, sofirebase deploy --only firestore:indexes(without--force) ships them and keeps unrelated deployed indexes.docs/v2/activation-runbook.mdlists the ordered, reversible activation steps: backup → audit → credentials → claim → org/membership → indexes → rules → flags → acceptance.Not changed
No data, rules, claims or flags are changed by merging. Nothing runs automatically.
Verification
tests/emulator/operator.test.ts(8 tests) covers:getReadinessContextandgetExerciseSetup;inspectandaudit-legacy-adminsreport correctly;security.test.ts: 26/26 pass.typecheck:v2,test:v268/68,test:security52/52.🤖 Generated with Claude Code
https://claude.ai/code/session_017SrzLVR7J3b9nCU177esz8
Generated by Claude Code