Replace node-filter (resolves #622) (#808)

This commit is contained in:
James Sumners 2022-06-10 19:25:02 -04:00
parent cb70776445
commit 5bab39f58e
12 changed files with 25 additions and 19 deletions

View File

@ -3,7 +3,7 @@
const assert = require('assert')
const util = require('util')
const parents = require('ldap-filter')
const parents = require('@ldapjs/filter')
const Filter = require('./filter')

View File

@ -3,7 +3,7 @@
const assert = require('assert')
const util = require('util')
const parents = require('ldap-filter')
const parents = require('@ldapjs/filter')
const Filter = require('./filter')

View File

@ -4,7 +4,7 @@ const assert = require('assert-plus')
const util = require('util')
const ASN1 = require('@ldapjs/asn1').Ber
const parents = require('ldap-filter')
const parents = require('@ldapjs/filter')
const Filter = require('./filter')
@ -20,7 +20,7 @@ module.exports = EqualityFilter
EqualityFilter.prototype.matches = function (target, strictAttrCase) {
assert.object(target, 'target')
const tv = parents.getAttrValue(target, this.attribute, strictAttrCase)
const tv = parents.getAttrValue({ sourceObject: target, attributeName: this.attribute, strictCase: strictAttrCase })
let value = this.value
if (this.attribute.toLowerCase() === 'objectclass') {
@ -29,13 +29,19 @@ EqualityFilter.prototype.matches = function (target, strictAttrCase) {
* implementation behaves in this manner.
*/
value = value.toLowerCase()
return parents.testValues(function (v) {
return parents.testValues({
rule: function (v) {
return value === v.toLowerCase()
}, tv)
},
value: tv
})
} else {
return parents.testValues(function (v) {
return parents.testValues({
rule: function (v) {
return value === v
}, tv)
},
value: tv
})
}
}

View File

@ -3,7 +3,7 @@
const assert = require('assert')
const util = require('util')
const parents = require('ldap-filter')
const parents = require('@ldapjs/filter')
const Filter = require('./filter')

View File

@ -3,7 +3,7 @@
const assert = require('assert')
const util = require('util')
const parents = require('ldap-filter')
const parents = require('@ldapjs/filter')
const Filter = require('./filter')

View File

@ -4,7 +4,7 @@ const assert = require('assert')
const asn1 = require('@ldapjs/asn1')
const parents = require('ldap-filter')
const parents = require('@ldapjs/filter')
const Protocol = require('@ldapjs/protocol')

View File

@ -3,7 +3,7 @@
const assert = require('assert')
const util = require('util')
const parents = require('ldap-filter')
const parents = require('@ldapjs/filter')
const Filter = require('./filter')

View File

@ -3,7 +3,7 @@
const assert = require('assert')
const util = require('util')
const parents = require('ldap-filter')
const parents = require('@ldapjs/filter')
const Filter = require('./filter')

View File

@ -3,7 +3,7 @@
const assert = require('assert')
const util = require('util')
const parents = require('ldap-filter')
const parents = require('@ldapjs/filter')
const Filter = require('./filter')

View File

@ -3,7 +3,7 @@
const assert = require('assert')
const util = require('util')
const parents = require('ldap-filter')
const parents = require('@ldapjs/filter')
const Filter = require('./filter')

View File

@ -3,7 +3,7 @@
const assert = require('assert')
const util = require('util')
const parents = require('ldap-filter')
const parents = require('@ldapjs/filter')
const Filter = require('./filter')

View File

@ -19,11 +19,11 @@
"dependencies": {
"@ldapjs/asn1": "^1.0.0",
"@ldapjs/controls": "^1.0.0",
"@ldapjs/filter": "^1.0.0-rc.1",
"@ldapjs/protocol": "^1.0.0",
"abstract-logging": "^2.0.0",
"assert-plus": "^1.0.0",
"backoff": "^2.5.0",
"ldap-filter": "^0.3.3",
"once": "^1.4.0",
"vasync": "^2.2.0",
"verror": "^1.8.1"