Etcd watcher for Node-Casbin

Clone this repo:
  1. 85ed232 chore(release): 1.0.0 [skip ci] by semantic-release-bot · 5 years ago master v1.0.0
  2. 11e814f chore: fix build by Zixuan Liu · 5 years ago
  3. 9e61e9f fix: upgrade TypeScript for building by Zixuan Liu · 5 years ago
  4. ffda564 ci: add GitHub Actions by Zixuan Liu · 5 years ago
  5. 8ad9031 fix: export and docs by Zixuan Liu · 5 years ago

etcd-watcher

ETCD watcher for node-casbin

Installation

# NPM
npm install --save @casbin/etcd-watcher

# Yarn
yarn add @casbin/etcd-watcher

Simple Example

import EtcdWatcher from '@casbin/etcd-watcher';
import { newEnforcer } from 'casbin';

// Initialize the watcher.
const watcher = await EtcdWatcher.newWatcher('http://127.0.0.1:2379');

// Initialize the enforcer.
const enforcer = await newEnforcer('examples/authz_model.conf', 'examples/authz_policy.csv');

enforcer.setWatcher(watcher);