Comparing version 7.0.12 to 7.1.0
@@ -201,2 +201,3 @@ import { BerWriter, BerReader } from 'asn1'; | ||
messageDetails?: MessageParserErrorDetails; | ||
constructor(message: string); | ||
} | ||
@@ -206,3 +207,3 @@ | ||
code: number; | ||
constructor(code: number, message: string); | ||
protected constructor(code: number, message: string); | ||
} | ||
@@ -209,0 +210,0 @@ |
{ | ||
"name": "ldapts", | ||
"version": "7.0.12", | ||
"version": "7.1.0", | ||
"description": "LDAP client", | ||
@@ -30,3 +30,3 @@ "main": "./dist/index.cjs", | ||
"lint:markdown": "prettier --write '*.md' '!(node_modules|dist)/**/*.md' && markdownlint '*.md' '!(node_modules|dist)/**/*.md' --config=.github/linters/.markdown-lint.yml --fix", | ||
"lint:code": "eslint --fix --ext .ts src tests", | ||
"lint:code": "eslint --fix", | ||
"lint": "run-p lint:*", | ||
@@ -73,7 +73,6 @@ "lint-staged": "lint-staged", | ||
"@types/asn1": ">=0.2.4", | ||
"@types/uuid": ">=9", | ||
"asn1": "~0.2.6", | ||
"debug": "~4.3.4", | ||
"debug": "~4.3.5", | ||
"strict-event-emitter-types": "~2.0.0", | ||
"uuid": "~9.0.1" | ||
"uuid": "~10.0.0" | ||
}, | ||
@@ -84,32 +83,24 @@ "devDependencies": { | ||
"@types/debug": "~4.1.12", | ||
"@types/mocha": "~10.0.6", | ||
"@types/mocha": "~10.0.7", | ||
"@types/node": ">=20", | ||
"@types/sinon": "~17.0.3", | ||
"@typescript-eslint/eslint-plugin": "~7.9.0", | ||
"@typescript-eslint/parser": "~7.9.0", | ||
"chai": "~4.4.1", | ||
"chai-as-promised": "~7.1.2", | ||
"eslint": "~8.57.0", | ||
"eslint-config-airbnb-base": "~15.0.0", | ||
"eslint-config-airbnb-typescript": "~18.0.0", | ||
"eslint-config-prettier": "~9.1.0", | ||
"eslint-plugin-import": "~2.29.1", | ||
"eslint-plugin-jsdoc": "~48.2.4", | ||
"eslint-plugin-mocha": "10.4.3", | ||
"eslint-plugin-prettier": "~5.1.3", | ||
"eslint-plugin-promise": "~6.1.1", | ||
"eslint-plugin-security": "~3.0.0", | ||
"@types/uuid": ">=10", | ||
"chai": "~5.1.1", | ||
"chai-as-promised": "~8.0.0", | ||
"eslint": "~9.6.0", | ||
"eslint-config-decent": "^1.3.0", | ||
"husky": "~9.0.11", | ||
"lint-staged": "~15.2.2", | ||
"markdownlint-cli": "~0.40.0", | ||
"mocha": "~10.4.0", | ||
"lint-staged": "~15.2.7", | ||
"markdownlint-cli": "~0.41.0", | ||
"mocha": "~10.6.0", | ||
"npm-run-all": "~4.1.5", | ||
"pinst": "~3.0.0", | ||
"prettier": "~3.2.5", | ||
"sinon": "~17.0.1", | ||
"prettier": "~3.3.2", | ||
"sinon": "~18.0.0", | ||
"ts-mockito": "~2.6.1", | ||
"tsx": "~4.10.2", | ||
"typescript": "~5.4.5", | ||
"tsx": "~4.16.2", | ||
"typescript": "~5.5.3", | ||
"typescript-eslint": "~8.0.0-alpha.41", | ||
"unbuild": "2.0.0" | ||
} | ||
} |
@@ -53,6 +53,5 @@ export type RDNAttributes = Record<string, string>; | ||
for (let i = 0; i < ourKeys.length; i += 1) { | ||
const key = ourKeys[i]; | ||
if (key == null || ourKeys[i] !== otherKeys[i]) { | ||
for (const [i, key] of ourKeys.entries()) { | ||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition | ||
if (key == null || key !== otherKeys[i]) { | ||
return false; | ||
@@ -119,4 +118,4 @@ } | ||
const escaped = /[\\"]/; | ||
const special = /[,=+<>#;]/; | ||
const escaped = /["\\]/; | ||
const special = /[#+,;<=>]/; | ||
@@ -123,0 +122,0 @@ if (len > 0) { |
@@ -8,2 +8,9 @@ export interface MessageParserErrorDetails { | ||
public messageDetails?: MessageParserErrorDetails; | ||
public constructor(message: string) { | ||
super(message); | ||
this.name = 'MessageParserError'; | ||
Object.setPrototypeOf(this, MessageParserError.prototype); | ||
} | ||
} |
@@ -6,3 +6,6 @@ import { ResultCodeError } from './ResultCodeError.js'; | ||
super(11, message ?? 'An LDAP server limit set by an administrative authority has been exceeded.'); | ||
this.name = 'AdminLimitExceededError'; | ||
Object.setPrototypeOf(this, AdminLimitExceededError.prototype); | ||
} | ||
} |
@@ -6,3 +6,6 @@ import { ResultCodeError } from './ResultCodeError.js'; | ||
super(71, message ?? 'The modify DN operation moves the entry from one LDAP server to another and thus requires more than one LDAP server.'); | ||
this.name = 'AffectsMultipleDSAsError'; | ||
Object.setPrototypeOf(this, AffectsMultipleDSAsError.prototype); | ||
} | ||
} |
@@ -6,3 +6,6 @@ import { ResultCodeError } from './ResultCodeError.js'; | ||
super(36, message ?? "Either the client does not have access rights to read the aliased object's name or dereferencing is not allowed."); | ||
this.name = 'AliasDerefProblemError'; | ||
Object.setPrototypeOf(this, AliasDerefProblemError.prototype); | ||
} | ||
} |
@@ -6,3 +6,6 @@ import { ResultCodeError } from './ResultCodeError.js'; | ||
super(33, message ?? 'An error occurred when an alias was dereferenced.'); | ||
this.name = 'AliasProblemError'; | ||
Object.setPrototypeOf(this, AliasProblemError.prototype); | ||
} | ||
} |
@@ -6,3 +6,6 @@ import { ResultCodeError } from './ResultCodeError.js'; | ||
super(68, message ?? 'The add operation attempted to add an entry that already exists, or that the modify operation attempted to rename an entry to the name of an entry that already exists.'); | ||
this.name = 'AlreadyExistsError'; | ||
Object.setPrototypeOf(this, AlreadyExistsError.prototype); | ||
} | ||
} |
@@ -6,3 +6,6 @@ import { ResultCodeError } from './ResultCodeError.js'; | ||
super(7, message ?? 'The Directory Server does not support the requested Authentication Method.'); | ||
this.name = 'AuthMethodNotSupportedError'; | ||
Object.setPrototypeOf(this, AuthMethodNotSupportedError.prototype); | ||
} | ||
} |
@@ -6,3 +6,6 @@ import { ResultCodeError } from './ResultCodeError.js'; | ||
super(51, message ?? 'The LDAP server is too busy to process the client request at this time.'); | ||
this.name = 'BusyError'; | ||
Object.setPrototypeOf(this, BusyError.prototype); | ||
} | ||
} |
@@ -10,3 +10,6 @@ import { ResultCodeError } from './ResultCodeError.js'; | ||
); | ||
this.name = 'ConfidentialityRequiredError'; | ||
Object.setPrototypeOf(this, ConfidentialityRequiredError.prototype); | ||
} | ||
} |
@@ -10,3 +10,6 @@ import { ResultCodeError } from './ResultCodeError.js'; | ||
); | ||
this.name = 'ConstraintViolationError'; | ||
Object.setPrototypeOf(this, ConstraintViolationError.prototype); | ||
} | ||
} |
@@ -6,3 +6,6 @@ import { ResultCodeError } from './ResultCodeError.js'; | ||
super(48, message ?? 'The client is attempting to use an authentication method incorrectly.'); | ||
this.name = 'InappropriateAuthError'; | ||
Object.setPrototypeOf(this, InappropriateAuthError.prototype); | ||
} | ||
} |
@@ -6,3 +6,6 @@ import { ResultCodeError } from './ResultCodeError.js'; | ||
super(18, message ?? "The matching rule specified in the search filter does not match a rule defined for the attribute's syntax."); | ||
this.name = 'InappropriateMatchingError'; | ||
Object.setPrototypeOf(this, InappropriateMatchingError.prototype); | ||
} | ||
} |
@@ -6,3 +6,6 @@ import { ResultCodeError } from './ResultCodeError.js'; | ||
super(50, message ?? 'The caller does not have sufficient rights to perform the requested operation.'); | ||
this.name = 'InsufficientAccessError'; | ||
Object.setPrototypeOf(this, InsufficientAccessError.prototype); | ||
} | ||
} |
@@ -6,3 +6,6 @@ import { ResultCodeError } from './ResultCodeError.js'; | ||
super(49, message ?? 'Invalid credentials during a bind operation.'); | ||
this.name = 'InvalidCredentialsError'; | ||
Object.setPrototypeOf(this, InvalidCredentialsError.prototype); | ||
} | ||
} |
@@ -6,3 +6,6 @@ import { ResultCodeError } from './ResultCodeError.js'; | ||
super(34, message ?? 'The syntax of the DN is incorrect.'); | ||
this.name = 'InvalidDNSyntaxError'; | ||
Object.setPrototypeOf(this, InvalidDNSyntaxError.prototype); | ||
} | ||
} |
@@ -6,3 +6,6 @@ import { ResultCodeError } from './ResultCodeError.js'; | ||
super(21, message ?? 'The attribute value specified in an Add Request, Compare Request, or Modify Request operation is an unrecognized or invalid syntax for the attribute.'); | ||
this.name = 'InvalidSyntaxError'; | ||
Object.setPrototypeOf(this, InvalidSyntaxError.prototype); | ||
} | ||
} |
@@ -6,3 +6,6 @@ import { ResultCodeError } from './ResultCodeError.js'; | ||
super(35, message ?? 'The specified operation cannot be performed on a leaf entry.'); | ||
this.name = 'IsLeafError'; | ||
Object.setPrototypeOf(this, IsLeafError.prototype); | ||
} | ||
} |
@@ -6,3 +6,6 @@ import { ResultCodeError } from './ResultCodeError.js'; | ||
super(54, message ?? 'The client discovered an alias or LDAP Referral loop, and is thus unable to complete this request.'); | ||
this.name = 'LoopDetectError'; | ||
Object.setPrototypeOf(this, LoopDetectError.prototype); | ||
} | ||
} |
@@ -6,3 +6,6 @@ import { ResultCodeError } from './ResultCodeError.js'; | ||
super(64, message ?? "The Add Request or Modify DN Request operation violates the schema's structure rules."); | ||
this.name = 'NamingViolationError'; | ||
Object.setPrototypeOf(this, NamingViolationError.prototype); | ||
} | ||
} |
@@ -6,3 +6,6 @@ import { ResultCodeError } from './ResultCodeError.js'; | ||
super(69, message ?? 'The modify operation attempted to modify the structure rules of an object class.'); | ||
this.name = 'NoObjectClassModsError'; | ||
Object.setPrototypeOf(this, NoObjectClassModsError.prototype); | ||
} | ||
} |
@@ -6,3 +6,6 @@ import { ResultCodeError } from './ResultCodeError.js'; | ||
super(248, message ?? 'No result message for the request.'); | ||
this.name = 'NoResultError'; | ||
Object.setPrototypeOf(this, NoResultError.prototype); | ||
} | ||
} |
@@ -6,3 +6,6 @@ import { ResultCodeError } from './ResultCodeError.js'; | ||
super(16, message ?? 'The attribute specified in the Modify Request or Compare Request operation does not exist in the entry.'); | ||
this.name = 'NoSuchAttributeError'; | ||
Object.setPrototypeOf(this, NoSuchAttributeError.prototype); | ||
} | ||
} |
@@ -6,3 +6,6 @@ import { ResultCodeError } from './ResultCodeError.js'; | ||
super(32, message ?? 'The target object cannot be found.'); | ||
this.name = 'NoSuchObjectError'; | ||
Object.setPrototypeOf(this, NoSuchObjectError.prototype); | ||
} | ||
} |
@@ -6,3 +6,6 @@ import { ResultCodeError } from './ResultCodeError.js'; | ||
super(66, message ?? 'The requested operation is permitted only on leaf entries.'); | ||
this.name = 'NotAllowedOnNonLeafError'; | ||
Object.setPrototypeOf(this, NotAllowedOnNonLeafError.prototype); | ||
} | ||
} |
@@ -6,3 +6,6 @@ import { ResultCodeError } from './ResultCodeError.js'; | ||
super(67, message ?? "The modify operation attempted to remove an attribute value that forms the entry's relative distinguished name."); | ||
this.name = 'NotAllowedOnRDNError'; | ||
Object.setPrototypeOf(this, NotAllowedOnRDNError.prototype); | ||
} | ||
} |
@@ -6,3 +6,6 @@ import { ResultCodeError } from './ResultCodeError.js'; | ||
super(65, message ?? 'The Add Request, Modify Request, or modify DN operation violates the object class rules for the entry.'); | ||
this.name = 'ObjectClassViolationError'; | ||
Object.setPrototypeOf(this, ObjectClassViolationError.prototype); | ||
} | ||
} |
@@ -6,3 +6,6 @@ import { ResultCodeError } from './ResultCodeError.js'; | ||
super(1, message ?? 'Request was out of sequence with another operation in progress.'); | ||
this.name = 'OperationsError'; | ||
Object.setPrototypeOf(this, OperationsError.prototype); | ||
} | ||
} |
@@ -6,3 +6,6 @@ import { ResultCodeError } from './ResultCodeError.js'; | ||
super(2, message ?? 'Client sent data to the server that did not comprise a valid LDAP request.'); | ||
this.name = 'ProtocolError'; | ||
Object.setPrototypeOf(this, ProtocolError.prototype); | ||
} | ||
} |
export abstract class ResultCodeError extends Error { | ||
public code: number; | ||
public constructor(code: number, message: string) { | ||
super(); | ||
protected constructor(code: number, message: string) { | ||
super(`${message} Code: 0x${code.toString(16)}`); | ||
this.name = 'ResultCodeError'; | ||
this.code = code; | ||
this.message = `${message} Code: 0x${code.toString(16)}`; | ||
Object.setPrototypeOf(this, ResultCodeError.prototype); | ||
} | ||
} |
@@ -6,3 +6,6 @@ import { ResultCodeError } from './ResultCodeError.js'; | ||
super(70, message ?? 'Results are too large.'); | ||
this.name = 'ResultsTooLargeError'; | ||
Object.setPrototypeOf(this, ResultsTooLargeError.prototype); | ||
} | ||
} |
@@ -11,3 +11,6 @@ import type { BindResponse } from '../../messages/BindResponse.js'; | ||
this.response = response; | ||
this.name = 'SaslBindInProgressError'; | ||
Object.setPrototypeOf(this, SaslBindInProgressError.prototype); | ||
} | ||
} |
@@ -6,3 +6,6 @@ import { ResultCodeError } from './ResultCodeError.js'; | ||
super(4, message ?? 'There were more entries matching the criteria contained in a SearchRequest operation than were allowed to be returned by the size limit configuration.'); | ||
this.name = 'SizeLimitExceededError'; | ||
Object.setPrototypeOf(this, SizeLimitExceededError.prototype); | ||
} | ||
} |
@@ -6,3 +6,6 @@ import { ResultCodeError } from './ResultCodeError.js'; | ||
super(8, message ?? 'Client requested an operation that requires strong authentication.'); | ||
this.name = 'StrongAuthRequiredError'; | ||
Object.setPrototypeOf(this, StrongAuthRequiredError.prototype); | ||
} | ||
} |
@@ -10,3 +10,6 @@ import { ResultCodeError } from './ResultCodeError.js'; | ||
); | ||
this.name = 'TimeLimitExceededError'; | ||
Object.setPrototypeOf(this, TimeLimitExceededError.prototype); | ||
} | ||
} |
@@ -6,3 +6,6 @@ import { ResultCodeError } from './ResultCodeError.js'; | ||
super(112, message ?? 'TLS is not supported on the server.'); | ||
this.name = 'TLSNotSupportedError'; | ||
Object.setPrototypeOf(this, TLSNotSupportedError.prototype); | ||
} | ||
} |
@@ -6,3 +6,6 @@ import { ResultCodeError } from './ResultCodeError.js'; | ||
super(20, message ?? 'The attribute value specified in a Add Request or Modify Request operation already exists as a value for that attribute.'); | ||
this.name = 'TypeOrValueExistsError'; | ||
Object.setPrototypeOf(this, TypeOrValueExistsError.prototype); | ||
} | ||
} |
@@ -9,3 +9,6 @@ import { ResultCodeError } from './ResultCodeError.js'; | ||
); | ||
this.name = 'UnavailableCriticalExtensionError'; | ||
Object.setPrototypeOf(this, UnavailableCriticalExtensionError.prototype); | ||
} | ||
} |
@@ -6,3 +6,6 @@ import { ResultCodeError } from './ResultCodeError.js'; | ||
super(52, message ?? "The LDAP server cannot process the client's bind request."); | ||
this.name = 'UnavailableError'; | ||
Object.setPrototypeOf(this, UnavailableError.prototype); | ||
} | ||
} |
@@ -6,3 +6,6 @@ import { ResultCodeError } from './ResultCodeError.js'; | ||
super(17, message ?? "The attribute specified in the modify or add operation does not exist in the LDAP server's schema."); | ||
this.name = 'UndefinedTypeError'; | ||
Object.setPrototypeOf(this, UndefinedTypeError.prototype); | ||
} | ||
} |
@@ -6,3 +6,6 @@ import { ResultCodeError } from './ResultCodeError.js'; | ||
super(code, message ?? 'Unknown error.'); | ||
this.name = 'UnknownStatusCodeError'; | ||
Object.setPrototypeOf(this, UnknownStatusCodeError.prototype); | ||
} | ||
} |
@@ -6,3 +6,6 @@ import { ResultCodeError } from './ResultCodeError.js'; | ||
super(53, message ?? 'The LDAP server cannot process the request because of server-defined restrictions.'); | ||
this.name = 'UnwillingToPerformError'; | ||
Object.setPrototypeOf(this, UnwillingToPerformError.prototype); | ||
} | ||
} |
@@ -229,3 +229,3 @@ import type { BerReader } from 'asn1'; | ||
} else { | ||
const matches = /^[-\w]+/.exec(filterString); | ||
const matches = /^[\w-]+/.exec(filterString); | ||
if (matches?.length) { | ||
@@ -349,3 +349,3 @@ [attribute] = matches; | ||
const value = input.substr(index + 1, 2); | ||
if (/^[a-fA-F0-9]{2}$/.exec(value) === null) { | ||
if (/^[\dA-Fa-f]{2}$/.exec(value) === null) { | ||
throw new Error(`Invalid escaped hex character: ${value} in value: ${input}`); | ||
@@ -352,0 +352,0 @@ } |
@@ -135,4 +135,4 @@ import type { BerReader, BerWriter } from 'asn1'; | ||
private static _escapeRegExp(str: string): string { | ||
return str.replace(/[-[\]/{}()*+?.\\^$|]/g, '\\$&'); | ||
return str.replace(/[$()*+./?[\\\]^{|}-]/g, '\\$&'); | ||
} | ||
} |
@@ -40,3 +40,2 @@ import * as assert from 'assert'; | ||
// eslint-disable-next-line no-plusplus | ||
while (intSize-- > 0) { | ||
@@ -43,0 +42,0 @@ writer.writeByte((i & 0xff000000) >> 24); |
@@ -43,3 +43,3 @@ import type { BerReader, BerWriter } from 'asn1'; | ||
this.value = reader.readString(0x81) ?? ''; | ||
} catch (ex) { | ||
} catch { | ||
this.value = reader.readString(0x81, true) ?? Buffer.alloc(0); | ||
@@ -46,0 +46,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
564363
5
24
12229
+ Addeduuid@10.0.0(transitive)
- Removed@types/uuid@>=9
- Removed@types/uuid@10.0.0(transitive)
- Removeduuid@9.0.1(transitive)
Updateddebug@~4.3.5
Updateduuid@~10.0.0