Socket
Socket
Sign inDemoInstall

ldap-schema-ts-generator

Package Overview
Dependencies
Maintainers
1
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ldap-schema-ts-generator - npm Package Compare versions

Comparing version 2.1.2 to 2.1.3

40

dist/services/attribute.js

@@ -8,10 +8,24 @@ "use strict";

(_a = options.logger) === null || _a === void 0 ? void 0 : _a.trace("getSchemaAttributes()");
const adClient = new ldap_ts_client_1.Client({
bindDN: options.user,
secret: options.pass,
url: options.ldapServerUrl,
const client = new ldap_ts_client_1.Client({
user: options.user,
pass: options.pass,
ldapServerUrl: options.ldapServerUrl,
baseDN: schemaDn,
logger: options.logger,
});
const objectAttributes = await adClient.queryAttributes({
const objectAttributes = await client.queryAttributes({
attributes: [
"cn",
"attributeID",
"attributeSyntax",
"isSingleValued",
"showInAdvancedViewOnly",
"adminDisplayName",
"adminDescription",
"oMSyntax",
"lDAPDisplayName",
"systemOnly",
"systemFlags",
"objectCategory",
],
options: {

@@ -22,19 +36,5 @@ sizeLimit: 200,

scope: "one",
attributes: [
"cn",
"attributeID",
"attributeSyntax",
"isSingleValued",
"showInAdvancedViewOnly",
"adminDisplayName",
"adminDescription",
"oMSyntax",
"lDAPDisplayName",
"systemOnly",
"systemFlags",
"objectCategory",
],
},
});
adClient.unbind();
client.unbind();
return objectAttributes;

@@ -41,0 +41,0 @@ }

@@ -10,17 +10,17 @@ "use strict";

(_a = options.logger) === null || _a === void 0 ? void 0 : _a.trace("getSchemaCapabilities()");
const adClient = new ldap_ts_client_1.Client({
bindDN: options.user,
secret: options.pass,
url: options.ldapServerUrl,
const client = new ldap_ts_client_1.Client({
user: options.user,
pass: options.pass,
ldapServerUrl: options.ldapServerUrl,
baseDN: "",
logger: options.logger,
});
const data = await adClient.queryAttributes({
const data = await client.queryAttributes({
attributes: ["supportedCapabilities"],
options: {
filter: "&(objectClass=*)",
scope: "base",
attributes: ["supportedCapabilities"],
},
});
adClient.unbind();
client.unbind();
return data[0].supportedCapabilities;

@@ -27,0 +27,0 @@ }

@@ -8,10 +8,37 @@ "use strict";

(_a = options.logger) === null || _a === void 0 ? void 0 : _a.trace("getSchemaClasses()");
const adClient = new ldap_ts_client_1.Client({
bindDN: options.user,
secret: options.pass,
url: options.ldapServerUrl,
const client = new ldap_ts_client_1.Client({
user: options.user,
pass: options.pass,
ldapServerUrl: options.ldapServerUrl,
baseDN: schemaDn,
logger: options.logger,
});
const objectClasses = await adClient.queryAttributes({
const objectClasses = await client.queryAttributes({
attributes: [
"objectClass",
"cn",
"instanceType",
"subClassOf",
"auxiliaryClass",
"systemAuxiliaryClass",
"governsID",
"rDNAttID",
"showInAdvancedViewOnly",
"adminDisplayName",
"adminDescription",
"objectClassCategory",
"lDAPDisplayName",
"name",
"systemOnly",
"systemPossSuperiors",
"systemMayContain",
"systemMustContain",
"systemFlags",
"defaultHidingValue",
"objectCategory",
"defaultObjectCategory",
"mustContain",
"mayContain",
"possSuperiors",
],
options: {

@@ -22,32 +49,5 @@ sizeLimit: 200,

scope: "one",
attributes: [
"objectClass",
"cn",
"instanceType",
"subClassOf",
"auxiliaryClass",
"systemAuxiliaryClass",
"governsID",
"rDNAttID",
"showInAdvancedViewOnly",
"adminDisplayName",
"adminDescription",
"objectClassCategory",
"lDAPDisplayName",
"name",
"systemOnly",
"systemPossSuperiors",
"systemMayContain",
"systemMustContain",
"systemFlags",
"defaultHidingValue",
"objectCategory",
"defaultObjectCategory",
"mustContain",
"mayContain",
"possSuperiors",
],
},
});
adClient.unbind();
client.unbind();
return objectClasses;

@@ -54,0 +54,0 @@ }

@@ -7,17 +7,11 @@ "use strict";

(_a = options.logger) === null || _a === void 0 ? void 0 : _a.trace("getSchemaControls()");
const adClient = new ldap_ts_client_1.Client({
bindDN: options.user,
secret: options.pass,
url: options.ldapServerUrl,
baseDN: "",
logger: options.logger,
});
const data = await adClient.queryAttributes({
const client = new ldap_ts_client_1.Client(Object.assign(Object.assign({}, options), { baseDN: "", logger: options.logger }));
const data = await client.queryAttributes({
attributes: ["supportedControl"],
options: {
filter: "&(objectClass=*)",
scope: "base",
attributes: ["supportedControl"],
},
});
adClient.unbind();
client.unbind();
return data[0].supportedControl;

@@ -24,0 +18,0 @@ }

@@ -10,17 +10,11 @@ "use strict";

(_a = options.logger) === null || _a === void 0 ? void 0 : _a.trace("getSchemaExtensions()");
const adClient = new ldap_ts_client_1.Client({
bindDN: options.user,
secret: options.pass,
url: options.ldapServerUrl,
baseDN: "",
logger: options.logger,
});
const data = await adClient.queryAttributes({
const client = new ldap_ts_client_1.Client(Object.assign(Object.assign({}, options), { baseDN: "", logger: options.logger }));
const data = await client.queryAttributes({
attributes: ["supportedExtension"],
options: {
filter: "&(objectClass=*)",
scope: "base",
attributes: ["supportedExtension"],
},
});
adClient.unbind();
client.unbind();
return data[0].supportedExtension;

@@ -27,0 +21,0 @@ }

@@ -10,17 +10,11 @@ "use strict";

(_a = options.logger) === null || _a === void 0 ? void 0 : _a.trace("getSupportedLdapVersions()");
const adClient = new ldap_ts_client_1.Client({
bindDN: options.user,
secret: options.pass,
url: options.ldapServerUrl,
baseDN: "",
logger: options.logger,
});
const data = await adClient.queryAttributes({
const client = new ldap_ts_client_1.Client(Object.assign(Object.assign({}, options), { baseDN: "", logger: options.logger }));
const data = await client.queryAttributes({
attributes: ["supportedLDAPVersion"],
options: {
filter: "(&(objectClass=*))",
scope: "base",
attributes: ["supportedLDAPVersion"],
},
});
adClient.unbind();
client.unbind();
return data[0].supportedLDAPVersion;

@@ -27,0 +21,0 @@ }

@@ -12,10 +12,15 @@ "use strict";

(_a = options.logger) === null || _a === void 0 ? void 0 : _a.trace("getLinkIds()");
const adClient = new ldap_ts_client_1.Client({
bindDN: options.user,
secret: options.pass,
url: options.ldapServerUrl,
baseDN: schemaDn,
logger: options.logger,
});
const objectAttributes = await adClient.queryAttributes({
const client = new ldap_ts_client_1.Client(Object.assign(Object.assign({}, options), { baseDN: schemaDn, logger: options.logger }));
const objectAttributes = await client.queryAttributes({
attributes: [
"cn",
"attributeID",
"attributeSyntax",
"isSingleValued",
"adminDisplayName",
"adminDescription",
"lDAPDisplayName",
"systemOnly",
"LinkID",
],
options: {

@@ -26,16 +31,5 @@ sizeLimit: 1000,

scope: "one",
attributes: [
"cn",
"attributeID",
"attributeSyntax",
"isSingleValued",
"adminDisplayName",
"adminDescription",
"lDAPDisplayName",
"systemOnly",
"LinkID",
],
},
});
adClient.unbind();
client.unbind();
const linkIds = objectAttributes;

@@ -42,0 +36,0 @@ /** sort the result base on linkID field */

@@ -10,17 +10,11 @@ "use strict";

(_a = options.logger) === null || _a === void 0 ? void 0 : _a.trace("getNamingContexts()");
const adClient = new ldap_ts_client_1.Client({
bindDN: options.user,
secret: options.pass,
url: options.ldapServerUrl,
baseDN: "",
logger: options.logger,
});
const data = await adClient.queryAttributes({
const client = new ldap_ts_client_1.Client(Object.assign(Object.assign({}, options), { baseDN: "", logger: options.logger }));
const data = await client.queryAttributes({
attributes: ["namingContexts"],
options: {
filter: "(&(objectClass=*))",
scope: "base",
attributes: ["namingContexts"],
},
});
adClient.unbind();
client.unbind();
return data[0].namingContexts;

@@ -35,17 +29,11 @@ }

(_a = options.logger) === null || _a === void 0 ? void 0 : _a.trace("getDefaultNamingContext()");
const adClient = new ldap_ts_client_1.Client({
bindDN: options.user,
secret: options.pass,
url: options.ldapServerUrl,
baseDN: "",
logger: options.logger,
});
const data = await adClient.queryAttributes({
const client = new ldap_ts_client_1.Client(Object.assign(Object.assign({}, options), { baseDN: "", logger: options.logger }));
const data = await client.queryAttributes({
attributes: ["defaultNamingContext"],
options: {
filter: "(&(objectClass=*))",
scope: "base",
attributes: ["defaultNamingContext"],
},
});
adClient.unbind();
client.unbind();
return data[0].defaultNamingContext;

@@ -60,17 +48,11 @@ }

(_a = options.logger) === null || _a === void 0 ? void 0 : _a.trace("getSchemaNamingContext()");
const adClient = new ldap_ts_client_1.Client({
bindDN: options.user,
secret: options.pass,
url: options.ldapServerUrl,
baseDN: "",
logger: options.logger,
});
const data = await adClient.queryAttributes({
const client = new ldap_ts_client_1.Client(Object.assign(Object.assign({}, options), { baseDN: "", logger: options.logger }));
const data = await client.queryAttributes({
attributes: ["schemaNamingContext"],
options: {
filter: "(&(objectClass=*))",
scope: "base",
attributes: ["schemaNamingContext"],
},
});
adClient.unbind();
client.unbind();
return data[0].schemaNamingContext;

@@ -85,17 +67,11 @@ }

(_a = options.logger) === null || _a === void 0 ? void 0 : _a.trace("getSchemaNamingContext()");
const adClient = new ldap_ts_client_1.Client({
bindDN: options.user,
secret: options.pass,
url: options.ldapServerUrl,
baseDN: "",
logger: options.logger,
});
const data = await adClient.queryAttributes({
const client = new ldap_ts_client_1.Client(Object.assign(Object.assign({}, options), { baseDN: "", logger: options.logger }));
const data = await client.queryAttributes({
attributes: ["rootDomainNamingContext"],
options: {
filter: "(&(objectClass=*))",
scope: "base",
attributes: ["rootDomainNamingContext"],
},
});
adClient.unbind();
client.unbind();
return data[0].rootDomainNamingContext;

@@ -110,17 +86,11 @@ }

(_a = options.logger) === null || _a === void 0 ? void 0 : _a.trace("getSchemaNamingContext()");
const adClient = new ldap_ts_client_1.Client({
bindDN: options.user,
secret: options.pass,
url: options.ldapServerUrl,
baseDN: "",
logger: options.logger,
});
const data = await adClient.queryAttributes({
const client = new ldap_ts_client_1.Client(Object.assign(Object.assign({}, options), { baseDN: "", logger: options.logger }));
const data = await client.queryAttributes({
attributes: ["configurationNamingContext"],
options: {
filter: "(&(objectClass=*))",
scope: "base",
attributes: ["configurationNamingContext"],
},
});
adClient.unbind();
client.unbind();
return data[0].configurationNamingContext;

@@ -127,0 +97,0 @@ }

@@ -10,17 +10,11 @@ "use strict";

(_a = options.logger) === null || _a === void 0 ? void 0 : _a.trace("getSchemaPolicies()");
const adClient = new ldap_ts_client_1.Client({
bindDN: options.user,
secret: options.pass,
url: options.ldapServerUrl,
baseDN: "",
logger: options.logger,
});
const data = await adClient.queryAttributes({
const client = new ldap_ts_client_1.Client(Object.assign(Object.assign({}, options), { baseDN: "", logger: options.logger }));
const data = await client.queryAttributes({
attributes: ["supportedLDAPPolicies"],
options: {
filter: "&(objectClass=*)",
scope: "base",
attributes: ["supportedLDAPPolicies"],
},
});
adClient.unbind();
client.unbind();
return data[0].supportedLDAPPolicies;

@@ -27,0 +21,0 @@ }

@@ -10,17 +10,11 @@ "use strict";

(_a = options.logger) === null || _a === void 0 ? void 0 : _a.trace("getRootDSE()");
const adClient = new ldap_ts_client_1.Client({
bindDN: options.user,
secret: options.pass,
url: options.ldapServerUrl,
baseDN: "",
logger: options.logger,
});
const data = await adClient.queryAttributes({
const client = new ldap_ts_client_1.Client(Object.assign(Object.assign({}, options), { baseDN: "", logger: options.logger }));
const data = await client.queryAttributes({
attributes: ["*"],
options: {
filter: "(&(objectClass=*))",
scope: "base",
attributes: ["*"],
},
});
adClient.unbind();
client.unbind();
return data;

@@ -36,17 +30,11 @@ }

(_a = options.logger) === null || _a === void 0 ? void 0 : _a.trace("getSubSchemaSubEntry()");
const adClient = new ldap_ts_client_1.Client({
bindDN: options.user,
secret: options.pass,
url: options.ldapServerUrl,
baseDN: "",
logger: options.logger,
});
const data = await adClient.queryAttributes({
const client = new ldap_ts_client_1.Client(Object.assign(Object.assign({}, options), { baseDN: "", logger: options.logger }));
const data = await client.queryAttributes({
attributes: ["subschemaSubentry"],
options: {
filter: "&(objectClass=*)",
scope: "base",
attributes: ["subschemaSubentry"],
},
});
adClient.unbind();
client.unbind();
return data[0].subschemaSubentry;

@@ -53,0 +41,0 @@ }

@@ -14,17 +14,11 @@ "use strict";

(_a = options.logger) === null || _a === void 0 ? void 0 : _a.trace("getSupportedSaslMechanisms()");
const adClient = new ldap_ts_client_1.Client({
bindDN: options.user,
secret: options.pass,
url: options.ldapServerUrl,
baseDN: "",
logger: options.logger,
});
const data = await adClient.queryAttributes({
const client = new ldap_ts_client_1.Client(Object.assign(Object.assign({}, options), { baseDN: "", logger: options.logger }));
const data = await client.queryAttributes({
attributes: ["supportedSASLMechanisms"],
options: {
filter: "(&(objectClass=*))",
scope: "base",
attributes: ["supportedSASLMechanisms"],
},
});
adClient.unbind();
client.unbind();
return data[0].supportedSASLMechanisms;

@@ -31,0 +25,0 @@ }

{
"name": "ldap-schema-ts-generator",
"version": "2.1.2",
"version": "2.1.3",
"description": "Typescript typedef and meta-data generator for LDAP Schema. It can be useful to interact from schema-aware/type-safe LDAP Client with LDAP servers like active directory.",

@@ -20,3 +20,3 @@ "repository": {

"tsc:watch": "tsc --watch",
"prepublishOnly": "npm run tsc",
"prepublishOnly": "npm run tsc && npm run gen-docs",
"prod": "node --unhandled-rejections=strict dist/app.js",

@@ -50,12 +50,12 @@ "dev": "nodemon --watch dist --exec \"npm run prod\"",

"@types/node": "^13.11.1",
"@typescript-eslint/eslint-plugin": "^2.27.0",
"@typescript-eslint/parser": "^2.27.0",
"@typescript-eslint/eslint-plugin": "^2.28.0",
"@typescript-eslint/parser": "^2.28.0",
"dotenv": "^8.2.0",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.10.1",
"eslint-plugin-prettier": "^3.1.2",
"eslint-plugin-prettier": "^3.1.3",
"jest": "^25.3.0",
"nodemon": "^2.0.3",
"npm-run-all": "^4.1.5",
"ts-jest": "^25.3.1",
"ts-jest": "^25.4.0",
"typedoc": "^0.17.4",

@@ -66,5 +66,4 @@ "typescript": "^3.8.3"

"@types/ldapjs": "^1.0.7",
"@types/pino": "^5.17.0",
"fast-node-logger": "^1.3.4",
"ldap-ts-client": "0.0.3",
"fast-node-logger": "^1.4.0",
"ldap-ts-client": "^0.9.0",
"pascal-case": "^3.1.1",

@@ -71,0 +70,0 @@ "prettier": "^2.0.4"

@@ -147,6 +147,6 @@ # Typescript typedef and meta-data generator for LDAP Schema

- [x] change relation DN fields type from object to string
- [x] generate ldap controls supported by server from RootDSE
- [x] generate ldap capabilities supported by server from RootDSE
- [x] generate ldap extensions supported by server from RootDSE
- [x] generate ldap policies supported by server from RootDSE
- [x] generate Enum for ldap controls supported by server from RootDSE
- [x] generate Enum for ldap capabilities supported by server from RootDSE
- [x] generate Enum for ldap extensions supported by server from RootDSE
- [x] generate Enum for ldap policies supported by server from RootDSE
- [ ] generate Base DNs from RootDSE (List of DNs of all the naming contexts and application partitions maintained by the DC)

@@ -156,2 +156,12 @@ - [ ] generate naming contexts fields from RootDSE (e.g. defaultNamingContext, configurationNamingContext, schemaNamingContext, rootNamingContext)

- [ ] add option to customize generated file names with prefix/postfix (now it 's using Pascal case of ldap display name as interface and file name)
- [ ] create out folders if not exist instead of throwing error
- [ ] generate graphql types and CRUD operations
- [ ] generate Type for each objectClass in schema
- [ ] respect inheritance
- [ ] respect relations by linkID attribute
- [ ] use dn as identification field
- [ ] generate general operations for each Type:
- [ ] Query get by dn
- [ ] Mutation delete by dn
- [ ] Mutation update by dn (input only not readonly attributes)

@@ -158,0 +168,0 @@ ### Know Issues

@@ -40,6 +40,6 @@ import { Client } from "ldap-ts-client";

options.logger?.trace("getSchemaAttributes()");
const adClient = new Client({
bindDN: options.user,
secret: options.pass,
url: options.ldapServerUrl,
const client = new Client({
user: options.user,
pass: options.pass,
ldapServerUrl: options.ldapServerUrl,
baseDN: schemaDn,

@@ -49,3 +49,17 @@ logger: options.logger,

const objectAttributes = await adClient.queryAttributes({
const objectAttributes = await client.queryAttributes({
attributes: [
"cn",
"attributeID",
"attributeSyntax",
"isSingleValued",
"showInAdvancedViewOnly",
"adminDisplayName",
"adminDescription",
"oMSyntax",
"lDAPDisplayName",
"systemOnly",
"systemFlags",
"objectCategory",
],
options: {

@@ -56,20 +70,8 @@ sizeLimit: 200,

scope: "one",
attributes: [
"cn",
"attributeID",
"attributeSyntax",
"isSingleValued",
"showInAdvancedViewOnly",
"adminDisplayName",
"adminDescription",
"oMSyntax",
"lDAPDisplayName",
"systemOnly",
"systemFlags",
"objectCategory",
],
},
});
adClient.unbind();
client.unbind();
return objectAttributes;
}

@@ -22,6 +22,6 @@ import { Logger } from "../typings/general/types";

options.logger?.trace("getSchemaCapabilities()");
const adClient = new Client({
bindDN: options.user,
secret: options.pass,
url: options.ldapServerUrl,
const client = new Client({
user: options.user,
pass: options.pass,
ldapServerUrl: options.ldapServerUrl,
baseDN: "",

@@ -31,11 +31,13 @@ logger: options.logger,

const data = await adClient.queryAttributes({
const data = await client.queryAttributes({
attributes: ["supportedCapabilities"],
options: {
filter: "&(objectClass=*)",
scope: "base",
attributes: ["supportedCapabilities"],
},
});
adClient.unbind();
client.unbind();
return data[0].supportedCapabilities as string[];
}

@@ -57,6 +57,6 @@ import { Client } from "ldap-ts-client";

options.logger?.trace("getSchemaClasses()");
const adClient = new Client({
bindDN: options.user,
secret: options.pass,
url: options.ldapServerUrl,
const client = new Client({
user: options.user,
pass: options.pass,
ldapServerUrl: options.ldapServerUrl,
baseDN: schemaDn,

@@ -66,3 +66,30 @@ logger: options.logger,

const objectClasses = await adClient.queryAttributes({
const objectClasses = await client.queryAttributes({
attributes: [
"objectClass",
"cn",
"instanceType",
"subClassOf",
"auxiliaryClass",
"systemAuxiliaryClass",
"governsID",
"rDNAttID",
"showInAdvancedViewOnly",
"adminDisplayName",
"adminDescription",
"objectClassCategory",
"lDAPDisplayName",
"name",
"systemOnly",
"systemPossSuperiors",
"systemMayContain",
"systemMustContain",
"systemFlags",
"defaultHidingValue",
"objectCategory",
"defaultObjectCategory",
"mustContain",
"mayContain",
"possSuperiors",
],
options: {

@@ -73,33 +100,6 @@ sizeLimit: 200,

scope: "one",
attributes: [
"objectClass",
"cn",
"instanceType",
"subClassOf",
"auxiliaryClass",
"systemAuxiliaryClass",
"governsID",
"rDNAttID",
"showInAdvancedViewOnly",
"adminDisplayName",
"adminDescription",
"objectClassCategory",
"lDAPDisplayName",
"name",
"systemOnly",
"systemPossSuperiors",
"systemMayContain",
"systemMustContain",
"systemFlags",
"defaultHidingValue",
"objectCategory",
"defaultObjectCategory",
"mustContain",
"mayContain",
"possSuperiors",
],
},
});
adClient.unbind();
client.unbind();
return objectClasses;
}

@@ -22,6 +22,4 @@ import { Logger } from "../typings/general/types";

options.logger?.trace("getSchemaControls()");
const adClient = new Client({
bindDN: options.user,
secret: options.pass,
url: options.ldapServerUrl,
const client = new Client({
...options,
baseDN: "",

@@ -31,11 +29,11 @@ logger: options.logger,

const data = await adClient.queryAttributes({
const data = await client.queryAttributes({
attributes: ["supportedControl"],
options: {
filter: "&(objectClass=*)",
scope: "base",
attributes: ["supportedControl"],
},
});
adClient.unbind();
client.unbind();
return data[0].supportedControl as string[];
}

@@ -22,6 +22,4 @@ import { Logger } from "../typings/general/types";

options.logger?.trace("getSchemaExtensions()");
const adClient = new Client({
bindDN: options.user,
secret: options.pass,
url: options.ldapServerUrl,
const client = new Client({
...options,
baseDN: "",

@@ -31,11 +29,11 @@ logger: options.logger,

const data = await adClient.queryAttributes({
const data = await client.queryAttributes({
attributes: ["supportedExtension"],
options: {
filter: "&(objectClass=*)",
scope: "base",
attributes: ["supportedExtension"],
},
});
adClient.unbind();
client.unbind();
return data[0].supportedExtension as string[];
}

@@ -20,6 +20,4 @@ import { Logger } from "../typings/general/types";

options.logger?.trace("getSupportedLdapVersions()");
const adClient = new Client({
bindDN: options.user,
secret: options.pass,
url: options.ldapServerUrl,
const client = new Client({
...options,
baseDN: "",

@@ -29,11 +27,11 @@ logger: options.logger,

const data = await adClient.queryAttributes({
const data = await client.queryAttributes({
attributes: ["supportedLDAPVersion"],
options: {
filter: "(&(objectClass=*))",
scope: "base",
attributes: ["supportedLDAPVersion"],
},
});
adClient.unbind();
client.unbind();
return data[0].supportedLDAPVersion as string[];
}

@@ -43,6 +43,4 @@ import { Client } from "ldap-ts-client";

options.logger?.trace("getLinkIds()");
const adClient = new Client({
bindDN: options.user,
secret: options.pass,
url: options.ldapServerUrl,
const client = new Client({
...options,
baseDN: schemaDn,

@@ -52,3 +50,14 @@ logger: options.logger,

const objectAttributes = await adClient.queryAttributes({
const objectAttributes = await client.queryAttributes({
attributes: [
"cn",
"attributeID",
"attributeSyntax",
"isSingleValued",
"adminDisplayName",
"adminDescription",
"lDAPDisplayName",
"systemOnly",
"LinkID",
],
options: {

@@ -59,16 +68,5 @@ sizeLimit: 1000,

scope: "one",
attributes: [
"cn",
"attributeID",
"attributeSyntax",
"isSingleValued",
"adminDisplayName",
"adminDescription",
"lDAPDisplayName",
"systemOnly",
"LinkID",
],
},
});
adClient.unbind();
client.unbind();

@@ -75,0 +73,0 @@ const linkIds = (objectAttributes as unknown) as SchemaLinkAttribute[];

@@ -20,6 +20,4 @@ import { Logger } from "../typings/general/types";

options.logger?.trace("getNamingContexts()");
const adClient = new Client({
bindDN: options.user,
secret: options.pass,
url: options.ldapServerUrl,
const client = new Client({
...options,
baseDN: "",

@@ -29,10 +27,10 @@ logger: options.logger,

const data = await adClient.queryAttributes({
const data = await client.queryAttributes({
attributes: ["namingContexts"],
options: {
filter: "(&(objectClass=*))",
scope: "base",
attributes: ["namingContexts"],
},
});
adClient.unbind();
client.unbind();
return data[0].namingContexts as string[];

@@ -48,6 +46,4 @@ }

options.logger?.trace("getDefaultNamingContext()");
const adClient = new Client({
bindDN: options.user,
secret: options.pass,
url: options.ldapServerUrl,
const client = new Client({
...options,
baseDN: "",

@@ -57,10 +53,10 @@ logger: options.logger,

const data = await adClient.queryAttributes({
const data = await client.queryAttributes({
attributes: ["defaultNamingContext"],
options: {
filter: "(&(objectClass=*))",
scope: "base",
attributes: ["defaultNamingContext"],
},
});
adClient.unbind();
client.unbind();
return data[0].defaultNamingContext as string;

@@ -76,6 +72,4 @@ }

options.logger?.trace("getSchemaNamingContext()");
const adClient = new Client({
bindDN: options.user,
secret: options.pass,
url: options.ldapServerUrl,
const client = new Client({
...options,
baseDN: "",

@@ -85,10 +79,10 @@ logger: options.logger,

const data = await adClient.queryAttributes({
const data = await client.queryAttributes({
attributes: ["schemaNamingContext"],
options: {
filter: "(&(objectClass=*))",
scope: "base",
attributes: ["schemaNamingContext"],
},
});
adClient.unbind();
client.unbind();
return data[0].schemaNamingContext as string;

@@ -104,6 +98,4 @@ }

options.logger?.trace("getSchemaNamingContext()");
const adClient = new Client({
bindDN: options.user,
secret: options.pass,
url: options.ldapServerUrl,
const client = new Client({
...options,
baseDN: "",

@@ -113,10 +105,10 @@ logger: options.logger,

const data = await adClient.queryAttributes({
const data = await client.queryAttributes({
attributes: ["rootDomainNamingContext"],
options: {
filter: "(&(objectClass=*))",
scope: "base",
attributes: ["rootDomainNamingContext"],
},
});
adClient.unbind();
client.unbind();
return data[0].rootDomainNamingContext as string;

@@ -132,6 +124,4 @@ }

options.logger?.trace("getSchemaNamingContext()");
const adClient = new Client({
bindDN: options.user,
secret: options.pass,
url: options.ldapServerUrl,
const client = new Client({
...options,
baseDN: "",

@@ -141,11 +131,11 @@ logger: options.logger,

const data = await adClient.queryAttributes({
const data = await client.queryAttributes({
attributes: ["configurationNamingContext"],
options: {
filter: "(&(objectClass=*))",
scope: "base",
attributes: ["configurationNamingContext"],
},
});
adClient.unbind();
client.unbind();
return data[0].configurationNamingContext as string;
}

@@ -22,6 +22,4 @@ import { Logger } from "../typings/general/types";

options.logger?.trace("getSchemaPolicies()");
const adClient = new Client({
bindDN: options.user,
secret: options.pass,
url: options.ldapServerUrl,
const client = new Client({
...options,
baseDN: "",

@@ -31,11 +29,11 @@ logger: options.logger,

const data = await adClient.queryAttributes({
const data = await client.queryAttributes({
attributes: ["supportedLDAPPolicies"],
options: {
filter: "&(objectClass=*)",
scope: "base",
attributes: ["supportedLDAPPolicies"],
},
});
adClient.unbind();
client.unbind();
return data[0].supportedLDAPPolicies as string[];
}

@@ -18,6 +18,4 @@ import { Logger } from "../typings/general/types";

options.logger?.trace("getRootDSE()");
const adClient = new Client({
bindDN: options.user,
secret: options.pass,
url: options.ldapServerUrl,
const client = new Client({
...options,
baseDN: "",

@@ -27,10 +25,10 @@ logger: options.logger,

const data = await adClient.queryAttributes({
const data = await client.queryAttributes({
attributes: ["*"],
options: {
filter: "(&(objectClass=*))",
scope: "base",
attributes: ["*"],
},
});
adClient.unbind();
client.unbind();
return data;

@@ -56,6 +54,4 @@ }

options.logger?.trace("getSubSchemaSubEntry()");
const adClient = new Client({
bindDN: options.user,
secret: options.pass,
url: options.ldapServerUrl,
const client = new Client({
...options,
baseDN: "",

@@ -65,11 +61,11 @@ logger: options.logger,

const data = await adClient.queryAttributes({
const data = await client.queryAttributes({
attributes: ["subschemaSubentry"],
options: {
filter: "&(objectClass=*)",
scope: "base",
attributes: ["subschemaSubentry"],
},
});
adClient.unbind();
client.unbind();
return data[0].subschemaSubentry as string;
}

@@ -24,6 +24,4 @@ import { Logger } from "../typings/general/types";

options.logger?.trace("getSupportedSaslMechanisms()");
const adClient = new Client({
bindDN: options.user,
secret: options.pass,
url: options.ldapServerUrl,
const client = new Client({
...options,
baseDN: "",

@@ -33,11 +31,11 @@ logger: options.logger,

const data = await adClient.queryAttributes({
const data = await client.queryAttributes({
attributes: ["supportedSASLMechanisms"],
options: {
filter: "(&(objectClass=*))",
scope: "base",
attributes: ["supportedSASLMechanisms"],
},
});
adClient.unbind();
client.unbind();
return data[0].supportedSASLMechanisms as string[];
}

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

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

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

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