Skip to content

Commit 9961c23

Browse files
committed
test: fix provider
1 parent 45c4c23 commit 9961c23

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

test/integration/client-side-encryption/client_side_encryption.prose.26.custom_aws_credential_providers.test.ts

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ import { getEncryptExtraOptions } from '../../tools/utils';
77

88
const metadata: MongoDBMetadataUI = {
99
requires: {
10-
clientSideEncryption: true
10+
clientSideEncryption: true,
11+
mongodb: '>=4.2.0',
12+
topology: '!load-balanced'
1113
}
1214
} as const;
1315

@@ -37,8 +39,9 @@ describe('25. Custom AWS Credential Providers', metadata, () => {
3739

3840
context(
3941
'Case 1: Explicit encryption with credentials and custom credential provider',
42+
metadata,
4043
function () {
41-
it('throws an error', function () {
44+
it('throws an error', metadata, function () {
4245
expect(() => {
4346
new ClientEncryption(keyVaultClient, {
4447
keyVaultNamespace: 'keyvault.datakeys',
@@ -55,20 +58,27 @@ describe('25. Custom AWS Credential Providers', metadata, () => {
5558
}
5659
);
5760

58-
context('Case 2: Explicit encryption with custom credential provider', function () {
61+
context('Case 2: Explicit encryption with custom credential provider', metadata, function () {
5962
let clientEncryption;
6063

6164
beforeEach(function () {
6265
const options = {
6366
keyVaultNamespace: 'keyvault.datakeys',
6467
kmsProviders: { aws: {} },
65-
credentialProviders: { aws: credentialProvider.fromNodeProviderChain() },
68+
credentialProviders: {
69+
aws: async () => {
70+
return {
71+
accessKeyId: process.env.FLE_AWS_KEY,
72+
secretAccessKey: process.env.FLE_AWS_SECRET
73+
};
74+
}
75+
},
6676
extraOptions: getEncryptExtraOptions()
6777
};
6878
clientEncryption = new ClientEncryption(keyVaultClient, options);
6979
});
7080

71-
it('is successful', async function () {
81+
it('is successful', metadata, async function () {
7282
const dk = await clientEncryption.createDataKey('aws', { masterKey });
7383
expect(dk).to.be.instanceOf(Binary);
7484
});

0 commit comments

Comments
 (0)