Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
casbin-couchdb-adapter
Advanced tools
CouchDB policy storage, implemented as an adapter for node-casbin.
NPM:
npm install casbin-couchdb-adapter --save
Yarn:
yarn add casbin-couchdb-adapter
import { newEnforcer } from 'casbin';
import { CouchdbAdapter } from 'casbin-couchdb-adapter';
import { join } from 'path';
async function myFunction() {
// Initialize a CouchdbAdapter adapter and use it in a Node-Casbin enforcer:
const adapter = await CouchdbAdapter.newAdapter("http://admin:password@localhost:5984");
// The location of your Casbin model configuration file
const model = join(__dirname, 'casbin_conf/model.conf');
const enforcer = await newEnforcer(model, adapter);
// Check the permission.
enforcer.enforce('alice', 'data1', 'read');
// Modify the policy.
// await enforcer.addPolicy(...);
// await enforcer.removePolicy(...);
// Save the policy back to DB.
await enforcer.savePolicy();
}
You need to create a database named "casbin"
and a document like this:
{
"_id": "policies",
"value": []
}
CouchdbAdapter.newAdapter()
takes the following parameters as an object to establish the connection with couchdb-server
databaseUrl: string = "http://{admin}:{password}@{ip}:{port}"
This project is under Apache 2.0 License. See the LICENSE file for the full license text.
FAQs
CouchDB adapter for Casbin
The npm package casbin-couchdb-adapter receives a total of 0 weekly downloads. As such, casbin-couchdb-adapter popularity was classified as not popular.
We found that casbin-couchdb-adapter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.