Skip to content

feat: Add service mapping and defensive global region check for v2 Auth Eventarc triggers#10674

Open
shettyvarun268 wants to merge 3 commits into
mainfrom
feature/autheventarc-service
Open

feat: Add service mapping and defensive global region check for v2 Auth Eventarc triggers#10674
shettyvarun268 wants to merge 3 commits into
mainfrom
feature/autheventarc-service

Conversation

@shettyvarun268

Copy link
Copy Markdown
Contributor

This PR introduces underlying CLI service mapping and defensive trigger region validation for the upcoming v2 Auth Eventarc triggers (google.firebase.auth.user.v2.created and google.firebase.auth.user.v2.deleted). This work is designed to operate directly in tandem with the Auth Eventarc integration currently being developed in the firebase-functions SDK.

During the SDK design review, it was noted that Firebase Auth Eventarc events operate globally and strictly require their Eventarc trigger location to be configured as region: "global". While the Node.js SDK populates this by default, this PR adds a defensive validation layer in the CLI to guarantee that region: "global" is consistently enforced during deployment across all current and future SDKs. To achieve this, this PR officially registers AUTH_EVENTS within the v2 events registry, implements a dedicated authEventarcService helper to defensively verify and override the trigger region to "global", and maps the new event types accordingly. This approach mirrors the established architectural patterns used for other global event services in the CLI, such as Firebase Test Lab and Firebase Alerts.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for Firebase Auth Eventarc triggers, including the registration of the 'autheventarc' service, mapping of the v2 user created and deleted events, and validation to ensure the trigger region is set to 'global'. The review feedback suggests refactoring the region validation function to be async rather than manually returning Promise.resolve(). Additionally, the unit tests should be updated to deep-copy the mock endpoint's nested eventTrigger object to prevent shared state mutation and potential test flakiness.

Comment thread src/deploy/functions/services/authEventarc.ts
Comment thread src/deploy/functions/services/authEventarc.spec.ts
Comment thread src/deploy/functions/services/authEventarc.spec.ts
Comment thread src/deploy/functions/services/authEventarc.spec.ts
@shettyvarun268 shettyvarun268 marked this pull request as ready for review June 17, 2026 19:04
@shettyvarun268 shettyvarun268 requested a review from inlined June 17, 2026 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants