Socket
Book a DemoInstallSign in
Socket

@cerbos/grpc

Package Overview
Dependencies
Maintainers
2
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cerbos/grpc

Client library for interacting with the Cerbos policy decision point over gRPC from server-side Node.js applications

Source
npmnpm
Version
0.9.2
Version published
Weekly downloads
14K
-10.03%
Maintainers
2
Weekly downloads
 
Created
Source

@cerbos/grpc

npm

Client library for interacting with the Cerbos policy decision point over gRPC from server-side Node.js applications.

Prerequisites

  • Cerbos 0.16+
  • Node.js 14+

Installation

$ npm install @cerbos/grpc

or

$ yarn add @cerbos/grpc

Example usage

import { GRPC } from "@cerbos/grpc";

const cerbos = new GRPC("localhost:3593", { tls: false });

await cerbos.isAllowed({
  principal: {
    id: "user@example.com",
    roles: ["USER"],
    attributes: { tier: "PREMIUM" },
  },
  resource: {
    kind: "document",
    id: "1",
    attributes: { owner: "user@example.com" },
  },
  action: "view",
}); // => true

For more details, see the GRPC class documentation.

Further reading

Get help

FAQs

Package last updated on 23 Mar 2023

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