Giter VIP home page Giter VIP logo

node-ldapauth's Introduction

Note: This repo is unmaintained and has been for a while. If you are interested in taking over this repo, then please let me know (trentm at google's email thing).


A simple node.js lib to authenticate against an LDAP server.

Usage

var LdapAuth = require('ldapauth');
var options = {
    url: 'ldaps://ldap.example.com:663',
    ...
};
var auth = new LdapAuth(options);
...
auth.authenticate(username, password, function(err, user) { ... });
...
auth.close(function(err) { ... })

Install

npm install ldapauth

License

MIT. See "LICENSE" file.

LdapAuth Config Options

Use the source Luke

express/connect basicAuth example

var connect = require('connect');
var LdapAuth = require('ldapauth');

// Config from a .json or .ini file or whatever.
var config = {
  ldap: {
    url: "ldaps://ldap.example.com:636",
    adminDn: "uid=myadminusername,ou=users,o=example.com",
    adminPassword: "mypassword",
    searchBase: "ou=users,o=example.com",
    searchFilter: "(uid={{username}})"
  }
};

var ldap = new LdapAuth({
  url: config.ldap.url,
  adminDn: config.ldap.adminDn,
  adminPassword: config.ldap.adminPassword,
  searchBase: config.ldap.searchBase,
  searchFilter: config.ldap.searchFilter,
  //log4js: require('log4js'),
  cache: true
});

var basicAuthMiddleware = connect.basicAuth(function (username, password, callback) {
  ldap.authenticate(username, password, function (err, user) {
    if (err) {
      console.log("LDAP auth error: %s", err);
    }
    callback(err, user)
  });
});

Development

Check coding style before commit:

make check

To cut a release (tagging, npm publish, etc., see https://github.com/trentm/cutarelease for details):

make cutarelease

node-ldapauth's People

Contributors

esya avatar jacques avatar melloc avatar ricardohbin avatar trentm avatar vesse avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-ldapauth's Issues

LDAP auth not working

i have older passport and passport-ldap package with that authentication is working and when installed the latest package authentication is not happening its giving Unauthorized as output.
this is my code:

`
var express = require('express'),
passport = require('passport'),
bodyParser = require('body-parser'),
LdapStrategy = require('passport-ldapauth');

process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
var OPTS = {
server: {
url: "ldaps://--------------"
bindDn: 'ZGN',
bindCredentials: 'password',
searchBase: 'DC=---------,DC=-----',
searchFilter: '(samaccountName={{username}})',
searchAttributes: ["displayName", "givenName", "mail", "title", "telephoneNumber", "samaccountname", "userPrincipalName"],
}
// ,
// usernameField: 'username',
// passwordField: 'password'
};

var app = express();

passport.use(new LdapStrategy(OPTS));

app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended: false}));
app.use(passport.initialize());

app.post('/login', passport.authenticate('ldapauth', {session: false}), function(req, res) {
res.send({status: 'ok'});
});
//API call with parameter
// {
// "username":"coreid",
// "password":"password"
// }

app.listen(8080);
`

Assertion error

When I run my node server using example code i got following error

 throw new assert.AssertionError({
        ^
AssertionError: "undefined" == true
    at new LdapAuth (/home/hitesh/node/exp2/node_modules/ldapauth/lib/ldapauth.js:56:10)
    at Object.<anonymous> (/home/hitesh/node/exp2/app.js:16:12)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:901:3```

Cache misses every time

Hello,

been using you wonderful lib to secure our ReST endpoint on NodeJS. Now, I activated the cache feature to ease the burdon on our LDAP server, however, looking at the log output, it seems that the every authentication ends up in a cache miss. Really strange, because I did notice while debugging that the code goes through the cache.set(username, ...).

Any ideas? I'm running version 2.2.4 BTW
-wim

Search Sub Groups.

I took over some code so bare with me here, just trying to figure this out:

we are using version 2.2.2:

This works, however if a user is a member of a group that is a subgroup, we aren't able to determine that, is there a way to specify that we want to expand the memberof to include the subgroups that he/she belongs to?

var approved = 0;
ldapconfig.permittedGroups.forEach(function(p) {
user.memberOf.forEach(function(g) {
console.log(g);
if(g == p.group) {
console.log('Hey this group matched!!!');
// Choose the smallest non-zero value encountered
if(!approved || (approved > p.security)) {
approved = p.security;
}
console.log(creds.username + " in approved group " + p.group + " with security " + p.security);
}
});
});

Right now I only get the groups this user is spefically a member of, if he/she is a member of a child group of another group we never know with this code. Is there a better/easier way to determine what parent groups the user is a member of?

Thanks in advance.

Return attributes

Contracting for a company that has a really slow LDAP server/network + returns massive LDAP records. I can't do anything about the slow server but it would be nice to specify the return attributes of the record instead of the whole record.

I've already modified it to work like that but the change is way too small to justify a fork (was only one line). Basically on line 119 of /lib/ldapauth.js, change:

var opts = {filter: searchFilter, scope: 'sub'};

to

var opts = {filter: searchFilter, scope: 'sub', attributes: ['Name', 'Email', 'BustSize']};

PS: The BustSize attribute is required! :)

npm release

What is the ETA of releasing current version to npm? Thank you.

npm install fail

npm -v
2.7.4

node -v
v0.12.2

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.2 LTS
Release: 14.04
Codename: trusty

make: Entering directory /test/node_modules/ldapauth/node_modules/bcrypt/build' CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt.o CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt_node.o ../src/bcrypt_node.cc: In destructor ‘virtual {anonymous}::baton_base::~baton_base()’: ../src/bcrypt_node.cc:118:18: error: ‘class v8::Persistent<v8::Function>’ has no member named ‘Dispose’ callback.Dispose(); ^ ../src/bcrypt_node.cc: At global scope: ../src/bcrypt_node.cc:198:19: error: variable or field ‘GenSaltAsync’ declared void void GenSaltAsync(uv_work_t* req) { ^ ../src/bcrypt_node.cc:198:19: error: ‘uv_work_t’ was not declared in this scope ../src/bcrypt_node.cc:198:30: error: ‘req’ was not declared in this scope void GenSaltAsync(uv_work_t* req) { ^ ../src/bcrypt_node.cc:483:30: error: expected ‘}’ at end of input NODE_MODULE(bcrypt_lib, init); ^ ../src/bcrypt_node.cc:85:13: warning: ‘void crypto_lock_init()’ defined but not used [-Wunused-function] static void crypto_lock_init(void) { ^ ../src/bcrypt_node.cc:95:13: warning: ‘void crypto_lock_cb(int, int, const char*, int)’ defined but not used [-Wunused-function] static void crypto_lock_cb(int mode, int n, const char* file, int line) { ^ ../src/bcrypt_node.cc:105:22: warning: ‘long unsigned int crypto_id_cb()’ defined but not used [-Wunused-function] static unsigned long crypto_id_cb(void) { ^ make: *** [Release/obj.target/bcrypt_lib/src/bcrypt_node.o] Error 1 make: Leaving directory/test/node_modules/ldapauth/node_modules/bcrypt/build'
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23)
gyp ERR! stack at ChildProcess.emit (events.js:110:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Linux 3.13.0-52-generic
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /test/node_modules/ldapauth/node_modules/bcrypt
gyp ERR! node -v v0.12.2
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok

[email protected] install /test/node_modules/ldapauth/node_modules/ldapjs/node_modules/buffertools
node-gyp rebuild

make: Entering directory /test/node_modules/ldapauth/node_modules/ldapjs/node_modules/buffertools/build' CXX(target) Release/obj.target/buffertools/buffertools.o ../buffertools.cc:19:52: error: ‘Arguments’ does not name a type Handle<Value> apply(Handle<Object>& buffer, const Arguments& args, HandleScope& scope); ^ ../buffertools.cc:19:63: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive] Handle<Value> apply(Handle<Object>& buffer, const Arguments& args, HandleScope& scope); ^ ../buffertools.cc:21:33: error: ‘Arguments’ does not name a type Handle<Value> operator()(const Arguments& args) { ^ ../buffertools.cc:21:44: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive] Handle<Value> operator()(const Arguments& args) { ^ ../buffertools.cc: In member function ‘v8::Handle<v8::Value> {anonymous}::UnaryAction<Derived>::operator()(const int&)’: ../buffertools.cc:24:29: error: request for member ‘This’ in ‘args’, which is of non-class type ‘const int’ Local<Object> self = args.This(); ^ ../buffertools.cc:26:47: error: ‘New’ is not a member of ‘v8::String’ return ThrowException(Exception::TypeError(String::New( ^ ../buffertools.cc:27:45: error: there are no arguments to ‘ThrowException’ that depend on a template parameter, so a declaration of ‘ThrowException’ must be available [-fpermissive] "Argument should be a buffer object."))); ^ ../buffertools.cc:27:45: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated) ../buffertools.cc: At global scope: ../buffertools.cc:35:86: error: ‘Arguments’ does not name a type Handle<Value> apply(Handle<Object>& buffer, const uint8_t* data, size_t size, const Arguments& args, HandleScope& scope); ^ ../buffertools.cc:35:97: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive] Handle<Value> apply(Handle<Object>& buffer, const uint8_t* data, size_t size, const Arguments& args, HandleScope& scope); ^ ../buffertools.cc:37:33: error: ‘Arguments’ does not name a type Handle<Value> operator()(const Arguments& args) { ^ ../buffertools.cc:37:44: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive] Handle<Value> operator()(const Arguments& args) { ^ ../buffertools.cc: In member function ‘v8::Handle<v8::Value> {anonymous}::BinaryAction<Derived>::operator()(const int&)’: ../buffertools.cc:40:29: error: request for member ‘This’ in ‘args’, which is of non-class type ‘const int’ Local<Object> self = args.This(); ^ ../buffertools.cc:42:47: error: ‘New’ is not a member of ‘v8::String’ return ThrowException(Exception::TypeError(String::New( ^ ../buffertools.cc:43:45: error: there are no arguments to ‘ThrowException’ that depend on a template parameter, so a declaration of ‘ThrowException’ must be available [-fpermissive] "Argument should be a buffer object."))); ^ ../buffertools.cc:46:13: error: invalid types ‘const int[int]’ for array subscript if (args[0]->IsString()) { ^ ../buffertools.cc:47:30: error: invalid types ‘const int[int]’ for array subscript String::Utf8Value s(args[0]->ToString()); ^ ../buffertools.cc:50:33: error: invalid types ‘const int[int]’ for array subscript if (Buffer::HasInstance(args[0])) { ^ ../buffertools.cc:51:32: error: invalid types ‘const int[int]’ for array subscript Local<Object> other = args[0]->ToObject(); ^ ../buffertools.cc:56:80: error: ‘New’ is not a member of ‘v8::String’ static Persistent<String> illegalArgumentException = Persistent<String>::New(String::New( ^ ../buffertools.cc:58:70: error: no matching function for call to ‘v8::Exception::TypeError(v8::Persistent<v8::String>&)’ return ThrowException(Exception::TypeError(illegalArgumentException)); ^ ../buffertools.cc:58:70: note: candidate is: In file included from ../buffertools.cc:1:0: /home/grp_ddoservice/.node-gyp/0.12.2/deps/v8/include/v8.h:3946:23: note: static v8::Local<v8::Value> v8::Exception::TypeError(v8::Handle<v8::String>) static Local<Value> TypeError(Handle<String> message); ^ /home/grp_ddoservice/.node-gyp/0.12.2/deps/v8/include/v8.h:3946:23: note: no known conversion for argument 1 from ‘v8::Persistent<v8::String>’ to ‘v8::Handle<v8::String>’ ../buffertools.cc:58:71: error: there are no arguments to ‘ThrowException’ that depend on a template parameter, so a declaration of ‘ThrowException’ must be available [-fpermissive] return ThrowException(Exception::TypeError(illegalArgumentException)); ^ ../buffertools.cc: At global scope: ../buffertools.cc:104:52: error: ‘Arguments’ does not name a type Handle<Value> apply(Handle<Object>& buffer, const Arguments& args, HandleScope& scope) { ^ ../buffertools.cc:104:63: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive] Handle<Value> apply(Handle<Object>& buffer, const Arguments& args, HandleScope& scope) { ^ ../buffertools.cc:110:52: error: ‘Arguments’ does not name a type Handle<Value> apply(Handle<Object>& buffer, const Arguments& args, HandleScope& scope) { ^ ../buffertools.cc:110:63: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive] Handle<Value> apply(Handle<Object>& buffer, const Arguments& args, HandleScope& scope) { ^ ../buffertools.cc: In member function ‘v8::Handle<v8::Value> {anonymous}::FillAction::apply(v8::Handle<v8::Object>&, const int&, v8::HandleScope&)’: ../buffertools.cc:111:13: error: invalid types ‘const int[int]’ for array subscript if (args[0]->IsInt32()) { ^ ../buffertools.cc:112:18: error: invalid types ‘const int[int]’ for array subscript int c = args[0]->ToInt32()->Int32Value(); ^ ../buffertools.cc:116:13: error: invalid types ‘const int[int]’ for array subscript if (args[0]->IsString()) { ^ ../buffertools.cc:117:30: error: invalid types ‘const int[int]’ for array subscript String::Utf8Value s(args[0]->ToString()); ^ ../buffertools.cc:121:33: error: invalid types ‘const int[int]’ for array subscript if (Buffer::HasInstance(args[0])) { ^ ../buffertools.cc:122:33: error: invalid types ‘const int[int]’ for array subscript Handle<Object> other = args[0]->ToObject(); ^ ../buffertools.cc:128:80: error: ‘New’ is not a member of ‘v8::String’ static Persistent<String> illegalArgumentException = Persistent<String>::New(String::New( ^ ../buffertools.cc:130:70: error: no matching function for call to ‘v8::Exception::TypeError(v8::Persistent<v8::String>&)’ return ThrowException(Exception::TypeError(illegalArgumentException)); ^ ../buffertools.cc:130:70: note: candidate is: In file included from ../buffertools.cc:1:0: /home/grp_ddoservice/.node-gyp/0.12.2/deps/v8/include/v8.h:3946:23: note: static v8::Local<v8::Value> v8::Exception::TypeError(v8::Handle<v8::String>) static Local<Value> TypeError(Handle<String> message); ^ /home/grp_ddoservice/.node-gyp/0.12.2/deps/v8/include/v8.h:3946:23: note: no known conversion for argument 1 from ‘v8::Persistent<v8::String>’ to ‘v8::Handle<v8::String>’ ../buffertools.cc:130:71: error: ‘ThrowException’ was not declared in this scope return ThrowException(Exception::TypeError(illegalArgumentException)); ^ ../buffertools.cc: At global scope: ../buffertools.cc:137:52: error: ‘Arguments’ does not name a type Handle<Value> apply(Handle<Object>& buffer, const Arguments& args, HandleScope& scope) { ^ ../buffertools.cc:137:63: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive] Handle<Value> apply(Handle<Object>& buffer, const Arguments& args, HandleScope& scope) { ^ ../buffertools.cc:149:86: error: ‘Arguments’ does not name a type Handle<Value> apply(Handle<Object>& buffer, const uint8_t* data, size_t size, const Arguments& args, HandleScope& scope) { ^ ../buffertools.cc:149:97: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive] Handle<Value> apply(Handle<Object>& buffer, const uint8_t* data, size_t size, const Arguments& args, HandleScope& scope) { ^ ../buffertools.cc: In member function ‘v8::Handle<v8::Value> {anonymous}::EqualsAction::apply(v8::Handle<v8::Object>&, const uint8_t*, size_t, const int&, v8::HandleScope&)’: ../buffertools.cc:150:50: error: too few arguments to function ‘v8::Handle<v8::Boolean> v8::True(v8::Isolate*)’ return compare(buffer, data, size) == 0 ? True() : False(); ^ In file included from ../buffertools.cc:1:0: /home/grp_ddoservice/.node-gyp/0.12.2/deps/v8/include/v8.h:6624:17: note: declared here Handle<Boolean> True(Isolate* isolate) { ^ ../buffertools.cc:150:60: error: too few arguments to function ‘v8::Handle<v8::Boolean> v8::False(v8::Isolate*)’ return compare(buffer, data, size) == 0 ? True() : False(); ^ In file included from ../buffertools.cc:1:0: /home/grp_ddoservice/.node-gyp/0.12.2/deps/v8/include/v8.h:6633:17: note: declared here Handle<Boolean> False(Isolate* isolate) { ^ ../buffertools.cc: At global scope: ../buffertools.cc:155:86: error: ‘Arguments’ does not name a type Handle<Value> apply(Handle<Object>& buffer, const uint8_t* data, size_t size, const Arguments& args, HandleScope& scope) { ^ ../buffertools.cc:155:97: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive] Handle<Value> apply(Handle<Object>& buffer, const uint8_t* data, size_t size, const Arguments& args, HandleScope& scope) { ^ ../buffertools.cc: In member function ‘v8::Handle<v8::Value> {anonymous}::CompareAction::apply(v8::Handle<v8::Object>&, const uint8_t*, size_t, const int&, v8::HandleScope&)’: ../buffertools.cc:156:16: error: ‘class v8::HandleScope’ has no member named ‘Close’ return scope.Close(Integer::New(compare(buffer, data, size))); ^ ../buffertools.cc:156:62: error: no matching function for call to ‘v8::Integer::New(int)’ return scope.Close(Integer::New(compare(buffer, data, size))); ^ ../buffertools.cc:156:62: note: candidate is: In file included from ../buffertools.cc:1:0: /home/grp_ddoservice/.node-gyp/0.12.2/deps/v8/include/v8.h:2012:25: note: static v8::Local<v8::Integer> v8::Integer::New(v8::Isolate*, int32_t) static Local<Integer> New(Isolate* isolate, int32_t value); ^ /home/grp_ddoservice/.node-gyp/0.12.2/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided ../buffertools.cc: At global scope: ../buffertools.cc:161:88: error: ‘Arguments’ does not name a type Handle<Value> apply(Handle<Object>& buffer, const uint8_t* data2, size_t size2, const Arguments& args, HandleScope& scope) { ^ ../buffertools.cc:161:99: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive] Handle<Value> apply(Handle<Object>& buffer, const uint8_t* data2, size_t size2, const Arguments& args, HandleScope& scope) { ^ ../buffertools.cc: In member function ‘v8::Handle<v8::Value> {anonymous}::IndexOfAction::apply(v8::Handle<v8::Object>&, const uint8_t*, size_t, const int&, v8::HandleScope&)’: ../buffertools.cc:165:25: error: invalid types ‘const int[int]’ for array subscript int32_t start = args[1]->Int32Value(); ^ ../buffertools.cc:176:16: error: ‘class v8::HandleScope’ has no member named ‘Close’ return scope.Close(Integer::New(offset)); ^ ../buffertools.cc:176:41: error: no matching function for call to ‘v8::Integer::New(const ptrdiff_t&)’ return scope.Close(Integer::New(offset)); ^ ../buffertools.cc:176:41: note: candidate is: In file included from ../buffertools.cc:1:0: /home/grp_ddoservice/.node-gyp/0.12.2/deps/v8/include/v8.h:2012:25: note: static v8::Local<v8::Integer> v8::Integer::New(v8::Isolate*, int32_t) static Local<Integer> New(Isolate* isolate, int32_t value); ^ /home/grp_ddoservice/.node-gyp/0.12.2/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided ../buffertools.cc: At global scope: ../buffertools.cc:194:84: error: ‘Arguments’ does not name a type inline Handle<Value> decodeHex(const uint8_t* const data, const size_t size, const Arguments& args, HandleScope& scope) { ^ ../buffertools.cc:194:95: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive] inline Handle<Value> decodeHex(const uint8_t* const data, const size_t size, const Arguments& args, HandleScope& scope) { ^ ../buffertools.cc: In function ‘v8::Handle<v8::Value> {anonymous}::decodeHex(const uint8_t*, size_t, const int&, v8::HandleScope&)’: ../buffertools.cc:196:42: error: ‘New’ is not a member of ‘v8::String’ return ThrowException(Exception::Error(String::New( ^ ../buffertools.cc:197:57: error: ‘ThrowException’ was not declared in this scope "Odd string length, this is not hexadecimal data."))); ^ ../buffertools.cc:201:24: error: no matching function for call to ‘v8::String::Empty()’ return String::Empty(); ^ ../buffertools.cc:201:24: note: candidate is: In file included from ../buffertools.cc:1:0: /home/grp_ddoservice/.node-gyp/0.12.2/deps/v8/include/v8.h:6247:15: note: static v8::Local<v8::String> v8::String::Empty(v8::Isolate*) Local<String> String::Empty(Isolate* isolate) { ^ /home/grp_ddoservice/.node-gyp/0.12.2/deps/v8/include/v8.h:6247:15: note: candidate expects 1 argument, 0 provided ../buffertools.cc:204:50: error: ‘class v8::Object’ has no member named ‘handle_’ Handle<Object>& buffer = Buffer::New(size / 2)->handle_; ^ ../buffertools.cc:214:43: error: ‘New’ is not a member of ‘v8::String’ return ThrowException(Exception::Error(String::New( ^ ../buffertools.cc:215:39: error: ‘ThrowException’ was not declared in this scope "This is not hexadecimal data."))); ^ ../buffertools.cc: At global scope: ../buffertools.cc:225:52: error: ‘Arguments’ does not name a type Handle<Value> apply(Handle<Object>& buffer, const Arguments& args, HandleScope& scope) { ^ ../buffertools.cc:225:63: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive] Handle<Value> apply(Handle<Object>& buffer, const Arguments& args, HandleScope& scope) { ^ ../buffertools.cc:233:52: error: ‘Arguments’ does not name a type Handle<Value> apply(Handle<Object>& buffer, const Arguments& args, HandleScope& scope) { ^ ../buffertools.cc:233:63: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive] Handle<Value> apply(Handle<Object>& buffer, const Arguments& args, HandleScope& scope) { ^ ../buffertools.cc: In member function ‘v8::Handle<v8::Value> {anonymous}::ToHexAction::apply(v8::Handle<v8::Object>&, const int&, v8::HandleScope&)’: ../buffertools.cc:238:25: error: no matching function for call to ‘v8::String::Empty()’ return String::Empty(); ^ ../buffertools.cc:238:25: note: candidate is: In file included from ../buffertools.cc:1:0: /home/grp_ddoservice/.node-gyp/0.12.2/deps/v8/include/v8.h:6247:15: note: static v8::Local<v8::String> v8::String::Empty(v8::Isolate*) Local<String> String::Empty(Isolate* isolate) { ^ /home/grp_ddoservice/.node-gyp/0.12.2/deps/v8/include/v8.h:6247:15: note: candidate expects 1 argument, 0 provided ../buffertools.cc:248:16: error: ‘class v8::HandleScope’ has no member named ‘Close’ return scope.Close(String::New(s.c_str(), s.size())); ^ ../buffertools.cc:248:22: error: ‘New’ is not a member of ‘v8::String’ return scope.Close(String::New(s.c_str(), s.size())); ^ ../buffertools.cc: At global scope: ../buffertools.cc:255:27: error: ‘Arguments’ does not name a type Handle<Value> Clear(const Arguments& args) { ^ ../buffertools.cc:255:38: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive] Handle<Value> Clear(const Arguments& args) { ^ ../buffertools.cc:259:26: error: ‘Arguments’ does not name a type Handle<Value> Fill(const Arguments& args) { ^ ../buffertools.cc:259:37: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive] Handle<Value> Fill(const Arguments& args) { ^ ../buffertools.cc:263:29: error: ‘Arguments’ does not name a type Handle<Value> Reverse(const Arguments& args) { ^ ../buffertools.cc:263:40: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive] Handle<Value> Reverse(const Arguments& args) { ^ ../buffertools.cc:267:28: error: ‘Arguments’ does not name a type Handle<Value> Equals(const Arguments& args) { ^ ../buffertools.cc:267:39: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive] Handle<Value> Equals(const Arguments& args) { ^ ../buffertools.cc:271:29: error: ‘Arguments’ does not name a type Handle<Value> Compare(const Arguments& args) { ^ ../buffertools.cc:271:40: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive] Handle<Value> Compare(const Arguments& args) { ^ ../buffertools.cc:275:29: error: ‘Arguments’ does not name a type Handle<Value> IndexOf(const Arguments& args) { ^ ../buffertools.cc:275:40: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive] Handle<Value> IndexOf(const Arguments& args) { ^ ../buffertools.cc:279:29: error: ‘Arguments’ does not name a type Handle<Value> FromHex(const Arguments& args) { ^ ../buffertools.cc:279:40: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive] Handle<Value> FromHex(const Arguments& args) { ^ ../buffertools.cc:283:27: error: ‘Arguments’ does not name a type Handle<Value> ToHex(const Arguments& args) { ^ ../buffertools.cc:283:38: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive] Handle<Value> ToHex(const Arguments& args) { ^ ../buffertools.cc:287:28: error: ‘Arguments’ does not name a type Handle<Value> Concat(const Arguments& args) { ^ ../buffertools.cc:287:39: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive] Handle<Value> Concat(const Arguments& args) { ^ In file included from ../buffertools.cc:1:0: /home/grp_ddoservice/.node-gyp/0.12.2/deps/v8/include/v8.h: In function ‘v8::Handle<v8::Value> {anonymous}::Concat(const int&)’: /home/grp_ddoservice/.node-gyp/0.12.2/deps/v8/include/v8.h:816:13: error: ‘v8::HandleScope::HandleScope()’ is protected V8_INLINE HandleScope() {} ^ ../buffertools.cc:288:14: error: within this context HandleScope scope; ^ ../buffertools.cc:291:36: error: request for member ‘Length’ in ‘args’, which is of non-class type ‘const int’ for (int index = 0, length = args.Length(); index < length; ++index) { ^ ../buffertools.cc:292:32: error: invalid types ‘const int[int]’ for array subscript Local<Value> arg = args[index]; ^ ../buffertools.cc:305:8: error: ‘New’ is not a member of ‘v8::String’ String::New(s.str().c_str()))); ^ ../buffertools.cc:305:37: error: ‘ThrowException’ was not declared in this scope String::New(s.str().c_str()))); ^ ../buffertools.cc:309:8: error: expected primary-expression before ‘&’ token Buffer& dst = *Buffer::New(size); ^ ../buffertools.cc:309:10: error: ‘dst’ was not declared in this scope Buffer& dst = *Buffer::New(size); ^ ../buffertools.cc:312:36: error: request for member ‘Length’ in ‘args’, which is of non-class type ‘const int’ for (int index = 0, length = args.Length(); index < length; ++index) { ^ ../buffertools.cc:313:32: error: invalid types ‘const int[int]’ for array subscript Local<Value> arg = args[index]; ^ ../buffertools.cc:327:43: error: ‘New’ is not a member of ‘v8::String’ return ThrowException(Exception::Error(String::New( ^ ../buffertools.cc:329:61: error: ‘ThrowException’ was not declared in this scope "Please make the world a better place and report it."))); ^ ../buffertools.cc:333:15: error: ‘class v8::HandleScope’ has no member named ‘Close’ return scope.Close(dst.handle_); ^ ../buffertools.cc: In function ‘void {anonymous}::RegisterModule(v8::Handle<v8::Object>)’: ../buffertools.cc:337:14: error: ‘NewSymbol’ is not a member of ‘v8::String’ target->Set(String::NewSymbol("concat"), FunctionTemplate::New(Concat)->GetFunction()); ^ ../buffertools.cc:337:72: error: no matching function for call to ‘v8::FunctionTemplate::New(v8::Handle<v8::Value> (&)(const int&))’ target->Set(String::NewSymbol("concat"), FunctionTemplate::New(Concat)->GetFunction()); ^ ../buffertools.cc:337:72: note: candidate is: In file included from ../buffertools.cc:1:0: /home/grp_ddoservice/.node-gyp/0.12.2/deps/v8/include/v8.h:3455:34: note: static v8::Local<v8::FunctionTemplate> v8::FunctionTemplate::New(v8::Isolate*, v8::FunctionCallback, v8::Handle<v8::Value>, v8::Handle<v8::Signature>, int) static Local<FunctionTemplate> New( ^ /home/grp_ddoservice/.node-gyp/0.12.2/deps/v8/include/v8.h:3455:34: note: no known conversion for argument 1 from ‘v8::Handle<v8::Value>(const int&)’ to ‘v8::Isolate*’ ../buffertools.cc:338:14: error: ‘NewSymbol’ is not a member of ‘v8::String’ target->Set(String::NewSymbol("fill"), FunctionTemplate::New(Fill)->GetFunction()); ^ ../buffertools.cc:338:70: error: no matching function for call to ‘v8::FunctionTemplate::New(v8::Handle<v8::Value> (&)(const int&))’ target->Set(String::NewSymbol("fill"), FunctionTemplate::New(Fill)->GetFunction()); ^ ../buffertools.cc:338:70: note: candidate is: In file included from ../buffertools.cc:1:0: /home/grp_ddoservice/.node-gyp/0.12.2/deps/v8/include/v8.h:3455:34: note: static v8::Local<v8::FunctionTemplate> v8::FunctionTemplate::New(v8::Isolate*, v8::FunctionCallback, v8::Handle<v8::Value>, v8::Handle<v8::Signature>, int) static Local<FunctionTemplate> New( ^ /home/grp_ddoservice/.node-gyp/0.12.2/deps/v8/include/v8.h:3455:34: note: no known conversion for argument 1 from ‘v8::Handle<v8::Value>(const int&)’ to ‘v8::Isolate*’ ../buffertools.cc:339:14: error: ‘NewSymbol’ is not a member of ‘v8::String’ target->Set(String::NewSymbol("clear"), FunctionTemplate::New(Clear)->GetFunction()); ^ ../buffertools.cc:339:71: error: no matching function for call to ‘v8::FunctionTemplate::New(v8::Handle<v8::Value> (&)(const int&))’ target->Set(String::NewSymbol("clear"), FunctionTemplate::New(Clear)->GetFunction()); ^ ../buffertools.cc:339:71: note: candidate is: In file included from ../buffertools.cc:1:0: /home/grp_ddoservice/.node-gyp/0.12.2/deps/v8/include/v8.h:3455:34: note: static v8::Local<v8::FunctionTemplate> v8::FunctionTemplate::New(v8::Isolate*, v8::FunctionCallback, v8::Handle<v8::Value>, v8::Handle<v8::Signature>, int) static Local<FunctionTemplate> New( ^ /home/grp_ddoservice/.node-gyp/0.12.2/deps/v8/include/v8.h:3455:34: note: no known conversion for argument 1 from ‘v8::Handle<v8::Value>(const int&)’ to ‘v8::Isolate*’ ../buffertools.cc:340:14: error: ‘NewSymbol’ is not a member of ‘v8::String’ target->Set(String::NewSymbol("reverse"), FunctionTemplate::New(Reverse)->GetFunction()); ^ ../buffertools.cc:340:73: error: no matching function for call to ‘v8::FunctionTemplate::New(v8::Handle<v8::Value> (&)(const int&))’ target->Set(String::NewSymbol("reverse"), FunctionTemplate::New(Reverse)->GetFunction()); ^ ../buffertools.cc:340:73: note: candidate is: In file included from ../buffertools.cc:1:0: /home/grp_ddoservice/.node-gyp/0.12.2/deps/v8/include/v8.h:3455:34: note: static v8::Local<v8::FunctionTemplate> v8::FunctionTemplate::New(v8::Isolate*, v8::FunctionCallback, v8::Handle<v8::Value>, v8::Handle<v8::Signature>, int) static Local<FunctionTemplate> New( ^ /home/grp_ddoservice/.node-gyp/0.12.2/deps/v8/include/v8.h:3455:34: note: no known conversion for argument 1 from ‘v8::Handle<v8::Value>(const int&)’ to ‘v8::Isolate*’ ../buffertools.cc:341:14: error: ‘NewSymbol’ is not a member of ‘v8::String’ target->Set(String::NewSymbol("equals"), FunctionTemplate::New(Equals)->GetFunction()); ^ ../buffertools.cc:341:72: error: no matching function for call to ‘v8::FunctionTemplate::New(v8::Handle<v8::Value> (&)(const int&))’ target->Set(String::NewSymbol("equals"), FunctionTemplate::New(Equals)->GetFunction()); ^ ../buffertools.cc:341:72: note: candidate is: In file included from ../buffertools.cc:1:0: /home/grp_ddoservice/.node-gyp/0.12.2/deps/v8/include/v8.h:3455:34: note: static v8::Local<v8::FunctionTemplate> v8::FunctionTemplate::New(v8::Isolate*, v8::FunctionCallback, v8::Handle<v8::Value>, v8::Handle<v8::Signature>, int) static Local<FunctionTemplate> New( ^ /home/grp_ddoservice/.node-gyp/0.12.2/deps/v8/include/v8.h:3455:34: note: no known conversion for argument 1 from ‘v8::Handle<v8::Value>(const int&)’ to ‘v8::Isolate*’ ../buffertools.cc:342:14: error: ‘NewSymbol’ is not a member of ‘v8::String’ target->Set(String::NewSymbol("compare"), FunctionTemplate::New(Compare)->GetFunction()); ^ ../buffertools.cc:342:73: error: no matching function for call to ‘v8::FunctionTemplate::New(v8::Handle<v8::Value> (&)(const int&))’ target->Set(String::NewSymbol("compare"), FunctionTemplate::New(Compare)->GetFunction()); ^ ../buffertools.cc:342:73: note: candidate is: In file included from ../buffertools.cc:1:0: /home/grp_ddoservice/.node-gyp/0.12.2/deps/v8/include/v8.h:3455:34: note: static v8::Local<v8::FunctionTemplate> v8::FunctionTemplate::New(v8::Isolate*, v8::FunctionCallback, v8::Handle<v8::Value>, v8::Handle<v8::Signature>, int) static Local<FunctionTemplate> New( ^ /home/grp_ddoservice/.node-gyp/0.12.2/deps/v8/include/v8.h:3455:34: note: no known conversion for argument 1 from ‘v8::Handle<v8::Value>(const int&)’ to ‘v8::Isolate*’ ../buffertools.cc:343:14: error: ‘NewSymbol’ is not a member of ‘v8::String’ target->Set(String::NewSymbol("indexOf"), FunctionTemplate::New(IndexOf)->GetFunction()); ^ ../buffertools.cc:343:73: error: no matching function for call to ‘v8::FunctionTemplate::New(v8::Handle<v8::Value> (&)(const int&))’ target->Set(String::NewSymbol("indexOf"), FunctionTemplate::New(IndexOf)->GetFunction()); ^ ../buffertools.cc:343:73: note: candidate is: In file included from ../buffertools.cc:1:0: /home/grp_ddoservice/.node-gyp/0.12.2/deps/v8/include/v8.h:3455:34: note: static v8::Local<v8::FunctionTemplate> v8::FunctionTemplate::New(v8::Isolate*, v8::FunctionCallback, v8::Handle<v8::Value>, v8::Handle<v8::Signature>, int) static Local<FunctionTemplate> New( ^ /home/grp_ddoservice/.node-gyp/0.12.2/deps/v8/include/v8.h:3455:34: note: no known conversion for argument 1 from ‘v8::Handle<v8::Value>(const int&)’ to ‘v8::Isolate*’ ../buffertools.cc:344:14: error: ‘NewSymbol’ is not a member of ‘v8::String’ target->Set(String::NewSymbol("fromHex"), FunctionTemplate::New(FromHex)->GetFunction()); ^ ../buffertools.cc:344:73: error: no matching function for call to ‘v8::FunctionTemplate::New(v8::Handle<v8::Value> (&)(const int&))’ target->Set(String::NewSymbol("fromHex"), FunctionTemplate::New(FromHex)->GetFunction()); ^ ../buffertools.cc:344:73: note: candidate is: In file included from ../buffertools.cc:1:0: /home/grp_ddoservice/.node-gyp/0.12.2/deps/v8/include/v8.h:3455:34: note: static v8::Local<v8::FunctionTemplate> v8::FunctionTemplate::New(v8::Isolate*, v8::FunctionCallback, v8::Handle<v8::Value>, v8::Handle<v8::Signature>, int) static Local<FunctionTemplate> New( ^ /home/grp_ddoservice/.node-gyp/0.12.2/deps/v8/include/v8.h:3455:34: note: no known conversion for argument 1 from ‘v8::Handle<v8::Value>(const int&)’ to ‘v8::Isolate*’ ../buffertools.cc:345:14: error: ‘NewSymbol’ is not a member of ‘v8::String’ target->Set(String::NewSymbol("toHex"), FunctionTemplate::New(ToHex)->GetFunction()); ^ ../buffertools.cc:345:71: error: no matching function for call to ‘v8::FunctionTemplate::New(v8::Handle<v8::Value> (&)(const int&))’ target->Set(String::NewSymbol("toHex"), FunctionTemplate::New(ToHex)->GetFunction()); ^ ../buffertools.cc:345:71: note: candidate is: In file included from ../buffertools.cc:1:0: /home/grp_ddoservice/.node-gyp/0.12.2/deps/v8/include/v8.h:3455:34: note: static v8::Local<v8::FunctionTemplate> v8::FunctionTemplate::New(v8::Isolate*, v8::FunctionCallback, v8::Handle<v8::Value>, v8::Handle<v8::Signature>, int) static Local<FunctionTemplate> New( ^ /home/grp_ddoservice/.node-gyp/0.12.2/deps/v8/include/v8.h:3455:34: note: no known conversion for argument 1 from ‘v8::Handle<v8::Value>(const int&)’ to ‘v8::Isolate*’ ../buffertools.cc: In instantiation of ‘v8::Handle<v8::Value> {anonymous}::UnaryAction<Derived>::operator()(const int&) [with Derived = {anonymous}::ClearAction]’: ../buffertools.cc:256:27: required from here /home/grp_ddoservice/.node-gyp/0.12.2/deps/v8/include/v8.h:816:13: error: ‘v8::HandleScope::HandleScope()’ is protected V8_INLINE HandleScope() {} ^ ../buffertools.cc:22:15: error: within this context HandleScope scope; ^ ../buffertools.cc:27:45: error: ‘ThrowException’ was not declared in this scope "Argument should be a buffer object."))); ^ In file included from ../buffertools.cc:1:0: ../buffertools.cc: In instantiation of ‘v8::Handle<v8::Value> {anonymous}::UnaryAction<Derived>::operator()(const int&) [with Derived = {anonymous}::FillAction]’: ../buffertools.cc:260:26: required from here /home/grp_ddoservice/.node-gyp/0.12.2/deps/v8/include/v8.h:816:13: error: ‘v8::HandleScope::HandleScope()’ is protected V8_INLINE HandleScope() {} ^ ../buffertools.cc:22:15: error: within this context HandleScope scope; ^ ../buffertools.cc:27:45: error: ‘ThrowException’ was not declared in this scope "Argument should be a buffer object."))); ^ In file included from ../buffertools.cc:1:0: ../buffertools.cc: In instantiation of ‘v8::Handle<v8::Value> {anonymous}::UnaryAction<Derived>::operator()(const int&) [with Derived = {anonymous}::ReverseAction]’: ../buffertools.cc:264:29: required from here /home/grp_ddoservice/.node-gyp/0.12.2/deps/v8/include/v8.h:816:13: error: ‘v8::HandleScope::HandleScope()’ is protected V8_INLINE HandleScope() {} ^ ../buffertools.cc:22:15: error: within this context HandleScope scope; ^ ../buffertools.cc:27:45: error: ‘ThrowException’ was not declared in this scope "Argument should be a buffer object."))); ^ In file included from ../buffertools.cc:1:0: ../buffertools.cc: In instantiation of ‘v8::Handle<v8::Value> {anonymous}::BinaryAction<Derived>::operator()(const int&) [with Derived = {anonymous}::EqualsAction]’: ../buffertools.cc:268:28: required from here /home/grp_ddoservice/.node-gyp/0.12.2/deps/v8/include/v8.h:816:13: error: ‘v8::HandleScope::HandleScope()’ is protected V8_INLINE HandleScope() {} ^ ../buffertools.cc:38:15: error: within this context HandleScope scope; ^ ../buffertools.cc:43:45: error: ‘ThrowException’ was not declared in this scope "Argument should be a buffer object."))); ^ ../buffertools.cc:58:71: error: ‘ThrowException’ was not declared in this scope return ThrowException(Exception::TypeError(illegalArgumentException)); ^ In file included from ../buffertools.cc:1:0: ../buffertools.cc: In instantiation of ‘v8::Handle<v8::Value> {anonymous}::BinaryAction<Derived>::operator()(const int&) [with Derived = {anonymous}::CompareAction]’: ../buffertools.cc:272:29: required from here /home/grp_ddoservice/.node-gyp/0.12.2/deps/v8/include/v8.h:816:13: error: ‘v8::HandleScope::HandleScope()’ is protected V8_INLINE HandleScope() {} ^ ../buffertools.cc:38:15: error: within this context HandleScope scope; ^ ../buffertools.cc:43:45: error: ‘ThrowException’ was not declared in this scope "Argument should be a buffer object."))); ^ ../buffertools.cc:58:71: error: ‘ThrowException’ was not declared in this scope return ThrowException(Exception::TypeError(illegalArgumentException)); ^ In file included from ../buffertools.cc:1:0: ../buffertools.cc: In instantiation of ‘v8::Handle<v8::Value> {anonymous}::BinaryAction<Derived>::operator()(const int&) [with Derived = {anonymous}::IndexOfAction]’: ../buffertools.cc:276:29: required from here /home/grp_ddoservice/.node-gyp/0.12.2/deps/v8/include/v8.h:816:13: error: ‘v8::HandleScope::HandleScope()’ is protected V8_INLINE HandleScope() {} ^ ../buffertools.cc:38:15: error: within this context HandleScope scope; ^ ../buffertools.cc:43:45: error: ‘ThrowException’ was not declared in this scope "Argument should be a buffer object."))); ^ ../buffertools.cc:58:71: error: ‘ThrowException’ was not declared in this scope return ThrowException(Exception::TypeError(illegalArgumentException)); ^ In file included from ../buffertools.cc:1:0: ../buffertools.cc: In instantiation of ‘v8::Handle<v8::Value> {anonymous}::UnaryAction<Derived>::operator()(const int&) [with Derived = {anonymous}::FromHexAction]’: ../buffertools.cc:280:29: required from here /home/grp_ddoservice/.node-gyp/0.12.2/deps/v8/include/v8.h:816:13: error: ‘v8::HandleScope::HandleScope()’ is protected V8_INLINE HandleScope() {} ^ ../buffertools.cc:22:15: error: within this context HandleScope scope; ^ ../buffertools.cc:27:45: error: ‘ThrowException’ was not declared in this scope "Argument should be a buffer object."))); ^ In file included from ../buffertools.cc:1:0: ../buffertools.cc: In instantiation of ‘v8::Handle<v8::Value> {anonymous}::UnaryAction<Derived>::operator()(const int&) [with Derived = {anonymous}::ToHexAction]’: ../buffertools.cc:284:27: required from here /home/grp_ddoservice/.node-gyp/0.12.2/deps/v8/include/v8.h:816:13: error: ‘v8::HandleScope::HandleScope()’ is protected V8_INLINE HandleScope() {} ^ ../buffertools.cc:22:15: error: within this context HandleScope scope; ^ ../buffertools.cc:27:45: error: ‘ThrowException’ was not declared in this scope "Argument should be a buffer object."))); ^ make: *** [Release/obj.target/buffertools/buffertools.o] Error 1 make: Leaving directory/test/node_modules/ldapauth/node_modules/ldapjs/node_modules/buffertools/build'
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23)
gyp ERR! stack at ChildProcess.emit (events.js:110:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Linux 3.13.0-52-generic
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Linux 3.13.0-52-generic
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /test/node_modules/ldapauth/node_modules/ldapjs/node_modules/buffertools
gyp ERR! node -v v0.12.2
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok

[email protected] install /test/node_modules/ldapauth/node_modules/ldapjs/node_modules/dtrace-provider
node-gyp rebuild

make: Entering directory /test/node_modules/ldapauth/node_modules/ldapjs/node_modules/dtrace-provider/build' TOUCH Release/obj.target/DTraceProviderStub.stamp make: Leaving directory/test/node_modules/ldapauth/node_modules/ldapjs/node_modules/dtrace-provider/build'
npm ERR! Linux 3.13.0-52-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "ldapauth"
npm ERR! node v0.12.2
npm ERR! npm v2.7.4
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the bcrypt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls bcrypt
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /test/npm-debug.log

npm install fail

[email protected] install /Users/jwarnock/webstormprojects/testing/testing/ldap-auth/node_modules/bcrypt
node-gyp rebuild

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
./Release/.deps/Release/obj.target/bcrypt_lib/src/blowfish.o.d.raw { dev: 16777220,
mode: 33188,
nlink: 1,
uid: 501,
gid: 20,
rdev: 0,
blksize: 4096,
ino: 5538113,
size: 87,
blocks: 8,
atime: Tue Feb 02 2016 10:25:17 GMT-0800 (PST),
mtime: Tue Feb 02 2016 10:25:17 GMT-0800 (PST),
ctime: Tue Feb 02 2016 10:25:17 GMT-0800 (PST),
birthtime: Tue Feb 02 2016 10:25:17 GMT-0800 (PST) }
CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt.o
./Release/.deps/Release/obj.target/bcrypt_lib/src/bcrypt.o.d.raw { dev: 16777220,
mode: 33188,
nlink: 1,
uid: 501,
gid: 20,
rdev: 0,
blksize: 4096,
ino: 5538118,
size: 83,
blocks: 8,
atime: Tue Feb 02 2016 10:25:18 GMT-0800 (PST),
mtime: Tue Feb 02 2016 10:25:18 GMT-0800 (PST),
ctime: Tue Feb 02 2016 10:25:18 GMT-0800 (PST),
birthtime: Tue Feb 02 2016 10:25:17 GMT-0800 (PST) }
CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt_node.o
../src/bcrypt_node.cc:118:18: error: no member named 'Dispose' in 'v8::Persistent<v8::Function, v8::NonCopyablePersistentTraitsv8::Function >'
callback.Dispose();
~~~~~~~~ ^
../src/bcrypt_node.cc:198:19: error: unknown type name 'uv_work_t'
void GenSaltAsync(uv_work_t* req) {
^
../src/bcrypt_node.cc:215:24: error: unknown type name 'uv_work_t'
void GenSaltAsyncAfter(uv_work_t* req) {
^
../src/bcrypt_node.cc:216:17: error: calling a protected constructor of class 'v8::HandleScope'
HandleScope scope;
^
/Users/jwarnock/.node-gyp/5.0.0/include/node/v8.h:889:13: note: declared protected here
V8_INLINE HandleScope() {}
^
../src/bcrypt_node.cc:224:44: error: no member named 'New' in 'v8::String'
argv[0] = Exception::Error(String::New(baton->error.c_str()));
~~~~~~~~^
../src/bcrypt_node.cc:225:19: error: no matching function for call to 'Undefined'
argv[1] = Undefined();
^~~~~~~~~
/Users/jwarnock/.node-gyp/5.0.0/include/node/v8.h:315:27: note: candidate function not viable: requires single argument 'isolate', but no arguments were
provided
friend Local Undefined(Isolate* isolate);
^
../src/bcrypt_node.cc:228:19: error: no matching function for call to 'Undefined'
argv[0] = Undefined();
^~~~~~~~~
/Users/jwarnock/.node-gyp/5.0.0/include/node/v8.h:315:27: note: candidate function not viable: requires single argument 'isolate', but no arguments were
provided
friend Local Undefined(Isolate* isolate);
^
../src/bcrypt_node.cc:229:19: warning: 'Encode' is deprecated: Use Encode(isolate, ...) [-Wdeprecated-declarations]
argv[1] = Encode(baton->salt.c_str(), baton->salt.size(), BINARY);
^
/Users/jwarnock/.node-gyp/5.0.0/include/node/node.h:299:45: note: 'Encode' has been explicitly marked deprecated here
inline v8::Localv8::Value Encode(
^
/Users/jwarnock/.node-gyp/5.0.0/include/node/node.h:66:42: note: expanded from macro 'NODE_DEPRECATED'
attribute((deprecated(message))) declarator
^
../src/bcrypt_node.cc:234:20: error: member reference type 'v8::Persistentv8::Function' is not a pointer; maybe you meant to use '.'?
baton->callback->Call(Context::GetCurrent()->Global(), 2, argv);
~~~~~~~~~~~~~~~^~
.
../src/bcrypt_node.cc:234:22: error: no member named 'Call' in 'v8::Persistent<v8::Function, v8::NonCopyablePersistentTraitsv8::Function >'
baton->callback->Call(Context::GetCurrent()->Global(), 2, argv);
~~~~~~~~~~~~~~~ ^
../src/bcrypt_node.cc:234:36: error: no member named 'GetCurrent' in 'v8::Context'
baton->callback->Call(Context::GetCurrent()->Global(), 2, argv);
~~~~~~~~~^
../src/bcrypt_node.cc:237:9: warning: 'FatalException' is deprecated: Use FatalException(isolate, ...) [-Wdeprecated-declarations]
FatalException(try_catch);
^
/Users/jwarnock/.node-gyp/5.0.0/include/node/node.h:283:29: note: 'FatalException' has been explicitly marked deprecated here
inline void FatalException(const v8::TryCatch& try_catch) {
^
/Users/jwarnock/.node-gyp/5.0.0/include/node/node.h:66:42: note: expanded from macro 'NODE_DEPRECATED'
attribute((deprecated(message))) declarator
^
../src/bcrypt_node.cc:242:34: error: unknown type name 'Arguments'; did you mean 'v8::internal::Arguments'?
Handle GenerateSalt(const Arguments &args) {
^~~~~~~~~
v8::internal::Arguments
/Users/jwarnock/.node-gyp/5.0.0/include/node/v8.h:139:7: note: 'v8::internal::Arguments' declared here
class Arguments;
^
../src/bcrypt_node.cc:243:17: error: calling a protected constructor of class 'v8::HandleScope'
HandleScope scope;
^
/Users/jwarnock/.node-gyp/5.0.0/include/node/v8.h:889:13: note: declared protected here
V8_INLINE HandleScope() {}
^
../src/bcrypt_node.cc:245:32: error: type 'const v8::internal::Arguments' does not provide a subscript operator
const ssize_t rounds = args[0]->Int32Value();
~~~~^~
../src/bcrypt_node.cc:246:30: error: type 'const v8::internal::Arguments' does not provide a subscript operator
const int rand_len = args[1]->Int32Value();
~~~~^~
../src/bcrypt_node.cc:247:58: error: type 'const v8::internal::Arguments' does not provide a subscript operator
Local callback = Local::Cast(args[2]);
~~~~^~
../src/bcrypt_node.cc:251:45: error: 'New' is a private member of 'v8::PersistentBasev8::Function'
baton->callback = Persistent::New(callback);
^
/Users/jwarnock/.node-gyp/5.0.0/include/node/v8.h:643:23: note: declared private here
V8_INLINE static T* New(Isolate* isolate, T* that);
^
../src/bcrypt_node.cc:251:57: error: too few arguments to function call, expected 2, have 1
baton->callback = Persistent::New(callback);
~~~~~~~~~~~~~~~~~~~~~~~~~ ^
/Users/jwarnock/.node-gyp/5.0.0/include/node/v8.h:643:3: note: 'New' declared here
V8_INLINE static T* New(Isolate* isolate, T* that);
^
/Users/jwarnock/.node-gyp/5.0.0/include/node/v8config.h:301:20: note: expanded from macro 'V8_INLINE'

define V8_INLINE inline attribute((always_inline))

               ^

../src/bcrypt_node.cc:255:5: error: unknown type name 'uv_work_t'
uv_work_t* req = new uv_work_t;
^
../src/bcrypt_node.cc:255:26: error: unknown type name 'uv_work_t'
uv_work_t* req = new uv_work_t;
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
2 warnings and 20 errors generated.
make: *** [Release/obj.target/bcrypt_lib/src/bcrypt_node.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 15.3.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/jwarnock/webstormprojects/testing/testing/ldap-auth/node_modules/bcrypt
gyp ERR! node -v v5.0.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
[email protected] /Users/jwarnock/webstormprojects/testing/testing/ldap-auth
`-- (empty)

npm WARN EPACKAGEJSON [email protected] No description
npm WARN EPACKAGEJSON [email protected] No repository field.
npm ERR! Darwin 15.3.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "ldapauth" "--save"
npm ERR! node v5.0.0
npm ERR! npm v3.4.0
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the bcrypt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls bcrypt
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /Users/jwarnock/webstormprojects/testing/testing/ldap-auth/npm-debug.log
npm ERR! code 1

callback never fired when network is unreachable

I don't know if this is an ldapjs problem of an ldapauth problem but I have a setup that requires a vpn connection to the ldap server and if the connection isn't running then the server can't be reached and a call to authenticate() never returns on my callback.

I'm having to solve this with a parallel setTimeout() at the moment.

I'm happy to put in some work to sort this out via a pull-request but perhaps you can give some pointers if you know off the top of your head where the problem might be or if this is a known issue?

Couldn't install react native for windows...serious help needed

Error: spawn cmd.exe ENOENT
Process.ChildProces.handle.onexitit <internal/child_process.js:229:19>
at onErrorNT <internal/child_process.js:406:16>
at process._tickCallback <internal/process/next_tick.js:63:19>
Emitted 'error' event at:
at Process.ChildProcess.handle.onexit <internal/child_process.js:235:12>
at onErrorNT <internal/child_process.js:406:16>
at process._tickCallback <internal/process/next_tick.js:63:19>

Error during compile when trying to build bcrypt

Problem when trying to compile dependent bcrypt package (not sure if it's because of the version)

../src/bcrypt_node.cc: In function v8::Handlev8::Value::GenerateSalt(const v8::Arguments):
../src/bcrypt_node.cc:257: error: invalid conversion from void ()(uv_work_t) to void ()uv_work_t, int)
../src/bcrypt_node.cc:257: error: initializing argument 4 of int uv_queue_work(uv_loop_t* uv_work_t_, void ()(uv_work_t), void ()(uv_work_t, int))
../src/bcrypt_node.cc: In function v8::Handlev8::Value::Encrypt(const v8::Arguments):
../src/bcrypt_node.cc:257: error: invalid conversion from void ()(uv_work_t) to void ()uv_work_t, int)
../src/bcrypt_node.cc:257: error: initializing argument 4 of int uv_queue_work(uv_loop_t_ uv_work_t_, void ()(uv_work_t), void ()(uv_work_t, int))
../src/bcrypt_node.cc: In function v8::Handlev8::Value::Compare(const v8::Arguments):
../src/bcrypt_node.cc:257: error: invalid conversion from void ()(uv_work_t) to void ()uv_work_t, int)
../src/bcrypt_node.cc:257: error: initializing argument 4 of int uv_queue_work(uv_loop_t_ uv_work_t_, void ()(uv_work_t), void ()(uv_work_t, int))
make: *_* [Release/obj.target/bcrypt_lib/src/bcrypt_node.o] Error 1

Login search filter

I want to do a login search filter by multiple fields, like this:

'(|(sAMAccountName={{username}})(mail={{username}}))'

When I try it, it only allows login by the first critera, in this case, sAMAccountName. I narrowed the bug down to ldapauth.js line 118 - just needs to be a global search and replace:

var searchFilter = self.opts.searchFilter.replace(/{{username}}/g, username);

Binding problem

When I try to use node-ldapauth, I get the following error:

Error: LDAP connection is not yet bound
...

My code seems like this:

var config = {
        ldap: {
            url: "ldap://1.2.3.4",
            adminDn: "cn=admin, dc=sub, dc=domain",
            adminPassword: "Secret",
            searchBase: "dc=sub, dc=domain",
            searchFilter: "(cn={{username}})" 
        }
    };
var auth = new ldap({
    url: config.ldap.url,
    adminDn: config.ldap.adminDn,
    adminPassword: config.ldap.adminPassword,
    searchBase: config.ldap.searchBase,
    searchFilter: config.ldap.searchFilter
});
auth.authenticate('cn=sample , ou=sub1, ou=sub2, dc=sub, dc=domain', 'samplesecret', function(err, user) {
        if (err) {
            console.log(err);
            res.writeHead('401');
            res.end()
        } else {
            res.writeHead('200');
            res.end();
        }
    });

I am sure that the credentials are valid.
I also tried cn=sample instead of cn={{username}} but the problem does not resolve.
Any idea?

Treat UnwillingToPerformError like an InvalidCredentialsError

When attempting to pass a zero-length password to a server that doesn't allow unauthenticated binds, the client returns an UnwillingToPerformError, which results in ldapauth trying to authenticate again. When this happens, the client is still connected to the server, so the backoff attempt ends up leaking clients, and getting stuck in a loop that will never end.

bcrypt issue

Would it be possible to rely on bcrypt-nodejs instead of bcrypt package?

This would remove the hassle to install the SDK & everything for compilation and would be easier to deploy on multiple platform?

Maybe I can have a look and make a pull request.

Thank's

jpegPhoto decoding

Howdy! I finally got this working with the base openldap install. Learned a lot about ldap searching. Thanks for the lib!!

Now when the user object shows up I am trying to save the jpegPhoto to a file for use as the profile pic. But I cannot figure out the format

I have tried (among many other things):
fs.writeFileSync(jpgPath, ldapUser.jpegPhoto);

And
var jpg = new Buffer(ldapUser.jpegPhoto, 'base64');
fs.writeFileSync(jpgPath, jpg);

Any ideas?

Thanks!

Unbind clients in close() function

After invoking the close() function in lib/ldapauth.js, node will not terminate normally because _adminClient and _userClient are still bound. I suggest to rewrite the code in order to unbind both clients. Suggestion (not very good because it does not regard errors when unbinding _adminClient):

LdapAuth.prototype.close = function (callback) {
 var self = this;
  self._adminClient.unbind(function (err) {
    self._userClient.unbind(function (err2) {
       callback(err2) });})

By the way, I have not seen that _adminBound is set to true, therefore I think that in the current close() function, the _adminClient will never be unbound.

npm install problem

Hi, when i try to npm install ldapauth, it displays many errors. I spend the last 2 days cheking for a solution but nothing. I tryed to unintall/ reinstall node & npm, same with node-gyp, and still got the error :

`

[email protected] install /app/LDAP/node_modules/buffertools
node-gyp rebuild

CXX(target) Release/obj.target/buffertools/buffertools.o
../buffertools.cc:19:52: error: unknown type name 'Arguments'; did you mean 'v8::internal::Arguments'?
Handle apply(Handle& buffer, const Arguments& args, HandleScope& scope);
^~~~~~~~~
v8::internal::Arguments
/Users/samuel/.node-gyp/6.9.4/include/node/v8.h:147:7: note: 'v8::internal::Arguments' declared here
class Arguments;
^
../buffertools.cc:21:33: error: unknown type name 'Arguments'; did you mean 'v8::internal::Arguments'?
Handle operator()(const Arguments& args) {
^~~~~~~~~
v8::internal::Arguments
/Users/samuel/.node-gyp/6.9.4/include/node/v8.h:147:7: note: 'v8::internal::Arguments' declared here
class Arguments;
^
../buffertools.cc:24:28: error: member access into incomplete type 'const v8::internal::Arguments'
Local self = args.This();
^
/Users/samuel/.node-gyp/6.9.4/include/node/v8.h:147:7: note: forward declaration of 'v8::internal::Arguments'
class Arguments;
^
../buffertools.cc:26:55: error: no member named 'New' in 'v8::String'
return ThrowException(Exception::TypeError(String::New(
~~~~~~~~^
../buffertools.cc:35:86: error: unknown type name 'Arguments'; did you mean 'v8::internal::Arguments'?
Handle apply(Handle& buffer, const uint8_t* data, size_t size, const Arguments& args, HandleScope& scope);
^~~~~~~~~
v8::internal::Arguments
/Users/samuel/.node-gyp/6.9.4/include/node/v8.h:147:7: note: 'v8::internal::Arguments' declared here
class Arguments;
^
../buffertools.cc:37:33: error: unknown type name 'Arguments'; did you mean 'v8::internal::Arguments'?
Handle operator()(const Arguments& args) {
^~~~~~~~~
v8::internal::Arguments
/Users/samuel/.node-gyp/6.9.4/include/node/v8.h:147:7: note: 'v8::internal::Arguments' declared here
class Arguments;
^
../buffertools.cc:40:28: error: member access into incomplete type 'const v8::internal::Arguments'
Local self = args.This();
^
/Users/samuel/.node-gyp/6.9.4/include/node/v8.h:147:7: note: forward declaration of 'v8::internal::Arguments'
class Arguments;
^
../buffertools.cc:42:55: error: no member named 'New' in 'v8::String'
return ThrowException(Exception::TypeError(String::New(
~~~~~~~~^
../buffertools.cc:46:11: error: type 'const v8::internal::Arguments' does not provide a subscript operator
if (args[0]->IsString()) {
~~~~^~
../buffertools.cc:47:28: error: type 'const v8::internal::Arguments' does not provide a subscript operator
String::Utf8Value s(args[0]->ToString());
~~~~^~
../buffertools.cc:50:31: error: type 'const v8::internal::Arguments' does not provide a subscript operator
if (Buffer::HasInstance(args[0])) {
~~~~^~
../buffertools.cc:51:30: error: type 'const v8::internal::Arguments' does not provide a subscript operator
Local other = args[0]->ToObject();
~~~~^~
../buffertools.cc:56:88: error: no member named 'New' in 'v8::String'
static Persistent illegalArgumentException = Persistent::New(String::New(
~~~~~~~~^
../buffertools.cc:104:52: error: unknown type name 'Arguments'; did you mean 'v8::internal::Arguments'?
Handle apply(Handle& buffer, const Arguments& args, HandleScope& scope) {
^~~~~~~~~
v8::internal::Arguments
/Users/samuel/.node-gyp/6.9.4/include/node/v8.h:147:7: note: 'v8::internal::Arguments' declared here
class Arguments;
^
../buffertools.cc:110:52: error: unknown type name 'Arguments'; did you mean 'v8::internal::Arguments'?
Handle apply(Handle& buffer, const Arguments& args, HandleScope& scope) {
^~~~~~~~~
v8::internal::Arguments
/Users/samuel/.node-gyp/6.9.4/include/node/v8.h:147:7: note: 'v8::internal::Arguments' declared here
class Arguments;
^
../buffertools.cc:111:11: error: type 'const v8::internal::Arguments' does not provide a subscript operator
if (args[0]->IsInt32()) {
~~~~^~
../buffertools.cc:112:16: error: type 'const v8::internal::Arguments' does not provide a subscript operator
int c = args[0]->ToInt32()->Int32Value();
~~~~^~
../buffertools.cc:116:11: error: type 'const v8::internal::Arguments' does not provide a subscript operator
if (args[0]->IsString()) {
~~~~^~
../buffertools.cc:117:28: error: type 'const v8::internal::Arguments' does not provide a subscript operator
String::Utf8Value s(args[0]->ToString());
~~~~^~
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [Release/obj.target/buffertools/buffertools.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:191:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Darwin 16.1.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /app/LDAP/node_modules/buffertools
gyp ERR! node -v v6.9.4
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
/app/LDAP
└── (empty)

npm WARN enoent ENOENT: no such file or directory, open '/app/LDAP/package.json'
npm WARN LDAP No description
npm WARN LDAP No repository field.
npm WARN LDAP No README data
npm WARN LDAP No license field.
npm ERR! Darwin 16.1.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "ldapauth"
npm ERR! node v6.9.4
npm ERR! npm v4.0.5
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the buffertools package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs buffertools
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls buffertools
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /app/LDAP/npm-debug.log
`

Haalp ? :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.