Firebase客户端对您的实时数据库的访问权限将在X天内到期 [英] Firebase Client access to your Realtime Database expiring in X days

查看:36
本文介绍了Firebase客户端对您的实时数据库的访问权限将在X天内到期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我从firebase收到的邮件.

This is what i got form the mail from firebase.

Firebase Client对您的实时数据库covid-19-tracker-17659的访问将在4天内到期

Firebase Client access to your Realtime Database covid-19-tracker-17659 is expiring in 4 day(s)

您选择开始以测试模式进行开发,这将使您的实时数据库实例完全对Internet开放.由于此选择使您的应用容易受到攻击者的攻击,因此您将数据库安全规则配置为在开始的30天后停止允许请求.

You chose to start developing in Test Mode, which leaves your Realtime Database instance completely open to the Internet. Because this choice makes your app vulnerable to attackers, your database security rules were configured to stop allowing requests after the first 30 days.

在4天内,对您的实时数据库实例的所有客户端请求都将被拒绝.在此之前,请更新您的安全规则,以允许您的应用正常运行,同时适当保护您的数据.每天运行分析;如果您在最近24小时内修改了规则,则这些更改可能不会被考虑在内.

In 4 day(s), all client requests to your Realtime Database instance will be denied. Before that time, please update your security rules to allow your app to function while appropriately protecting your data. Analysis is run daily; if you've modified your rules in the last 24 hours, those changes may not be accounted for.

我的实时数据库规则

{
  "rules": {
    ".read": true,  
    ".write":true  
  }
}

我应该对我的安全规则进行哪些更改,以便我可以在测试模式下运行我的项目.

What changes should i do in my security rules, so that i can run my project still on test mode.

推荐答案

如果您的应用程序不允许客户端进行任何写操作,则可以将写条件从 true 更改为错误,这将使网络上的任何人都无法访问和更改您创建的数据.

If your application doesn't allow any write operations from the client side you can change the write condition from true to false this makes your database impossible for anyone in the web to access and change the data you made.

但是,如果您的应用程序确实允许来自客户端的某些写操作,并且您的应用程序使用登录身份验证,则可以添加此条件以允许那些登录到您的应用程序的用户.

But if your application do allow some write operations from the client side and your application uses login authentication you can add this condition to allow the those users who logged in to your application.

{
  "rules": {
    ".read": "auth != null",  
    ".write":"auth != null"
  }
}

这篇关于Firebase客户端对您的实时数据库的访问权限将在X天内到期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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