Add a step to the crashlytics:web:onboard command to grant read acces… - #10963
Add a step to the crashlytics:web:onboard command to grant read acces…#10963bryanatkinson wants to merge 2 commits into
Conversation
…s to the newly created firebase-telemetry log bucket to project viewers and editors. They always have this access to the _Default bucket, but this needs to be done explicitly for custom buckets like this.
There was a problem hiding this comment.
Code Review
This pull request adds support for managing IAM policies on Cloud Logging Log Views and integrates this into the Crashlytics onboarding flow to grant view accessor permissions to project viewers and editors. The feedback highlights a critical issue where thrown FirebaseError instances in getLogViewIamPolicy and setLogViewIamPolicy do not propagate the HTTP status code in their options, causing the status to default to 500 and breaking downstream checks (such as the 404 status check in grantLogViewAccess).
| throw new FirebaseError( | ||
| `Failed to get IAM policy for log view ${viewId} on bucket ${bucketId} (status ${err.status}): ${msg}`, | ||
| { original: err }, | ||
| ); |
There was a problem hiding this comment.
The thrown FirebaseError does not propagate the HTTP status code (err.status) in its options. This causes the status property of the resulting FirebaseError to default to 500 (via DEFAULT_STATUS), which breaks downstream status checks (such as err.status === 404 in grantLogViewAccess). Propagating status: err.status in the options ensures the correct status code is preserved.
| throw new FirebaseError( | |
| `Failed to get IAM policy for log view ${viewId} on bucket ${bucketId} (status ${err.status}): ${msg}`, | |
| { original: err }, | |
| ); | |
| throw new FirebaseError( | |
| `Failed to get IAM policy for log view ${viewId} on bucket ${bucketId} (status ${err.status}): ${msg}`, | |
| { original: err, status: err.status }, | |
| ); |
| throw new FirebaseError( | ||
| `Failed to set IAM policy for log view ${viewId} on bucket ${bucketId} (status ${err.status}): ${msg}`, | ||
| { original: err }, | ||
| ); |
There was a problem hiding this comment.
The thrown FirebaseError does not propagate the HTTP status code (err.status) in its options. This causes the status property of the resulting FirebaseError to default to 500 (via DEFAULT_STATUS). Propagating status: err.status in the options ensures the correct status code is preserved.
| throw new FirebaseError( | |
| `Failed to set IAM policy for log view ${viewId} on bucket ${bucketId} (status ${err.status}): ${msg}`, | |
| { original: err }, | |
| ); | |
| throw new FirebaseError( | |
| `Failed to set IAM policy for log view ${viewId} on bucket ${bucketId} (status ${err.status}): ${msg}`, | |
| { original: err, status: err.status }, | |
| ); |
Add a step to the crashlytics:web:onboard command to grant read access to the newly created firebase-telemetry log bucket to project viewers and editors. They always have this access to the _Default bucket, but this needs to be done explicitly for custom buckets like this.