{"id":21158160,"url":"https://github.com/node-casbin/redis-adapter","last_synced_at":"2025-07-09T12:33:40.607Z","repository":{"id":40828530,"uuid":"341936239","full_name":"node-casbin/redis-adapter","owner":"node-casbin","description":"Redis adapter for Casbin","archived":false,"fork":false,"pushed_at":"2023-05-18T02:11:29.000Z","size":96,"stargazers_count":2,"open_issues_count":0,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-13T11:40:34.032Z","etag":null,"topics":["access-control","adapter","auth","authorization","casbin","node-casbin","orm","redis"],"latest_commit_sha":null,"homepage":"https://github.com/casbin/node-casbin","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/node-casbin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-24T15:00:41.000Z","updated_at":"2023-03-19T12:11:09.000Z","dependencies_parsed_at":"2022-09-16T01:34:37.661Z","dependency_job_id":null,"html_url":"https://github.com/node-casbin/redis-adapter","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-casbin%2Fredis-adapter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-casbin%2Fredis-adapter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-casbin%2Fredis-adapter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-casbin%2Fredis-adapter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/node-casbin","download_url":"https://codeload.github.com/node-casbin/redis-adapter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225550913,"owners_count":17487204,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["access-control","adapter","auth","authorization","casbin","node-casbin","orm","redis"],"created_at":"2024-11-20T12:16:51.141Z","updated_at":"2024-11-20T12:16:51.858Z","avatar_url":"https://github.com/node-casbin.png","language":"TypeScript","readme":"# casbin-redis-adapter\n\n[![NPM version][npm-image]][npm-url]\n[![NPM download][download-image]][download-url]\n[![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)\n[![Coverage Status](https://coveralls.io/repos/github/node-casbin/redis-adapter/badge.svg?branch=master)](https://coveralls.io/github/node-casbin/redis-adapter?branch=master)\n[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/casbin/lobby)\n\n[npm-image]: https://img.shields.io/npm/v/casbin-redis-adapter.svg?style=flat-square\n\n[npm-url]: https://npmjs.org/package/casbin-redis-adapter\n\n[download-image]: https://img.shields.io/npm/dm/casbin-redis-adapter.svg?style=flat-square\n\n[download-url]: https://npmjs.org/package/casbin-redis-adapter\n\nRedis policy storage, implemented as an adapter for [node-casbin](https://github.com/casbin/node-casbin).\n\n## Installation\n\n```bash\nnpm install --save casbin-redis-adapter\n// or\nyarn add casbin-redis-adapter\n```\n\n## Usage\n\nRequire it in a place, where you are instantiating an\nenforcer ([read more about enforcer here](https://github.com/casbin/node-casbin#get-started)):\n\n```typescript\n\nimport {newEnforcer} from 'casbin';\nimport {NodeRedisAdapter} from './adapter' ;\nimport {join} from 'path';\n\nconst model = join(__dirname, 'casbin_conf/model.conf');\nconst adapter = await NodeRedisAdapter.newAdapter({host: \"127.0.0.1\", port: 6379});\nconst enforcer = await newEnforcer(model, adapter);\n\n```\n\nThat is all what required for integrating the adapter into casbin.\n\n## Configuration\n\n```NodeRedisAdapter.newAdapter()``` takes the following parameters as an object to establish the connection with\nredis-server\n\n```typescript\noptions: interface IConnectionOptions {\n    host: string // IP address of the Redis server\n    port: number //\tPort of the Redis server\n}\n\nredisOpts ? : redis.ClientOpts //https://github.com/NodeRedis/node-redis#options-object-properties\n```\n\n## License\n\n[Apache-2.0](./LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnode-casbin%2Fredis-adapter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnode-casbin%2Fredis-adapter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnode-casbin%2Fredis-adapter/lists"}