Last active
September 6, 2018 00:51
-
-
Save DennisAlund/5a7b0276cecff3ae7f79f29b74f0197f to your computer and use it in GitHub Desktop.
A sample Firebase database rules file for the article: https://medium.com/evenbit/securing-your-firebase-app-part-2-33260a84dc78
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "rules": { | |
| "queue": { | |
| "tasks": { | |
| "$task_id": { | |
| ".validate": "newData.hasChildren(['apiKey', 'someValue', 'anotherValue']) && root.child('apiKeys').child(apiKey).val() != null", | |
| "apiKey": { | |
| ".validate": "newData.isString()" | |
| }, | |
| "someValue": { | |
| ".validate": "newData.isNumber()" | |
| }, | |
| "anotherValue": { | |
| ".validate": "newData.hasChildren()" | |
| }, | |
| "$other": { | |
| ".validate": "false" | |
| } | |
| } | |
| } | |
| }, | |
| "apiKeys": { | |
| "$apiKey": { | |
| ".validate": "newData.isString()" | |
| }, | |
| ".validate": "newData.hasChildren()" | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment