Comparing version 3.4.6 to 3.4.7-1
@@ -6,3 +6,3 @@ var EventEmitter = require('events').EventEmitter; | ||
var async = require('async'); | ||
var NativeZk = require(__dirname + '/../build/Release/zookeeper.node').ZooKeeper; | ||
var NativeZk = require(__dirname + '/../build/zookeeper.node').ZooKeeper; | ||
@@ -292,2 +292,17 @@ // with Node 0.5.x and greater, EventEmitter is pure-js, so we make a simple wrapper... | ||
ZooKeeper.prototype.a_get_acl = function a_get_acl () { | ||
if(this.logger) this.logger("Calling a_get_acl with " + util.inspect(arguments)); | ||
return this._native.a_get_acl.apply(this._native, arguments); | ||
}; | ||
ZooKeeper.prototype.a_set_acl = function a_get_acl () { | ||
if(this.logger) this.logger("Calling a_set_acl with " + util.inspect(arguments)); | ||
return this._native.a_set_acl.apply(this._native, arguments); | ||
}; | ||
ZooKeeper.prototype.add_auth = function a_get_acl () { | ||
if(this.logger) this.logger("Calling add_auth with " + util.inspect(arguments)); | ||
return this._native.add_auth.apply(this._native, arguments); | ||
}; | ||
ZooKeeper.prototype.mkdirp = function (p, cb) { | ||
@@ -298,2 +313,7 @@ if(this.logger) this.logger("Calling mkdirp with " + util.inspect(arguments)); | ||
ZooKeeper.prototype.a_sync = function a_sync() { | ||
if(this.logger) this.logger("Calling a_sync " + util.inspect(arguments)); | ||
return this._native.a_sync.apply(this._native, arguments); | ||
} | ||
// | ||
@@ -300,0 +320,0 @@ // ZK does not support ./file or /dir/../file |
{ | ||
"name": "zookeeper" | ||
,"description": "apache zookeeper client (zookeeper async API >= 3.4.0)" | ||
,"version": "3.4.6" | ||
,"version": "3.4.7-1" | ||
,"author": "Yuri Finkelstein <yurif2003@yahoo.com>" | ||
@@ -14,2 +14,4 @@ ,"contributors": [ | ||
,"Jakub Lekstan <kuebzky@gmail.com>" | ||
,"Matt Lavin <matt.lavin@gmail.com>" | ||
,"Roy Cheng <roy.b.cheng@newegg.com>" | ||
] | ||
@@ -22,16 +24,17 @@ ,"repository": { | ||
,"dependencies": { | ||
"async": "~0.1.18" | ||
"async": "~0.2.6" | ||
,"nan": "~2.0.9" | ||
,"underscore": "*" | ||
} | ||
,"devDependencies": { | ||
"log4js": "~0.4.3" | ||
,"webworker": ">=0.8.2" | ||
"log4js": "~0.6.0" | ||
,"webworker": ">=0.8.4" | ||
} | ||
,"main": "lib/index" | ||
,"directories.lib": "build/default/" | ||
,"scripts" : { | ||
"build" : "node-gyp configure build" | ||
,"test" : "pushd test; ./test; popd" | ||
,"prepublish" : "./scripts/prepublish.sh" | ||
} | ||
,"engines": { "node": ">=0.6" } | ||
,"engines": { "node": ">=0.8" } | ||
} |
@@ -14,3 +14,3 @@ # Overview | ||
,timeout: 200000 | ||
,debug_level: ZooKeeper.ZOO_LOG_LEVEL_WARNING | ||
,debug_level: ZooKeeper.ZOO_LOG_LEVEL_WARN | ||
,host_order_deterministic: false | ||
@@ -49,3 +49,7 @@ }); | ||
* (trailing `_` is added to avoid conflict with reserved word `_delete_` since zk_promise.js strips off prefix `a_` from all operations) | ||
* a_set_acl ( path, version, acl, void_cb ) | ||
* a_get_acl ( path, acl_cb ) | ||
* add_auth ( scheme, auth ) | ||
*The watcher methods are forward-looking subscriptions that can recieve multiple callbacks whenever a matching event occurs.* | ||
@@ -67,2 +71,3 @@ | ||
* watch_cb : function ( type, state, path ) | ||
* acl_cb : function (rc, error, acl, stat) | ||
@@ -77,2 +82,5 @@ ### Input Parameters ### | ||
* watch : boolean | ||
* scheme : authorisation scheme (digest, auth) | ||
* auth : authorisation credentials (username:password) | ||
* acl : acls list (same as output parameter, look below) - read only | ||
@@ -97,5 +105,9 @@ ### Output Parameters ### | ||
* string ephemeralOwner // owner session id if ephemeral, 0 otw | ||
* int dataLength //length of the data in the node | ||
* int numChildren //number of children of this node | ||
* int dataLength // length of the data in the node | ||
* int numChildren // number of children of this node | ||
* long pzxid // last modified children | ||
* acl is an array of acls objects, single acl object has following key | ||
* int perms // permisions | ||
* string scheme // authorisation scheme (digest, auth) | ||
* string auth // authorisation credentials (username:hashed_password) | ||
@@ -106,5 +118,58 @@ | ||
### ACL and authorisation ### | ||
It's supported now, library comes with 3 default ACL levels defined (comes from ZK): | ||
* ZooKeeper.ZOO_OPEN_ACL_UNSAFE - anyone can do anything | ||
* ZooKeeper.ZOO_READ_ACL_UNSAFE - anyone can read | ||
* ZooKeeper.ZOO_CREATOR_ALL_ACL - gives full rights to authorised user (you have to be authorised first, otherwise it will result with "invalid acl") | ||
If you don't want to use predefined ACLs you can define your own (the ACL object is described above), for limiting permisions you can use: | ||
* ZooKeeper.ZOO_PERM_READ - read permission | ||
* ZooKeeper.ZOO_PERM_WRITE - write permission | ||
* ZooKeeper.ZOO_PERM_CREATE - create permission | ||
* ZooKeeper.ZOO_PERM_DELETE - delete permission | ||
* ZooKeeper.ZOO_PERM_ADMIN - admin permission | ||
* ZooKeeper.ZOO_PERM_ALL - all of the above | ||
Example: | ||
```javascript | ||
var ZooKeeper = require("zookeeper"); | ||
zk = new ZooKeeper({ | ||
connect: "localhost:2181", | ||
timeout: 2000, | ||
}); | ||
var key = "/acl-test"; | ||
zk.connect(function (err, client) { | ||
if (err) throw err; | ||
console.log("zoolocker: Connected to Zookeeper, id=%s", zk.client_id); | ||
client.add_auth("digest", "username:password", function (rc, error) { | ||
console.log("ADD_AUTH", rc, error); | ||
client.a_create(key, "", { | ||
version: -1 | ||
}, function (rc, error, path) { | ||
console.log("CREATE", rc, error); | ||
client.a_set_acl(key, -1, [ZooKeeper.ZOO_CREATOR_ALL_ACL, ZooKeeper.ZOO_OPEN_ACL_UNSAFE, { | ||
perms: ZooKeeper.ZOO_PERM_WRITE, | ||
scheme: "world", | ||
auth: "anyone", | ||
}], function (rc, error) { | ||
console.log("SET_ACL", rc, error); | ||
client.a_get_acl(key, function (rc, error, acl, stat) { | ||
console.log("GET_ACL", rc, error, acl); | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); | ||
``` | ||
For more details please refer to ZooKeeper docs. | ||
# Limitations | ||
* no zookeeper ACL support | ||
* no support for authentication | ||
* passing acl to a_create is not possible | ||
* tests are not standalone, must run a zk server (easiest if you run at localhost:2181, if not you must pass the connect string to the tests) | ||
@@ -238,1 +303,3 @@ * only asynchronous ZK methods are implemented. Hey, this is node.js ... no sync calls are allowed | ||
- Mark Cavage (mcavage) | ||
- Jakub Lekstan (kuebk) | ||
- Matt Lavin (mdlavin) |
@@ -6,2 +6,4 @@ var ZK = require ('../lib/zookeeper'); | ||
var connect = (process.argv[2] || 'localhost:2181'); | ||
// | ||
@@ -49,3 +51,3 @@ // based on node-leader | ||
var options = { | ||
zookeeper: 'localhost:2181', | ||
zookeeper: connect, | ||
log4js: log4js | ||
@@ -52,0 +54,0 @@ }; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
Copyleft License
License(Experimental) Copyleft license information was found.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
Non-permissive License
License(Experimental) A license not known to be considered permissive was found.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 2 instances in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
5159540
135
1872
299
3
5
70
2
7
+ Addednan@~2.0.9
+ Addedasync@0.2.10(transitive)
+ Addednan@2.0.9(transitive)
- Removedasync@0.1.22(transitive)
Updatedasync@~0.2.6