New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

firebase-rule-generator

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

firebase-rule-generator

A node app which converts JSON BD schemas into Firebase Firestore Rules

  • 0.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

firebase-rule-generator (WIP)

An app which converts JSON DB schemas into Firebase Firestore Rules.

Sample Input:

{
  "users": {
    "_frug_": {
      "read": "TBD"
    },
    "uid": {
      "uid": "uid",
      "given_name": "string",
      "favorite_color": "/^(yo)?u\s+can\s+RegEx$/"
    }
  }
}

Sample Output:

service cloud.firestore {
  match /databases/{database}/documents {

    function inData() {
      return request.resource.data;
    }

    function inAuth() {
      return request.auth
    }

    function isUser() {
      return inData().uid == inAuth().uid &&
        inData().given_name is string &&
        inData().favorite_color.matches('^(yo)?u\s+can\s+RegEx$');
    }

    match /users/{uid} {
      allow write: if isUser();
    }
  }
}

Keywords

FAQs

Package last updated on 16 Aug 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc