Skip to content

Commit f89cb07

Browse files
committed
fix: use named exports of ldapts
1 parent d3015de commit f89cb07

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

src/service-ldap.mjs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import ldapts from "ldapts";
1+
import { Client, Change, Attribute } from "ldapts";
22
import { mergeAttributes, createAttributes } from "model-attributes";
33
import { Service } from "@kronos-integration/service";
44
import { expand } from "./util.mjs";
@@ -67,7 +67,7 @@ export class ServiceLDAP extends Service {
6767
}
6868

6969
async prepareRequest(request) {
70-
const client = new ldapts.Client({ url: this.url });
70+
const client = new Client({ url: this.url });
7171
if (request.bind) {
7272
await client.bind(request.bind.dn, request.bind.password);
7373
}
@@ -109,9 +109,9 @@ export class ServiceLDAP extends Service {
109109

110110
const changes = Object.entries(request.replace).map(
111111
([type, values]) =>
112-
new ldapts.Change({
112+
new Change({
113113
operation: "replace",
114-
modification: new ldapts.Attribute({
114+
modification: new Attribute({
115115
type,
116116
values: asArray(values)
117117
})
@@ -156,7 +156,7 @@ export class ServiceLDAP extends Service {
156156
async authenticate(props) {
157157
const { username, password } = props;
158158

159-
const client = new ldapts.Client({ url: this.url });
159+
const client = new Client({ url: this.url });
160160

161161
const values = {
162162
username

tests/helpers/ldapadd.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import ldapts from "ldapts";
1+
import { Client } from "ldapts";
22
import ldif from "ldif";
33

44
async function importLDIF(file, options) {
55
const data = ldif.parseFile(file);
66

7-
const client = new ldapts.Client(options);
7+
const client = new Client(options);
88

99
console.log(options);
1010

tests/start-local-ldap.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ mkdir -p /tmp/slapd
77

88
case $(uname) in
99
"Darwin" )
10-
/opt/homebrew/opt/openldap/bin
1110
export PATH="/opt/homebrew/opt/openldap/bin:/opt/homebrew/opt/openldap/sbin:$PATH"
1211
SLAPD=/opt/homebrew/opt/openldap/libexec/slapd
1312
SLAPD_CONF=/tmp/slapd/slapd.conf

0 commit comments

Comments
 (0)