Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .evergreen/config.in.yml
Original file line number Diff line number Diff line change
Expand Up @@ -416,15 +416,16 @@ functions:
- .evergreen/run-kerberos-tests.sh

"run ldap tests":
- command: ec2.assume_role
params:
role_arn: ${DRIVERS_SECRETS_ARN}
- command: subprocess.exec
type: test
params:
working_dir: src
binary: bash
env:
PROJECT_DIRECTORY: ${PROJECT_DIRECTORY}
DRIVERS_TOOLS: ${DRIVERS_TOOLS}
MONGODB_URI: ${plain_auth_mongodb_uri}
NODE_LTS_VERSION: ${NODE_LTS_VERSION}
args:
- .evergreen/run-ldap-tests.sh
Expand Down
5 changes: 3 additions & 2 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -364,15 +364,16 @@ functions:
args:
- .evergreen/run-kerberos-tests.sh
run ldap tests:
- command: ec2.assume_role
params:
role_arn: ${DRIVERS_SECRETS_ARN}
- command: subprocess.exec
type: test
params:
working_dir: src
binary: bash
env:
PROJECT_DIRECTORY: ${PROJECT_DIRECTORY}
DRIVERS_TOOLS: ${DRIVERS_TOOLS}
MONGODB_URI: ${plain_auth_mongodb_uri}
NODE_LTS_VERSION: ${NODE_LTS_VERSION}
args:
- .evergreen/run-ldap-tests.sh
Expand Down
4 changes: 3 additions & 1 deletion .evergreen/run-ldap-tests.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/bin/bash

set -o errexit # Exit the script with error if any of the commands fail
set -o errexit # Exit the script with error if any of the commands fail

bash $DRIVERS_TOOLS/.evergreen/secrets_handling/setup-secrets.sh drivers/enterprise_auth
source secrets-export.sh
source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh

npm run check:ldap
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
"check:oidc-k8s": "mocha --config test/mocha_mongodb.json test/integration/auth/mongodb_oidc_k8s.prose.07.test.ts",
"check:kerberos": "nyc mocha --config test/manual/mocharc.json test/manual/kerberos.test.ts",
"check:tls": "mocha --config test/manual/mocharc.json test/manual/tls_support.test.ts",
"check:ldap": "nyc mocha --config test/manual/mocharc.json test/manual/ldap.test.js",
"check:ldap": "nyc mocha --config test/manual/mocharc.json test/manual/ldap.test.ts",
"check:socks5": "mocha --config test/manual/mocharc.json test/manual/socks5.test.ts",
"check:csfle": "mocha --config test/mocha_mongodb.json test/integration/client-side-encryption",
"check:snappy": "mocha test/unit/assorted/snappy.test.js",
Expand All @@ -175,4 +175,4 @@
"moduleResolution": "node"
}
}
}
}
26 changes: 0 additions & 26 deletions test/manual/ldap.test.js

This file was deleted.

19 changes: 19 additions & 0 deletions test/manual/ldap.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { expect } from 'chai';

import { MongoClient } from '../mongodb';

describe('LDAP', function () {
const { SASL_USER, SASL_PASS, SASL_HOST } = process.env;

const MONGODB_URI = `mongodb://${SASL_USER}:${SASL_PASS}@${SASL_HOST}?authMechanism=plain&authSource=$external`;

it('Should correctly authenticate against ldap', async function () {
const client = new MongoClient(MONGODB_URI);
await client.connect();

const doc = await client.db('ldap').collection('test').findOne();
expect(doc).property('ldap').to.equal(true);

await client.close();
});
});