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:
416416 - .evergreen/run-kerberos-tests.sh
417417
418418 " run ldap tests " :
419+ - command : ec2.assume_role
420+ params :
421+ role_arn : ${DRIVERS_SECRETS_ARN}
419422 - command : subprocess.exec
420423 type : test
421424 params :
422425 working_dir : src
423426 binary : bash
424427 env :
425- PROJECT_DIRECTORY : ${PROJECT_DIRECTORY}
426428 DRIVERS_TOOLS : ${DRIVERS_TOOLS}
427- MONGODB_URI : ${plain_auth_mongodb_uri}
428429 NODE_LTS_VERSION : ${NODE_LTS_VERSION}
429430 args :
430431 - .evergreen/run-ldap-tests.sh
Original file line number Diff line number Diff line change @@ -364,15 +364,16 @@ functions:
364364 args :
365365 - .evergreen/run-kerberos-tests.sh
366366 run ldap tests :
367+ - command : ec2.assume_role
368+ params :
369+ role_arn : ${DRIVERS_SECRETS_ARN}
367370 - command : subprocess.exec
368371 type : test
369372 params :
370373 working_dir : src
371374 binary : bash
372375 env :
373- PROJECT_DIRECTORY : ${PROJECT_DIRECTORY}
374376 DRIVERS_TOOLS : ${DRIVERS_TOOLS}
375- MONGODB_URI : ${plain_auth_mongodb_uri}
376377 NODE_LTS_VERSION : ${NODE_LTS_VERSION}
377378 args :
378379 - .evergreen/run-ldap-tests.sh
Original file line number Diff line number Diff line change 11#! /bin/bash
22
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
44
5+ bash $DRIVERS_TOOLS /.evergreen/secrets_handling/setup-secrets.sh drivers/enterprise_auth
6+ source secrets-export.sh
57source $DRIVERS_TOOLS /.evergreen/init-node-and-npm-env.sh
68
79npm run check:ldap
Original file line number Diff line number Diff line change 154154 "check:oidc-k8s" : " mocha --config test/mocha_mongodb.json test/integration/auth/mongodb_oidc_k8s.prose.07.test.ts" ,
155155 "check:kerberos" : " nyc mocha --config test/manual/mocharc.json test/manual/kerberos.test.ts" ,
156156 "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 " ,
158158 "check:socks5" : " mocha --config test/manual/mocharc.json test/manual/socks5.test.ts" ,
159159 "check:csfle" : " mocha --config test/mocha_mongodb.json test/integration/client-side-encryption" ,
160160 "check:snappy" : " mocha test/unit/assorted/snappy.test.js" ,
175175 "moduleResolution" : " node"
176176 }
177177 }
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