feat: Add service mapping and defensive global region check for v2 Auth Eventarc triggers#10674
Open
shettyvarun268 wants to merge 3 commits into
Open
feat: Add service mapping and defensive global region check for v2 Auth Eventarc triggers#10674shettyvarun268 wants to merge 3 commits into
shettyvarun268 wants to merge 3 commits into
Conversation
…th Eventarc triggers
Contributor
There was a problem hiding this comment.
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.
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.
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.