Skip to content
This repository was archived by the owner on May 14, 2024. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ldapjs/node-ldapjs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.0.6
Choose a base ref
...
head repository: ldapjs/node-ldapjs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v3.0.7
Choose a head ref
  • 2 commits
  • 3 files changed
  • 2 contributors

Commits on Dec 1, 2023

  1. Copy the full SHA
    9c6142d View commit details
  2. v3.0.7

    jsumners committed Dec 1, 2023

    Verified

    This commit was signed with the committer’s verified signature.
    jsumners James Sumners
    Copy the full SHA
    b86c493 View commit details
Showing with 23 additions and 2 deletions.
  1. +1 −1 lib/server.js
  2. +1 −1 package.json
  3. +21 −0 test/server.test.js
2 changes: 1 addition & 1 deletion lib/server.js
Original file line number Diff line number Diff line change
@@ -854,11 +854,11 @@ Server.prototype._getHandlerChain = function _getHandlerChain (req) {
}

// Otherwise, match via DN rules
assert.ok(req.dn)
const keys = this._sortedRouteKeys()
let fallbackHandler = [noSuffixHandler]
// invalid DNs in non-strict mode are routed to the default handler
const testDN = (typeof (req.dn) === 'string') ? DN.fromString(req.dn) : req.dn
assert.ok(testDN)

for (let i = 0; i < keys.length; i++) {
const suffix = keys[i]
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
"name": "ldapjs",
"homepage": "http://ldapjs.org",
"description": "LDAP client and server APIs",
"version": "3.0.6",
"version": "3.0.7",
"license": "MIT",
"repository": {
"type": "git",
21 changes: 21 additions & 0 deletions test/server.test.js
Original file line number Diff line number Diff line change
@@ -257,6 +257,27 @@ tap.test('bind/unbind identity anonymous', function (t) {
})
})

tap.test('does not crash on empty DN values', function (t) {
const server = ldap.createServer({
connectionRouter: function (c) {
server.newConnection(c)
server.emit('testconnection', c)
}
})

server.listen(t.context.sock, function () {
const client = ldap.createClient({ socketPath: t.context.sock })
server.once('testconnection', () => {
client.bind('', 'pw', function (err) {
t.ok(err, 'blank bind dn throws error')
client.unbind(function () {
server.close(() => t.end())
})
})
})
})
})

tap.test('bind/unbind identity user', function (t) {
const server = ldap.createServer({
connectionRouter: function (c) {