verdaccio-ldap-group-fix
Advanced tools
Comparing version 2.1.0 to 2.1.1
30
index.js
@@ -40,4 +40,5 @@ const Promise = require('bluebird'); | ||
ldapUser.cn, | ||
...ldapUser._groups ? ldapUser._groups.map((group) => group.cn) : [], | ||
...ldapUser.memberOf ? ldapUser.memberOf.map((groupDn) => rfc2253.parse(groupDn).get('CN')) : [], | ||
// _groups or memberOf could be single els or arrays. | ||
...ldapUser._groups ? [].concat(ldapUser._groups).map((group) => group.cn) : [], | ||
...ldapUser.memberOf ? [].concat(ldapUser.memberOf).map((groupDn) => rfc2253.parse(groupDn).get('CN')) : [], | ||
]; | ||
@@ -57,8 +58,25 @@ }) | ||
.catch((err) => { | ||
// 'No such user' is reported via error | ||
this._logger.warn({ | ||
err: err | ||
}, 'LDAP error on close @{err}'); | ||
user: user, | ||
err: err, | ||
}, `LDAP error ${err}`); | ||
return false; // indicates failure | ||
}) | ||
}) | ||
.asCallback(callback); | ||
.finally((ldapUser) => { | ||
/* | ||
* LdapClient.closeAsync doesn't work with node 10.x | ||
* | ||
* return LdapClient.closeAsync() | ||
* .catch((err) => { | ||
* this._logger.warn({ | ||
* err: err | ||
* }, 'LDAP error on close @{err}'); | ||
* }); | ||
*/ | ||
LdapClient.close(); | ||
return ldapUser; | ||
}) | ||
.asCallback(callback); | ||
}; |
{ | ||
"name": "verdaccio-ldap-group-fix", | ||
"version": "2.1.0", | ||
"description": "LDAP auth plugin for verdaccio with fix for groups", | ||
"version": "2.1.1", | ||
"description": "LDAP auth plugin for verdaccio", | ||
"author": "Alexandre L.", | ||
@@ -11,14 +11,16 @@ "repository": { | ||
"dependencies": { | ||
"bluebird": "^3.5.1", | ||
"bluebird": "~3.5.1", | ||
"ldapauth-fork": "~4.0.2", | ||
"rfc2253": "^0.1.1" | ||
"rfc2253": "~0.1.1" | ||
}, | ||
"devDependencies": { | ||
"bunyan": "^1.8.12", | ||
"bunyan": "~1.8.12", | ||
"chai": "~4.1.2", | ||
"jshint": "~2.9.5", | ||
"mocha": "~4.1.0" | ||
"ldap-server-mock": "~1.0.0", | ||
"mocha": "~5.2.0" | ||
}, | ||
"scripts": { | ||
"pretest": "./node_modules/jshint/bin/jshint index.js", | ||
"test": "echo 'todo'" | ||
"test": "mocha --exit tests/bootstrap.spec.js tests/**/*.spec.js" | ||
}, | ||
@@ -25,0 +27,0 @@ "keywords": [ |
@@ -31,3 +31,6 @@ # verdaccio-ldap [![Build Status](https://travis-ci.org/Alexandre-io/verdaccio-ldap.svg?branch=master)](https://travis-ci.org/Alexandre-io/verdaccio-ldap) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/b15683d154d44347bccc4360d48436a7)](https://www.codacy.com/app/alexandre_io/verdaccio-ldap?utm_source=github.com&utm_medium=referral&utm_content=Alexandre-io/verdaccio-ldap&utm_campaign=Badge_Grade) [![Greenkeeper badge](https://badges.greenkeeper.io/Alexandre-io/verdaccio-ldap.svg)](https://greenkeeper.io/) | ||
groupSearchBase: 'ou=groups,dc=myorg,dc=com', | ||
groupSearchFilter: '(memberUid={{dn}})', | ||
# If you have memberOf support on your ldap | ||
searchAttributes: ['*', 'memberOf'] | ||
# Else, if you don't (use one or the other): | ||
# groupSearchFilter: '(memberUid={{dn}})' | ||
# Optional | ||
@@ -34,0 +37,0 @@ cache: False |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23616
13
134
74
5
1
+ Addedbluebird@3.5.5(transitive)
- Removedbluebird@3.7.2(transitive)
Updatedbluebird@~3.5.1
Updatedrfc2253@~0.1.1