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.
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.
firestore. rules // is a file used to define the security rules for your Firestore database. firestore.
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.
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With