Description:
In part 4 of 'Use case tutorials / Closed-Loop Psychophysics Study / 4 - Connect Workflow With Firestore [https://autoresearch.github.io/autora/examples/closed-loop-basic/init-autora/]: The student/user is asked to transcribe login details from firebase into their learning project. Firebased provides the respective login details as a .json file, the user transcribes them into a python dictionary. This process could easily be automated by simply asking the user to drop the json file into the folder, and load it in python with via 'json.load(file)', resulting in exactly the required dictionary.
Current behavior:
The user is asked to manually transcribe the information.
Proposed behavior:
Ask the user to drag&drop the file into the folder. Load the json in python as a dictionary. Add the json file into the .gitignore for the user
Proposed benefit:
- less work for users learnign autora
- removing firebase credentials from commonly publicly shared repositories for the users (note many students might not be aware of this risk)
Proposed fixes:
- replace relevant code:
Is currently:
firebase_credentials = {
"type": "type",
"project_id": "project_id",
"private_key_id": "private_key_id",
"private_key": "private_key",
"client_email": "client_email",
"client_id": "client_id",
"auth_uri": "auth_uri",
"token_uri": "token_uri",
"auth_provider_x509_cert_url": "auth_provider_x509_cert_url",
"client_x509_cert_url": "client_x509_cert_url"
}
Should be:
import json
[...]
with open('firebase_user_credentials_placeholder.json', 'r') as f:
data = json.load(f)
[include this file also in .gitignore by default for security reasons]