Merge branch 'master' into 645-search-response-spaces-dn

This commit is contained in:
spookiej 2020-07-28 08:53:58 +10:00 committed by GitHub
commit 53c6275610
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 47 additions and 21 deletions

18
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,18 @@
version: 2
updates:
- package-ecosystem: "github-actions"
# versioning-strategy: increase-if-necessary
directory: "/"
schedule:
interval: "weekly"
day: "saturday"
time: "03:00"
timezone: "America/New_York"
- package-ecosystem: "npm"
versioning-strategy: increase-if-necessary
directory: "/"
schedule:
interval: "weekly"
day: "saturday"
time: "03:00"
timezone: "America/New_York"

View File

@ -11,7 +11,7 @@ jobs:
name: Lint Check name: Lint Check
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v2
- uses: actions/setup-node@v1 - uses: actions/setup-node@v1
- name: Install Packages - name: Install Packages
run: npm install run: npm install
@ -29,9 +29,10 @@ jobs:
- 10.13.0 - 10.13.0
- 10.x - 10.x
- 12.x - 12.x
- 14.x
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v2
- uses: actions/setup-node@v1 - uses: actions/setup-node@v1
with: with:
node-version: ${{ matrix.node }} node-version: ${{ matrix.node }}
@ -40,12 +41,12 @@ jobs:
- name: Run Tests - name: Run Tests
run: npm run test:ci run: npm run test:ci
- name: Coveralls Parallel - name: Coveralls Parallel
uses: coverallsapp/github-action@master uses: coverallsapp/github-action@v1.1.1
with: with:
github-token: ${{ secrets.GITHUB_TOKEN }} github-token: ${{ secrets.GITHUB_TOKEN }}
parallel: true parallel: true
- name: Coveralls Finished - name: Coveralls Finished
uses: coverallsapp/github-action@master uses: coverallsapp/github-action@v1.1.1
with: with:
github-token: ${{ secrets.GITHUB_TOKEN }} github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true parallel-finished: true

View File

@ -2,14 +2,10 @@
// var assert = require('assert') // var assert = require('assert')
var asn1 = require('asn1')
var Protocol = require('../protocol') var Protocol = require('../protocol')
/// --- Globals /// --- Globals
var BerWriter = asn1.BerWriter
var TYPES = { var TYPES = {
and: Protocol.FILTER_AND, and: Protocol.FILTER_AND,
or: Protocol.FILTER_OR, or: Protocol.FILTER_OR,
@ -38,9 +34,18 @@ function isFilter (filter) {
return false return false
} }
function isBerWriter (ber) {
return Boolean(
ber &&
typeof (ber) === 'object' &&
typeof (ber.startSequence) === 'function' &&
typeof (ber.endSequence) === 'function'
)
}
function mixin (target) { function mixin (target) {
target.prototype.toBer = function toBer (ber) { target.prototype.toBer = function toBer (ber) {
if (!ber || !(ber instanceof BerWriter)) { throw new TypeError('ber (BerWriter) required') } if (isBerWriter(ber) === false) { throw new TypeError('ber (BerWriter) required') }
ber.startSequence(TYPES[this.type]) ber.startSequence(TYPES[this.type])
ber = this._toBer(ber) ber = this._toBer(ber)

View File

@ -1,6 +1,6 @@
'use strict' 'use strict'
const logger = Object.create(require('abstract-logging')) const logger = require('abstract-logging')
logger.child = function () { return logger } logger.child = function () { return logger }
module.exports = logger module.exports = logger

View File

@ -3,7 +3,7 @@
"name": "ldapjs", "name": "ldapjs",
"homepage": "http://ldapjs.org", "homepage": "http://ldapjs.org",
"description": "LDAP client and server APIs", "description": "LDAP client and server APIs",
"version": "2.0.0", "version": "2.1.0",
"license": "MIT", "license": "MIT",
"repository": { "repository": {
"type": "git", "type": "git",
@ -17,7 +17,7 @@
"node": ">=10.13.0" "node": ">=10.13.0"
}, },
"dependencies": { "dependencies": {
"abstract-logging": "^1.0.0", "abstract-logging": "^2.0.0",
"asn1": "^0.2.4", "asn1": "^0.2.4",
"assert-plus": "^1.0.0", "assert-plus": "^1.0.0",
"backoff": "^2.5.0", "backoff": "^2.5.0",
@ -28,11 +28,10 @@
}, },
"devDependencies": { "devDependencies": {
"get-port": "^5.1.1", "get-port": "^5.1.1",
"husky": "^3.0.4", "husky": "^4.2.5",
"snazzy": "^8.0.0", "snazzy": "^8.0.0",
"standard": "^14.0.2", "standard": "^14.0.2",
"tap": "14.10.1", "tap": "14.10.8"
"uuid": "^3.3.3"
}, },
"scripts": { "scripts": {
"test": "tap --no-cov", "test": "tap --no-cov",

View File

@ -3,10 +3,9 @@
const util = require('util') const util = require('util')
const assert = require('assert') const assert = require('assert')
const tap = require('tap') const tap = require('tap')
const uuid = require('uuid')
const vasync = require('vasync') const vasync = require('vasync')
const getPort = require('get-port') const getPort = require('get-port')
const { getSock } = require('./utils') const { getSock, uuid } = require('./utils')
const ldap = require('../lib') const ldap = require('../lib')
const { Attribute, Change } = ldap const { Attribute, Change } = ldap

View File

@ -1,8 +1,7 @@
'use strict' 'use strict'
const tap = require('tap') const tap = require('tap')
const uuid = require('uuid') const { getSock, uuid } = require('./utils')
const { getSock } = require('./utils')
const ldap = require('../lib') const ldap = require('../lib')
function search (t, options, callback) { function search (t, options, callback) {

View File

@ -2,7 +2,11 @@
const os = require('os') const os = require('os')
const path = require('path') const path = require('path')
const uuid = require('uuid') const crypto = require('crypto')
function uuid () {
return crypto.randomBytes(16).toString('hex')
}
function getSock () { function getSock () {
if (process.platform === 'win32') { if (process.platform === 'win32') {
@ -13,5 +17,6 @@ function getSock () {
} }
module.exports = { module.exports = {
getSock getSock,
uuid
} }