New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

verdaccio-ldap-node

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

verdaccio-ldap-node - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

69

index.js
/**
* verdaccio-ldap
* verdaccio-ldap-node
*/
'use strict';
'use strict';
const LdapClient = require('node-ldap');
function Auth(config, stuff) {
const self = Object.create(Auth.prototype);
self._users = {};
// config for this module
self._config = config;
// verdaccio logger
self._logger = stuff.logger;
// pass verdaccio logger to ldapauth
self._config.client_options.log = stuff.logger;
// initial ldapUrl
self._config.client_options.ldapUrl = '';
return self;
}
Auth.prototype.authenticate = function(username, password, callback) {
// initial LDAP client
const client = new LdapClient(this._config.client_options);
// start auth
client.auth(`${username}@xdf.cn`, password)
.then(function() {
callback(null, [ username ]);
})
.catch(function(error) {
this._logger.warn({ username, error }, `verdaccio-ldap error ${error}`);
callback(null, false);
})
.finally(function() {
client.disconnect();
});
};
module.exports = Auth;
const LdapClient = require('node-ldap');
function Auth(config, stuff) {
const self = Object.create(Auth.prototype);
self._users = {};
// config for this module
self._config = config;
// verdaccio logger
self._logger = stuff.logger;
return self;
}
Auth.prototype.authenticate = function(username, password, callback) {
// initial LDAP client
const client = new LdapClient(this._config);
// start auth
client.auth(`${username}@xdf.cn`, password)
.then(function() {
callback(null, [ username ]);
})
.catch(function(error) {
this._logger.warn({ username, error }, `verdaccio-ldap error ${error}`);
callback(null, false);
})
.finally(function() {
client.disconnect();
});
};
module.exports = Auth;
{
"name": "verdaccio-ldap-node",
"version": "1.0.0",
"version": "1.0.1",
"description": "LDAP plugin for Verdaccio with node-ldap",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc