prescottprue/cypress-firebase

Remove serviceAccount.json if only using emulator

danvoyce opened this issue · 2 comments

This is more of a question, but possibly a feature request.

If we only plan to use this library with the Firebase emulator, do we really need the serviceAccount.json file? Currently we do, however without this library you can read and write to the local firestore and authenticate without the admin sdk. Not sure about specifying the uid when logging in though?

If it is possible then it would be great to allow that within this library for many reasons. I'm not too keen on storing the serviceAccount.json on my CI, or allowing anyone (inc me!) full access to my live Firebase account. I've already accidentally edited live data when I thought it was using the emulator.

Agreed. If I'm only using firebase for login, I don't think we should require the serviceAccount.json

@danvoyce thanks for reaching out!

v2.0.0 should no longer require serviceAccount.json - To use the auth emulator you should be able to just set FIREBASE_AUTH_EMULATOR_HOST. That said, the serviceAccount should still be used if it is provided as a local file or env variable (useful for testing hosted apps where the tests running in CI need access to the real DB).

Please reach out if this is not the case and we can reopen. I totally agree that there shouldn't be a requirement of a service account