Open sunweiyang opened 5 years ago
@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?
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 offirebase.json
as an environment variable.