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

ldap-authentication

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ldap-authentication - npm Package Compare versions

Comparing version 3.1.0 to 3.2.1

test/test.spec.js

7

.vscode/launch.json

@@ -13,4 +13,11 @@ {

"program": "${workspaceFolder}/example/index.js"
},
{
"type": "node",
"request": "launch",
"name": "Debug Test",
"skipFiles": ["<node_internals>/**"],
"program": "${workspaceFolder}/test/jasmine.js"
}
]
}

67

index.js

@@ -20,3 +20,3 @@ const assert = require('assert')

ldapOpts.connectTimeout = ldapOpts.connectTimeout || 5000
var client = ldap.createClient(ldapOpts)
let client = ldap.createClient(ldapOpts)

@@ -33,3 +33,2 @@ client.on('connect', function () {

reject(err)
client.unbind()
return

@@ -45,3 +44,2 @@ }

reject(err)
client.unbind()
return

@@ -84,3 +82,3 @@ }

return new Promise(function (resolve, reject) {
var filter = new ldap.filters.EqualityFilter({
let filter = new ldap.filters.EqualityFilter({
attribute: usernameAttribute,

@@ -98,6 +96,5 @@ value: username,

ldapClient.search(searchBase, searchOptions, function (err, res) {
var user = null
let user = null
if (err) {
reject(err)
ldapClient.unbind()
return

@@ -118,3 +115,2 @@ }

reject(err)
ldapClient.unbind()
})

@@ -127,3 +123,2 @@ res.on('end', function (result) {

}
ldapClient.unbind()
})

@@ -151,6 +146,5 @@ })

function (err, res) {
var groups = []
let groups = []
if (err) {
reject(err)
ldapClient.unbind()
return

@@ -164,3 +158,2 @@ }

reject(err)
ldapClient.unbind()
})

@@ -173,3 +166,2 @@ res.on('end', function (result) {

}
ldapClient.unbind()
})

@@ -196,3 +188,3 @@ }

) {
var ldapAdminClient
let ldapAdminClient
try {

@@ -208,3 +200,3 @@ ldapAdminClient = await _ldapBind(

}
var user = await _searchUser(
let user = await _searchUser(
ldapAdminClient,

@@ -216,3 +208,2 @@ userSearchBase,

)
ldapAdminClient.unbind()
if (!user || !user.dn) {

@@ -227,3 +218,3 @@ ldapOpts.log &&

}
var userDn = user.dn
let userDn = user.dn
let ldapUserClient

@@ -235,15 +226,4 @@ try {

}
ldapUserClient.unbind()
if (groupsSearchBase && groupClass && groupMemberAttribute) {
try {
ldapAdminClient = await _ldapBind(
adminDn,
adminPassword,
starttls,
ldapOpts
)
} catch (error) {
throw error
}
var groups = await _searchUserGroups(
let groups = await _searchUserGroups(
ldapAdminClient,

@@ -257,3 +237,2 @@ groupsSearchBase,

user.groups = groups
ldapAdminClient.unbind()
}

@@ -285,6 +264,5 @@ return user

// if usernameAttribute is not provided, no user detail is needed.
ldapUserClient.unbind()
return true
}
var user = await _searchUser(
let user = await _searchUser(
ldapUserClient,

@@ -305,10 +283,4 @@ userSearchBase,

}
ldapUserClient.unbind()
if (groupsSearchBase && groupClass && groupMemberAttribute) {
try {
ldapUserClient = await _ldapBind(userDn, userPassword, starttls, ldapOpts)
} catch (error) {
throw error
}
var groups = await _searchUserGroups(
let groups = await _searchUserGroups(
ldapUserClient,

@@ -322,3 +294,2 @@ groupsSearchBase,

user.groups = groups
ldapUserClient.unbind()
}

@@ -342,3 +313,3 @@ return user

) {
var ldapAdminClient
let ldapAdminClient
try {

@@ -354,3 +325,3 @@ ldapAdminClient = await _ldapBind(

}
var user = await _searchUser(
let user = await _searchUser(
ldapAdminClient,

@@ -362,3 +333,2 @@ userSearchBase,

)
ldapAdminClient.unbind()
if (!user || !user.dn) {

@@ -374,13 +344,3 @@ ldapOpts.log &&

if (groupsSearchBase && groupClass && groupMemberAttribute) {
try {
ldapAdminClient = await _ldapBind(
adminDn,
adminPassword,
starttls,
ldapOpts
)
} catch (error) {
throw error
}
var groups = await _searchUserGroups(
let groups = await _searchUserGroups(
ldapAdminClient,

@@ -394,3 +354,2 @@ groupsSearchBase,

user.groups = groups
ldapAdminClient.unbind()
}

@@ -397,0 +356,0 @@ return user

{
"name": "ldap-authentication",
"version": "3.1.0",
"version": "3.2.1",
"description": "A simple async nodejs library for LDAP user authentication",

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

@@ -224,2 +224,2 @@ # A Simple node Library that Authenticates a User Against an LDAP/AD Server

Version 3 supports Node version 15, 16, 17 and 18
Version 3 supports Node version 16, 17, 18, 20 and 22,

@@ -6,3 +6,3 @@ var Jasmine = require('jasmine')

spec_dir: 'test',
spec_files: ['test.js'],
spec_files: ['**/*[sS]pec.?(m)js'],
random: false,

@@ -9,0 +9,0 @@ seed: null,

Sorry, the diff of this file is not supported yet

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