Socket
Socket
Sign inDemoInstall

ldap-ts-client

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ldap-ts-client - npm Package Compare versions

Comparing version 0.9.1-beta1 to 0.9.1-beta10

23

dist/app.js

@@ -13,3 +13,26 @@ "use strict";

baseDN: "DC=ki,DC=local",
queueDisable: false,
};
const client1 = new index_1.Client(options);
const data1 = await client1.queryAttributes({
attributes: ["cn"],
options: {
filter: "(&(objectClass=user)(cn=*))",
scope: "sub",
paged: true,
},
});
console.log(`File: app.ts,`, `Line: 17 => `, data1.length);
client1.unbind();
const client2 = new index_1.Client(options);
const data2 = await client2.queryAttributes({
attributes: ["cn"],
options: {
filter: "(&(objectClass=user)(cn=*))",
scope: "sub",
paged: true,
},
});
console.log(`File: app.ts,`, `Line: 17 => `, data2.length);
client2.unbind();
const client = new index_1.Client(options);

@@ -16,0 +39,0 @@ // const delResult = await client.del({

15

dist/index.js

@@ -17,6 +17,3 @@ "use strict";

this.baseDN = config.baseDN;
this.client = ldapjs_1.default.createClient({
url: config.ldapServerUrl,
log: this.config.logger,
});
this.client = ldapjs_1.default.createClient(Object.assign(Object.assign({}, this.config), { url: this.config.ldapServerUrl, log: this.config.logger }));
}

@@ -28,2 +25,11 @@ /** @return a connected ldap client that is useful for use flexibility of [ldap.js](http://ldapjs.org/) directly. */

return new Promise((resolve, reject) => {
if (this.client) {
this.client.destroy((err) => {
reject(err);
});
}
this.client = ldapjs_1.default.createClient(Object.assign(Object.assign({}, this.config), { url: this.config.ldapServerUrl, log: this.config.logger }));
this.client.on("connectError", (err) => {
reject(err);
});
this.client.bind(this.config.user, this.config.pass, (err, result) => {

@@ -33,3 +39,2 @@ if (err) {

}
console.log(`File: index.ts,`, `Line: 105 => `, this.client.connected);
resolve(this.client);

@@ -36,0 +41,0 @@ });

{
"name": "ldap-ts-client",
"version": "0.9.1-beta1",
"version": "0.9.1-beta10",
"description": "Type-safe LDAP client written in typescript",

@@ -5,0 +5,0 @@ "repository": {

@@ -12,3 +12,28 @@ import { config } from "dotenv";

baseDN: "DC=ki,DC=local",
queueDisable: false,
};
const client1 = new Client(options);
const data1 = await client1.queryAttributes<User>({
attributes: ["cn"],
options: {
filter: "(&(objectClass=user)(cn=*))",
scope: "sub",
paged: true,
},
});
console.log(`File: app.ts,`, `Line: 17 => `, data1.length);
client1.unbind();
const client2 = new Client(options);
const data2 = await client2.queryAttributes<User>({
attributes: ["cn"],
options: {
filter: "(&(objectClass=user)(cn=*))",
scope: "sub",
paged: true,
},
});
console.log(`File: app.ts,`, `Line: 17 => `, data2.length);
client2.unbind();
const client = new Client(options);

@@ -15,0 +40,0 @@

@@ -36,3 +36,2 @@ import ldap, { SearchOptions, Control, SearchEntryObject } from "ldapjs";

}
interface QueryFnInput<T> {

@@ -87,3 +86,4 @@ options?: Omit<SearchOptions, "attributes">;

this.client = ldap.createClient({
url: config.ldapServerUrl,
...this.config,
url: this.config.ldapServerUrl,
log: this.config.logger,

@@ -102,2 +102,18 @@ });

return new Promise((resolve, reject) => {
if (this.client) {
this.client.destroy((err: any) => {
reject(err);
});
}
this.client = ldap.createClient({
...this.config,
url: this.config.ldapServerUrl,
log: this.config.logger,
});
this.client.on("connectError", (err) => {
reject(err);
});
this.client.bind(this.config.user, this.config.pass, (err, result) => {

@@ -108,4 +124,2 @@ if (err) {

console.log(`File: index.ts,`, `Line: 105 => `, this.client.connected);
resolve(this.client);

@@ -112,0 +126,0 @@ });

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc