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: v2.2.0
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: v2.2.1
Choose a head ref
  • 17 commits
  • 71 files changed
  • 6 contributors

Commits on Sep 21, 2020

  1. Merge pull request #659 from ldapjs/bump-v2.2.0

    v2.2.0
    jsumners authored Sep 21, 2020
    Copy the full SHA
    8bda65e View commit details

Commits on Oct 24, 2020

  1. Bump standard from 14.3.4 to 15.0.0

    Bumps [standard](https://github.com/standard/standard) from 14.3.4 to 15.0.0.
    - [Release notes](https://github.com/standard/standard/releases)
    - [Changelog](https://github.com/standard/standard/blob/master/CHANGELOG.md)
    - [Commits](standard/standard@v14.3.4...v15.0.0)
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Oct 24, 2020
    Copy the full SHA
    440f643 View commit details
  2. Copy the full SHA
    0755525 View commit details
  3. Merge pull request #666 from ldapjs/dependabot/npm_and_yarn/standard-…

    …15.0.0
    
    Bump standard from 14.3.4 to 15.0.0
    jsumners authored Oct 24, 2020
    Copy the full SHA
    6a90485 View commit details

Commits on Oct 30, 2020

  1. Update client docs

    yadhukrishnam authored Oct 30, 2020
    Copy the full SHA
    bd8fdba View commit details
  2. Merge pull request #670 from yadhukrishnam/master

    [Docs] Improved documentation
    jsumners authored Oct 30, 2020
    Copy the full SHA
    44108a4 View commit details

Commits on Oct 31, 2020

  1. Bump snazzy from 8.0.0 to 9.0.0

    Bumps [snazzy](https://github.com/feross/snazzy) from 8.0.0 to 9.0.0.
    - [Release notes](https://github.com/feross/snazzy/releases)
    - [Commits](standard/snazzy@v8.0.0...v9.0.0)
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Oct 31, 2020
    Copy the full SHA
    04c1790 View commit details
  2. Merge pull request #672 from ldapjs/dependabot/npm_and_yarn/snazzy-9.0.0

    Bump snazzy from 8.0.0 to 9.0.0
    jsumners authored Oct 31, 2020
    Copy the full SHA
    b796afe View commit details
  3. Copy the full SHA
    c6fa259 View commit details

Commits on Nov 1, 2020

  1. Copy the full SHA
    41c3c01 View commit details

Commits on Nov 12, 2020

  1. Copy the full SHA
    95b4ebd View commit details

Commits on Nov 13, 2020

  1. fix readme badges

    UziTech committed Nov 13, 2020
    Copy the full SHA
    b63002b View commit details
  2. Merge pull request #678 from UziTech/fix-readme

    fix readme badges
    UziTech authored Nov 13, 2020
    Copy the full SHA
    814d337 View commit details
  3. Copy the full SHA
    0e7c6b5 View commit details
  4. Copy the full SHA
    ce63a4f View commit details
  5. 2.2.1

    UziTech committed Nov 13, 2020
    Copy the full SHA
    d812119 View commit details
  6. Merge pull request #680 from UziTech/v2.2.1

    v2.2.1
    UziTech authored Nov 13, 2020
    Copy the full SHA
    badbe6d View commit details
Showing with 778 additions and 772 deletions.
  1. +0 −1 .github/workflows/integration.yml
  2. +3 −1 .github/workflows/main.yml
  3. +2 −2 README.md
  4. +1 −1 docs/client.md
  5. +18 −18 examples/inmemory.js
  6. +4 −4 lib/assert.js
  7. +8 −8 lib/attribute.js
  8. +11 −10 lib/change.js
  9. +107 −105 lib/client/client.js
  10. +10 −10 lib/client/search_pager.js
  11. +2 −2 lib/controls/control.js
  12. +8 −8 lib/controls/entry_change_notification_control.js
  13. +14 −14 lib/controls/index.js
  14. +8 −8 lib/controls/paged_results_control.js
  15. +8 −8 lib/controls/persistent_search_control.js
  16. +12 −12 lib/controls/server_side_sorting_request_control.js
  17. +10 −10 lib/controls/server_side_sorting_response_control.js
  18. +8 −8 lib/controls/virtual_list_view_request_control.js
  19. +10 −10 lib/controls/virtual_list_view_response_control.js
  20. +2 −2 lib/corked_emitter.js
  21. +50 −50 lib/dn.js
  22. +7 −7 lib/dtrace.js
  23. +14 −14 lib/errors/index.js
  24. +4 −4 lib/filters/and_filter.js
  25. +4 −4 lib/filters/approx_filter.js
  26. +7 −7 lib/filters/equality_filter.js
  27. +2 −2 lib/filters/escape.js
  28. +6 −6 lib/filters/ext_filter.js
  29. +2 −2 lib/filters/filter.js
  30. +4 −4 lib/filters/ge_filter.js
  31. +21 −22 lib/filters/index.js
  32. +4 −4 lib/filters/le_filter.js
  33. +4 −4 lib/filters/not_filter.js
  34. +4 −4 lib/filters/or_filter.js
  35. +5 −5 lib/filters/presence_filter.js
  36. +9 −8 lib/filters/substr_filter.js
  37. +16 −16 lib/index.js
  38. +11 −11 lib/messages/abandon_request.js
  39. +3 −3 lib/messages/abandon_response.js
  40. +15 −15 lib/messages/add_request.js
  41. +4 −4 lib/messages/add_response.js
  42. +8 −8 lib/messages/bind_request.js
  43. +4 −4 lib/messages/bind_response.js
  44. +5 −5 lib/messages/compare_request.js
  45. +5 −5 lib/messages/compare_response.js
  46. +7 −7 lib/messages/del_request.js
  47. +4 −4 lib/messages/del_response.js
  48. +6 −5 lib/messages/ext_request.js
  49. +4 −4 lib/messages/ext_response.js
  50. +25 −25 lib/messages/index.js
  51. +12 −12 lib/messages/message.js
  52. +8 −8 lib/messages/moddn_request.js
  53. +4 −4 lib/messages/moddn_response.js
  54. +8 −8 lib/messages/modify_request.js
  55. +4 −4 lib/messages/modify_response.js
  56. +38 −38 lib/messages/parser.js
  57. +11 −11 lib/messages/result.js
  58. +14 −14 lib/messages/search_entry.js
  59. +8 −8 lib/messages/search_reference.js
  60. +11 −11 lib/messages/search_request.js
  61. +22 −21 lib/messages/search_response.js
  62. +7 −7 lib/messages/unbind_request.js
  63. +6 −6 lib/messages/unbind_response.js
  64. +7 −7 lib/persistent_search.js
  65. +79 −79 lib/server.js
  66. +1 −1 lib/url.js
  67. +3 −3 package.json
  68. +2 −2 test/change.test.js
  69. +6 −6 test/client.test.js
  70. +16 −16 test/controls/persistent_search_control.test.js
  71. +1 −1 test/laundry.test.js
1 change: 0 additions & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -7,7 +7,6 @@ on:
pull_request:
branches:
- master
- next

jobs:
baseline:
4 changes: 3 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
name: 'Lint And Test'

on:
push:
branches:
- master
pull_request:
branches:
- master
- next

jobs:
lint:
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# LDAPjs

[![Build Status](https://github.com/ldapjs/node-ldapjs/workflows/.github/workflows/main.yml/badge.svg)]
[![Coverage Status](https://coveralls.io/repos/github/ldapjs/node-ldapjs/badge.svg)]
[![Build Status](https://github.com/ldapjs/node-ldapjs/workflows/Lint%20And%20Test/badge.svg)](https://github.com/ldapjs/node-ldapjs/actions)
[![Coverage Status](https://coveralls.io/repos/github/ldapjs/node-ldapjs/badge.svg)](https://coveralls.io/github/ldapjs/node-ldapjs/)

LDAPjs makes the LDAP protocol a first class citizen in Node.js.

2 changes: 1 addition & 1 deletion docs/client.md
Original file line number Diff line number Diff line change
@@ -131,7 +131,7 @@ Example:
});

# del
`del(dn, controls, callbak)`
`del(dn, controls, callback)`


Deletes an entry from the LDAP server.
36 changes: 18 additions & 18 deletions examples/inmemory.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
var ldap = require('../lib/index')
const ldap = require('../lib/index')

/// --- Shared handlers

function authorize (req, res, next) {
/* Any user may search after bind, only cn=root has full power */
var isSearch = (req instanceof ldap.SearchRequest)
const isSearch = (req instanceof ldap.SearchRequest)
if (!req.connection.ldap.bindDN.equals('cn=root') && !isSearch) { return next(new ldap.InsufficientAccessRightsError()) }

return next()
}

/// --- Globals

var SUFFIX = 'o=smartdc'
var db = {}
var server = ldap.createServer()
const SUFFIX = 'o=smartdc'
const db = {}
const server = ldap.createServer()

server.bind('cn=root', function (req, res, next) {
if (req.dn.toString() !== 'cn=root' || req.credentials !== 'secret') { return next(new ldap.InvalidCredentialsError()) }
@@ -24,7 +24,7 @@ server.bind('cn=root', function (req, res, next) {
})

server.add(SUFFIX, authorize, function (req, res, next) {
var dn = req.dn.toString()
const dn = req.dn.toString()

if (db[dn]) { return next(new ldap.EntryAlreadyExistsError(dn)) }

@@ -34,7 +34,7 @@ server.add(SUFFIX, authorize, function (req, res, next) {
})

server.bind(SUFFIX, function (req, res, next) {
var dn = req.dn.toString()
const dn = req.dn.toString()
if (!db[dn]) { return next(new ldap.NoSuchObjectError(dn)) }

if (!db[dn].userpassword) { return next(new ldap.NoSuchAttributeError('userPassword')) }
@@ -46,14 +46,14 @@ server.bind(SUFFIX, function (req, res, next) {
})

server.compare(SUFFIX, authorize, function (req, res, next) {
var dn = req.dn.toString()
const dn = req.dn.toString()
if (!db[dn]) { return next(new ldap.NoSuchObjectError(dn)) }

if (!db[dn][req.attribute]) { return next(new ldap.NoSuchAttributeError(req.attribute)) }

var matches = false
var vals = db[dn][req.attribute]
for (var i = 0; i < vals.length; i++) {
let matches = false
const vals = db[dn][req.attribute]
for (let i = 0; i < vals.length; i++) {
if (vals[i] === req.value) {
matches = true
break
@@ -65,7 +65,7 @@ server.compare(SUFFIX, authorize, function (req, res, next) {
})

server.del(SUFFIX, authorize, function (req, res, next) {
var dn = req.dn.toString()
const dn = req.dn.toString()
if (!db[dn]) { return next(new ldap.NoSuchObjectError(dn)) }

delete db[dn]
@@ -75,14 +75,14 @@ server.del(SUFFIX, authorize, function (req, res, next) {
})

server.modify(SUFFIX, authorize, function (req, res, next) {
var dn = req.dn.toString()
const dn = req.dn.toString()
if (!req.changes.length) { return next(new ldap.ProtocolError('changes required')) }
if (!db[dn]) { return next(new ldap.NoSuchObjectError(dn)) }

var entry = db[dn]
const entry = db[dn]

let mod
for (var i = 0; i < req.changes.length; i++) {
for (let i = 0; i < req.changes.length; i++) {
mod = req.changes[i].modification
switch (req.changes[i].operation) {
case 'replace':
@@ -121,10 +121,10 @@ server.modify(SUFFIX, authorize, function (req, res, next) {
})

server.search(SUFFIX, authorize, function (req, res, next) {
var dn = req.dn.toString()
const dn = req.dn.toString()
if (!db[dn]) { return next(new ldap.NoSuchObjectError(dn)) }

var scopeCheck
let scopeCheck

switch (req.scope) {
case 'base':
@@ -142,7 +142,7 @@ server.search(SUFFIX, authorize, function (req, res, next) {
scopeCheck = function (k) {
if (req.dn.equals(k)) { return true }

var parent = ldap.parseDN(k).parent()
const parent = ldap.parseDN(k).parent()
return (parent ? parent.equals(req.dn) : false)
}
break
8 changes: 4 additions & 4 deletions lib/assert.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright 2015 Joyent, Inc.

var assert = require('assert')
var util = require('util')
const assert = require('assert')
const util = require('util')

var isDN = require('./dn').DN.isDN
var isAttribute = require('./attribute').isAttribute
const isDN = require('./dn').DN.isDN
const isAttribute = require('./attribute').isAttribute

/// --- Helpers

16 changes: 8 additions & 8 deletions lib/attribute.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright 2011 Mark Cavage, Inc. All rights reserved.

var assert = require('assert')
const assert = require('assert')

var asn1 = require('asn1')
const asn1 = require('asn1')

var Protocol = require('./protocol')
const Protocol = require('./protocol')

/// --- API

@@ -42,13 +42,13 @@ Object.defineProperties(Attribute.prototype, {
},
vals: {
get: function getVals () {
var eType = _bufferEncoding(this.type)
const eType = _bufferEncoding(this.type)
return this._vals.map(function (v) {
return v.toString(eType)
})
},
set: function setVals (vals) {
var self = this
const self = this
this._vals = []
if (Array.isArray(vals)) {
vals.forEach(function (v) {
@@ -81,7 +81,7 @@ Attribute.compare = function compare (a, b) {
if (a.vals.length < b.vals.length) return -1
if (a.vals.length > b.vals.length) return 1

for (var i = 0; i < a.vals.length; i++) {
for (let i = 0; i < a.vals.length; i++) {
if (a.vals[i] < b.vals[i]) return -1
if (a.vals[i] > b.vals[i]) return 1
}
@@ -98,7 +98,7 @@ Attribute.prototype.parse = function parse (ber) {

if (ber.peek() === Protocol.LBER_SET) {
if (ber.readSequence(Protocol.LBER_SET)) {
var end = ber.offset + ber.length
const end = ber.offset + ber.length
while (ber.offset < end) { this._vals.push(ber.readString(asn1.Ber.OctetString, true)) }
}
}
@@ -116,7 +116,7 @@ Attribute.prototype.toBer = function toBer (ber) {
this._vals.forEach(function (b) {
ber.writeByte(asn1.Ber.OctetString)
ber.writeLength(b.length)
for (var i = 0; i < b.length; i++) { ber.writeByte(b[i]) }
for (let i = 0; i < b.length; i++) { ber.writeByte(b[i]) }
})
} else {
ber.writeStringArray([])
21 changes: 11 additions & 10 deletions lib/change.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright 2011 Mark Cavage, Inc. All rights reserved.

var assert = require('assert-plus')
const assert = require('assert-plus')

var Attribute = require('./attribute')
const Attribute = require('./attribute')
// var Protocol = require('./protocol')

/// --- API
@@ -68,15 +68,15 @@ Object.defineProperties(Change.prototype, {
return
}

var keys = Object.keys(val)
const keys = Object.keys(val)
if (keys.length > 1) {
throw new Error('Only one attribute per Change allowed')
} else if (keys.length === 0) {
return
}

var k = keys[0]
var _attr = new Attribute({ type: k })
const k = keys[0]
const _attr = new Attribute({ type: k })
if (Array.isArray(val[k])) {
val[k].forEach(function (v) {
_attr.addValue(v.toString())
@@ -136,9 +136,9 @@ Change.apply = function apply (change, obj, scalar) {
assert.ok(Array.isArray(change.modification.vals))
assert.object(obj)

var type = change.modification.type
var vals = change.modification.vals
var data = obj[type]
const type = change.modification.type
const vals = change.modification.vals
let data = obj[type]
if (data !== undefined) {
if (!Array.isArray(data)) {
data = [data]
@@ -156,13 +156,14 @@ Change.apply = function apply (change, obj, scalar) {
data = vals
}
break
case 'add':
case 'add': {
// add only new unique entries
var newValues = vals.filter(function (entry) {
const newValues = vals.filter(function (entry) {
return (data.indexOf(entry) === -1)
})
data = data.concat(newValues)
break
}
case 'delete':
data = data.filter(function (entry) {
return (vals.indexOf(entry) === -1)
Loading