
Security News
Open Source Maintainers Demand Ability to Block Copilot-Generated Issues and PRs
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
ldap-directory-manager
Advanced tools
schema-aware, type-safe LDAP manager, written in typescript to create hight-level functionalities
schema-aware, type-safe LDAP manager, written in typescript to create hight-level functionalities.
import { Client } from "ldap-directory-manager";
const baseDN = "DC=Domain,DC=Com";
const config: IClientConfig = {
ldapServerUrl: process.env.AD_URI ?? "",
user: process.env.AD_USER ?? "",
pass: process.env.AD_Pass ?? "",
};
const client = new Client(config);
const user = await userGetOne("username*", {
attributes: ["displayName", "userPrincipalName"],
client,
});
console.log(user);
generate typescript interfaces from ldap schema. (this is recommended just for first time and after each ldap schema modification)
const config = {
ldapServerUrl: process.env.AD_URI ?? "",
user: process.env.AD_USER ?? "",
pass: process.env.AD_Pass ?? "",
};
const interfaceDirPath = await initial({
generateInterfaces: true,
useCachedInterfaces: false,
...config,
});
auto complete and type check, base on ldap schema interfaces that generated at first time.
Example 1
import { Client } from "ldap-directory-manager";
import { User } from "./generated/interfaces";
const baseDN = "DC=Domain,DC=Com";
const config: IClientConfig = {
ldapServerUrl: process.env.AD_URI ?? "",
user: process.env.AD_USER ?? "",
pass: process.env.AD_Pass ?? "",
};
const client = new Client(config);
const user = await userGetOne<User>("username*", {
attributes: [
"displayName",
"userPrincipalName",
"adminDisplayName",
"assistant",
"manager",
],
client,
});
console.log(user);
Example 2 (using ldap-query-generator which will be install with package):
import { QueryGenerator } from "ldap-query-generator";
import { Client } from "ldap-directory-manager";
import { User } from "./generated/interfaces";
const baseDN = "DC=Domain,DC=Com";
const config: IClientConfig = {
ldapServerUrl: process.env.AD_URI ?? "",
user: process.env.AD_USER ?? "",
pass: process.env.AD_Pass ?? "",
};
const client = new Client(config);
const qGen = new QueryGenerator<User>({
logger,
scope: "sub",
});
const { query } = qGen
.where({ field: "userPrincipalName", action: "substrings", criteria })
.whereAnd({ field: "objectClass", action: "equal", criteria: "user" })
.whereOr({ field: "objectClass", action: "equal", criteria: "person" })
.whereNot({
field: "objectClass",
action: "equal",
criteria: "computer",
})
.whereNot({ field: "objectClass", action: "equal", criteria: "group" })
.select(["displayName", "userPrincipalName"]);
const data = await client.queryAttributes<User>({
base: baseDN,
attributes: query.attributes,
options: {
filter: query.toString(),
scope: query.scope,
paged: true,
},
});
Dealing with LDAP servers to get information is hard!
the goal of this package is to:
FAQs
schema-aware, type-safe LDAP manager, written in typescript to create hight-level functionalities
The npm package ldap-directory-manager receives a total of 5 weekly downloads. As such, ldap-directory-manager popularity was classified as not popular.
We found that ldap-directory-manager demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
Research
Security News
Malicious Koishi plugin silently exfiltrates messages with hex strings to a hardcoded QQ account, exposing secrets in chatbots across platforms.
Research
Security News
Malicious PyPI checkers validate stolen emails against TikTok and Instagram APIs, enabling targeted account attacks and dark web credential sales.