Skip to content

NandaKishorJeripothula/node-casbin-redis-adapter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

node-casbin-redis-adapter

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

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 paramters as an object to establish the connection with redis-server

host		:String
port		:Number
password	:String
// if remote server, it needs url
url			:String 
db			:Number
//If the connection is SSL Encrypted then TCL object
tcl			:Object

License

MIT

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

2 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors