Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the name of the language used for Cloud Firestore security rules?

I would like to know the name of the syntax used for the Cloud Firestore security rules as described at https://firebase.google.com/docs/firestore/security/get-started?authuser=0. I would like to find syntax highlighter for that syntax and maybe parsers for it.

like image 678
wcandillon Avatar asked Oct 06 '17 07:10

wcandillon


People also ask

What is firestore security rules?

Cloud Firestore Security Rules allow you to control access to documents and collections in your database. The flexible rules syntax allows you to create rules that match anything, from all writes to the entire database to operations on a specific document.

What file should be used for firestore rules firestore rules?

firestore. rules // is a file used to define the security rules for your Firestore database. firestore.

Does cloud firestore use SQL?

Cloud Firestore is a NoSQL, document-oriented database. Unlike a SQL database, there are no tables or rows. Instead, you store data in documents, which are organized into collections. Each document contains a set of key-value pairs.

Where are the Firebase security rules?

To access your rules from the Firebase console, select your project, then navigate to Realtime Database, Cloud Firestore or Storage. Click Rules once you're in the correct database or storage bucket. To access your rules from the Firebase CLI, go to the rules file noted in your firebase. json file.


2 Answers

Firebase Security Rules is a custom DSL.

Condition expressions are JS like, and should work with one of those. The path matching framework is less common, but we're working on providing the grammar + additional tooling (syntax highlighting, parsing, type checking, evaluators) in the future.

For those interested in the history, the semantics are closely related to XACML, we just wanted to provide better (non-XML) syntax.

like image 97
Mike McDonald Avatar answered Oct 27 '22 18:10

Mike McDonald


You can find a syntax highlighting plugin for Visual Studio here: https://github.com/toba/vsfire

I adapted the plugin for Atom: https://github.com/jaysquared/atom-firestore-grammar

like image 24
jaysquared.com Avatar answered Oct 27 '22 16:10

jaysquared.com