drf-firebase-auth icon indicating copy to clipboard operation
drf-firebase-auth copied to clipboard

No clear option/documentation for local/staging/production config management

Open sunweiyang opened this issue 4 years ago • 1 comments

Committing firebase.json to a repo should not be the way to deploy a Django server (I have a Heroku Django app, and committing that file is the only way I can use drf-firebase-auth as it exists today). There should be a way to set the contents of firebase.json as an environment variable.

sunweiyang avatar Nov 01 '19 19:11 sunweiyang

@sunweiyang I also didn't want to commit the file or put the file on the filesystem so I dug a little bit and found out that the way drf-firebase-auth sets up the firebase_admin credentials is pretty generic and you can just set the value of FIREBASE_SERVICE_ACCOUNT_KEY to a dict: https://github.com/firebase/firebase-admin-python/blob/master/firebase_admin/credentials.py#L84

So in my code I'm just reading in the json from a secret manager (I happen to be using AWS Secrets Manager), but if you have access to some cloud storage or secret manager, you could just read in the json yourself and parse it to a dict.

Maybe this could be documented?

sherzberg avatar Jan 28 '20 03:01 sherzberg