File tree Expand file tree Collapse file tree 3 files changed +7
-8
lines changed Expand file tree Collapse file tree 3 files changed +7
-8
lines changed Original file line number Diff line number Diff line change 1
- import ldapts from "ldapts" ;
1
+ import { Client , Change , Attribute } from "ldapts" ;
2
2
import { mergeAttributes , createAttributes } from "model-attributes" ;
3
3
import { Service } from "@kronos-integration/service" ;
4
4
import { expand } from "./util.mjs" ;
@@ -67,7 +67,7 @@ export class ServiceLDAP extends Service {
67
67
}
68
68
69
69
async prepareRequest ( request ) {
70
- const client = new ldapts . Client ( { url : this . url } ) ;
70
+ const client = new Client ( { url : this . url } ) ;
71
71
if ( request . bind ) {
72
72
await client . bind ( request . bind . dn , request . bind . password ) ;
73
73
}
@@ -109,9 +109,9 @@ export class ServiceLDAP extends Service {
109
109
110
110
const changes = Object . entries ( request . replace ) . map (
111
111
( [ type , values ] ) =>
112
- new ldapts . Change ( {
112
+ new Change ( {
113
113
operation : "replace" ,
114
- modification : new ldapts . Attribute ( {
114
+ modification : new Attribute ( {
115
115
type,
116
116
values : asArray ( values )
117
117
} )
@@ -156,7 +156,7 @@ export class ServiceLDAP extends Service {
156
156
async authenticate ( props ) {
157
157
const { username, password } = props ;
158
158
159
- const client = new ldapts . Client ( { url : this . url } ) ;
159
+ const client = new Client ( { url : this . url } ) ;
160
160
161
161
const values = {
162
162
username
Original file line number Diff line number Diff line change 1
- import ldapts from "ldapts" ;
1
+ import { Client } from "ldapts" ;
2
2
import ldif from "ldif" ;
3
3
4
4
async function importLDIF ( file , options ) {
5
5
const data = ldif . parseFile ( file ) ;
6
6
7
- const client = new ldapts . Client ( options ) ;
7
+ const client = new Client ( options ) ;
8
8
9
9
console . log ( options ) ;
10
10
Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ mkdir -p /tmp/slapd
7
7
8
8
case $( uname) in
9
9
" Darwin" )
10
- /opt/homebrew/opt/openldap/bin
11
10
export PATH=" /opt/homebrew/opt/openldap/bin:/opt/homebrew/opt/openldap/sbin:$PATH "
12
11
SLAPD=/opt/homebrew/opt/openldap/libexec/slapd
13
12
SLAPD_CONF=/tmp/slapd/slapd.conf
You can’t perform that action at this time.
0 commit comments