File tree Expand file tree Collapse file tree 6 files changed +30
-33
lines changed Expand file tree Collapse file tree 6 files changed +30
-33
lines changed Original file line number Diff line number Diff line change @@ -416,15 +416,16 @@ functions:
416
416
- .evergreen/run-kerberos-tests.sh
417
417
418
418
" run ldap tests " :
419
+ - command : ec2.assume_role
420
+ params :
421
+ role_arn : ${DRIVERS_SECRETS_ARN}
419
422
- command : subprocess.exec
420
423
type : test
421
424
params :
422
425
working_dir : src
423
426
binary : bash
424
427
env :
425
- PROJECT_DIRECTORY : ${PROJECT_DIRECTORY}
426
428
DRIVERS_TOOLS : ${DRIVERS_TOOLS}
427
- MONGODB_URI : ${plain_auth_mongodb_uri}
428
429
NODE_LTS_VERSION : ${NODE_LTS_VERSION}
429
430
args :
430
431
- .evergreen/run-ldap-tests.sh
Original file line number Diff line number Diff line change @@ -364,15 +364,16 @@ functions:
364
364
args :
365
365
- .evergreen/run-kerberos-tests.sh
366
366
run ldap tests :
367
+ - command : ec2.assume_role
368
+ params :
369
+ role_arn : ${DRIVERS_SECRETS_ARN}
367
370
- command : subprocess.exec
368
371
type : test
369
372
params :
370
373
working_dir : src
371
374
binary : bash
372
375
env :
373
- PROJECT_DIRECTORY : ${PROJECT_DIRECTORY}
374
376
DRIVERS_TOOLS : ${DRIVERS_TOOLS}
375
- MONGODB_URI : ${plain_auth_mongodb_uri}
376
377
NODE_LTS_VERSION : ${NODE_LTS_VERSION}
377
378
args :
378
379
- .evergreen/run-ldap-tests.sh
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
- set -o errexit # Exit the script with error if any of the commands fail
3
+ set -o errexit # Exit the script with error if any of the commands fail
4
4
5
+ bash $DRIVERS_TOOLS /.evergreen/secrets_handling/setup-secrets.sh drivers/enterprise_auth
6
+ source secrets-export.sh
5
7
source $DRIVERS_TOOLS /.evergreen/init-node-and-npm-env.sh
6
8
7
9
npm run check:ldap
Original file line number Diff line number Diff line change 154
154
"check:oidc-k8s" : " mocha --config test/mocha_mongodb.json test/integration/auth/mongodb_oidc_k8s.prose.07.test.ts" ,
155
155
"check:kerberos" : " nyc mocha --config test/manual/mocharc.json test/manual/kerberos.test.ts" ,
156
156
"check:tls" : " mocha --config test/manual/mocharc.json test/manual/tls_support.test.ts" ,
157
- "check:ldap" : " nyc mocha --config test/manual/mocharc.json test/manual/ldap.test.js " ,
157
+ "check:ldap" : " nyc mocha --config test/manual/mocharc.json test/manual/ldap.test.ts " ,
158
158
"check:socks5" : " mocha --config test/manual/mocharc.json test/manual/socks5.test.ts" ,
159
159
"check:csfle" : " mocha --config test/mocha_mongodb.json test/integration/client-side-encryption" ,
160
160
"check:snappy" : " mocha test/unit/assorted/snappy.test.js" ,
175
175
"moduleResolution" : " node"
176
176
}
177
177
}
178
- }
178
+ }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ import { expect } from 'chai' ;
2
+
3
+ import { MongoClient } from '../mongodb' ;
4
+
5
+ describe ( 'LDAP' , function ( ) {
6
+ const { SASL_USER , SASL_PASS , SASL_HOST } = process . env ;
7
+
8
+ const MONGODB_URI = `mongodb://${ SASL_USER } :${ SASL_PASS } @${ SASL_HOST } ?authMechanism=plain&authSource=$external` ;
9
+
10
+ it ( 'Should correctly authenticate against ldap' , async function ( ) {
11
+ const client = new MongoClient ( MONGODB_URI ) ;
12
+ await client . connect ( ) ;
13
+
14
+ const doc = await client . db ( 'ldap' ) . collection ( 'test' ) . findOne ( ) ;
15
+ expect ( doc ) . property ( 'ldap' ) . to . equal ( true ) ;
16
+
17
+ await client . close ( ) ;
18
+ } ) ;
19
+ } ) ;
You can’t perform that action at this time.
0 commit comments