Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

casbin-redis-adapter

Package Overview
Dependencies
Maintainers
4
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

casbin-redis-adapter

[![NPM version][npm-image]][npm-url] [![NPM download][download-image]][download-url] [![CI](https://github.com/node-casbin/redis-adapter/actions/workflows/ci.yml/badge.svg)](https://github.com/node-casbin/redis-adapter/actions/workflows/ci.yml) [![Coverag

  • 1.0.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
17
increased by112.5%
Maintainers
4
Weekly downloads
 
Created
Source

casbin-redis-adapter

NPM version NPM download CI Coverage Status Gitter

Redis policy storage, implemented as an adapter for node-casbin.

Installation

npm install --save casbin-redis-adapter
// or
yarn add casbin-redis-adapter

Usage

Require it in a place, where you are instantiating an enforcer (read more about enforcer here):


import {newEnforcer} from 'casbin';
import {NodeRedisAdapter} from './adapter' ;
import {join} from 'path';

const model = join(__dirname, 'casbin_conf/model.conf');
const adapter = await NodeRedisAdapter.newAdapter({host: "127.0.0.1", port: 6379});
const enforcer = await newEnforcer(model, adapter);

That is all what required for integrating the adapter into casbin.

Configuration

NodeRedisAdapter.newAdapter() takes the following parameters as an object to establish the connection with redis-server

options: interface IConnectionOptions {
    host: string // IP address of the Redis server
    port: number //	Port of the Redis server
}

redisOpts ? : redis.ClientOpts //https://github.com/NodeRedis/node-redis#options-object-properties

License

Apache-2.0

FAQs

Package last updated on 06 Oct 2022

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