通过rest api更新安全规则 [英] updating security rules through rest api

查看:130
本文介绍了通过rest api更新安全规则的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有可能通过休息API更新安全规则?我一直试图更新规则,试图更新部分规则的位置,但已经得到400响应代码。



Len



  

> https://YOUR_FIREBASE.firebaseio.com/.settings/rules.json?auth=FIREBASE_SECRET

例如,curl:

pre $ curl -X PUT -d'{rules:{.read:true} }'https://YOUR_FIREBASE.firebaseio.com/.settings/rules.json?auth=FIREBASE_SECRET

您可以从Forge的Auth面板获取Firebase秘密(例如,访问 https://YOUR_FIREBASE.firebaseio.com / 并点击Auth页面)


Is it possible to update security rules through rest api? I have been trying to update rules by trying to update parts of the "rules" location but have been getting 400 response code.

Len

解决方案

You can do a PUT to the following endpoint:

https://YOUR_FIREBASE.firebaseio.com/.settings/rules.json?auth=FIREBASE_SECRET

For example, with curl:

curl -X PUT -d '{ "rules": { ".read": true } }' https://YOUR_FIREBASE.firebaseio.com/.settings/rules.json?auth=FIREBASE_SECRET

You can get your Firebase Secret from the "Auth" panel of Forge (i.e. go to https://YOUR_FIREBASE.firebaseio.com/ and click the "Auth" page)

这篇关于通过rest api更新安全规则的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆