Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
281 views
in Technique[技术] by (71.8m points)

python - Firebase: limited and secure service access from Pyrebase?

When using Firebase's server API, you can provide additional databaseAuthVariableOverride section to limit access of the service account, as described in the docs. I wanted to use Pyrebase, as it's in python and supports using service accounts. However, if I log in using a service account there, it has full access to the database -- the validation rules before write are not checked (while I do want them to be checked).

So, there are two parts to this question:

  1. Is it possible to add support for databaseAuthVariableOverride into Pyrebase at all? I see it uses Firebase REST API, and I don't know if that supports it, and where should I send that variable.
  2. I can work around this issue by not using the service account, but a normal email/password account set to a particular email, and add root read/write rules checking auth.email === '<my-email> and/or auth.uid === '<my-account-uid>'. Question here is: is this equally secure as using a service account with limited access (as linked on the top)?
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...