Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ilb/node_ldap

Package Overview
Dependencies
Maintainers
3
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ilb/node_ldap - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

src/defaults.js

2

package.json
{
"name": "@ilb/node_ldap",
"version": "1.1.0",
"version": "1.1.1",
"description": "",

@@ -5,0 +5,0 @@ "author": "github@iconicompany.com",

@@ -8,17 +8,26 @@ const { existsSync, readFileSync } = require('fs');

const createDebug = require('debug');
const { getLdapConfPath } = require('./defaults.js');
const debug = createDebug('node_ldap');
/**
* LDAP facade with auto-configuration
*/
function LDAPFactory(ldapConfPath = '/etc/openldap/ldap.conf') {
function LDAPFactory(ldapConfPath) {
this.ldapConfig = null;
if (process.env.LDAP_URL) {
//configure using LDAP_URL variable if set
this.ldapConfig = new URILDAPConfig(process.env.LDAP_URL, process.env.NODE_EXTRA_CA_CERTS);
debug('configured using LDAP_URL', this.ldapConfig);
} else if (existsSync(ldapConfPath)) {
//configure using openldap configuration file
this.ldapConfig = new OpenLDAPConfig(readFileSync(ldapConfPath, 'utf8'));
debug('configured using ldap config file', ldapConfPath, this.ldapConfig);
if (process.env.LDAPURI) {
//configure using LDAPURI variable if set
this.ldapConfig = new URILDAPConfig(
process.env.LDAPURI,
process.env.LDAPBASE,
process.env.LDAPTLS_CACERT
);
debug('configured using LDAPURI', this.ldapConfig);
} else {
ldapConfPath = ldapConfPath || getLdapConfPath();
if (ldapConfPath && existsSync(ldapConfPath)) {
//configure using openldap configuration file
this.ldapConfig = new OpenLDAPConfig(readFileSync(ldapConfPath, 'utf8'));
debug('configured using ldap config file', ldapConfPath, this.ldapConfig);
}
}

@@ -25,0 +34,0 @@ this.ldapClientFactory = new LDAPClientFactory();

@@ -5,5 +5,5 @@ /**

*/
function URILDAPConfig(uri, caCert) {
function URILDAPConfig(uri, base, caCert) {
const urlobj = new URL(uri);
this.base = urlobj.pathname.substring(1);
this.base = base || urlobj.pathname.substring(1);
urlobj.pathname = '';

@@ -10,0 +10,0 @@ this.uri = [urlobj.toString()];

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