0

I have an open-source project that uses two separate Firebase projects for a test environment and the production one.

Ultimately, I want to have other developers be able to pull down the project and actually be able to run it WITHOUT me needing to give each individual developer access.

I see a number of solutions in this question: How to add collaborators to a Firebase app?. Those all seem to require each person's email.

I understand why it maybe isn't a thing, but I am wondering if there is a way to just give access to everyone for only the test project so that contributing is super low-friction. Something similar to Firestore database rules that allow read/write in a public fashion to get started for testing.

I've tried making a new IAM account in the Google Cloud Console, and I think that partially worked for the Firebase Cloud Functions access to Admin SDK, but my collaborators get hung up trying to run firebase use <test-firebase-project> saying that they don't have access.

I see a lot of other config options for IAM, but nothing sticking out to me for this public access scenario.

Can anyone confirm this either is or isn't a thing?

Thanks!

EDIT

To add some more detail to my project...

I am using Authentication, Firestore, and Cloud Functions. The only js package I will use is the Auth one, which will be loaded from a CDN (so I believe that doesn't apply to my question).

I want to give access to people to run the Cloud Functions locally. There is a pre-build step that I have made in vanilla Node that calls a Cloud Function (running locally), which uses the Firebase Admin SDK to call my Firestore database. I then write that response to a JSON file that my front end uses.

When my collaborators pull down the project, and install the Firebase CLI, when they try to serve the Cloud Functions locally, they get hit with a "no access" type of error. I was trying to resolve this by adding a service account into the /functions directory, but apparently that didn't help.

My collaborators don't need access to the console at all. I basically just need them to be able to run the Cloud Function locally (and make sure they can't access my production Firebase project).

I am happy to add more detail, but I kind of feel like I am just rambling. Thanks again.

pjbrown11
  • 1
  • 1
  • Please edit the question to include which specific Firebase products are in use in the project (database? storage?) and how exactly you would like others to be able to collaborate (access the console? access just data in on product?). Please be as specific as possible. – Doug Stevenson Jan 19 '20 at 16:57
  • I'm not going to put such a function together, but you could probably put together a Firebase Function that accepts an email (maybe at least whitelist it to a domain) that then uses a service account with the appropriate permissions to grant that email access using the [Cloud IAM REST API](https://cloud.google.com/iam/docs/granting-changing-revoking-access). – samthecodingman Jan 19 '20 at 17:02
  • @DougStevenson I tried to add some more detail. Let me know if it is helpful. – pjbrown11 Jan 19 '20 at 19:21
  • @samthecodingman that sounds interesting, and also like more work than I would want. I may rather just "cave" and add users individually than have to support a whole other api. Thanks for the idea, though! – pjbrown11 Jan 19 '20 at 19:22
  • @samthecodingman maybe I spoke too soon. I'll take a look at those docs. Maybe it's easier than I am thinking. – pjbrown11 Jan 19 '20 at 20:14

1 Answers1

0

There is no way to grant everyone contributor access to your Firebase console. You will either have add each individual user, or create your own dashboard that uses the API to show the relevant data.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • Thanks, Frank. I added an edit to the original question. I don't need them to have access to the console at all. Just looking for them to be able to run the ```firebase use ``` command from the CLI. – pjbrown11 Jan 19 '20 at 19:23
  • That's effectively the same thing as console access. – Doug Stevenson Jan 19 '20 at 19:44
  • @DougStevenson ah ok, I did not make that connection. Frank, I am not sure I follow the creating my own dashboard bit. I'm just looking to grant access. So it sounds like the comment from Sam The Coding Man is my closest option. – pjbrown11 Jan 19 '20 at 20:11
  • I feel like this is the sort of thing I am trying to do. https://stackoverflow.com/questions/45437286/firebase-tools-login-as-service-account ... I'll keep researching and post back if I can find a solution. Thanks again, everyone! – pjbrown11 Jan 19 '20 at 21:07