firebase-roles

1.5.1 • Public • Published

firebase-roles

Firebase roles (claims) manipulation in the backend.

Users with the 'admin' claim can read all user claims and update them.

Use in conjunction with the firebase-roles-editor package in the frontend.

Usage

Ensure initializeApp is called on your firebase admin instance before anything else.

In your index.js:

const {endpoints} = require("firebase-roles");

Endpoints are returned in cranny syntax which looks like:

{
    type: 'get',
    route: '/endpointName',
    obj: Func
}

The obj is a function which you should set to run when the endpoint is hit. For example, with express:

  for (const endpoint of endpoints) {
    app[endpoint.type](endpoint.route, endpoint.obj);
  }

Updating IAM for app engine access.

Find the item named "App Engine default service account" in IAM settings in Google Cloud. Add "Secret Manager Secret Accessor" role to it.

Package Sidebar

Install

npm i firebase-roles

Weekly Downloads

2

Version

1.5.1

License

Apache-2.0

Unpacked Size

10.8 kB

Total Files

11

Last publish

Collaborators

  • wtesler