Skip to content

Commit bfc2d07

Browse files
fix lint and rename file
1 parent 5fa1513 commit bfc2d07

12 files changed

+113
-114
lines changed
Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const { Binary, EJSON } = require("bson");
3+
const { EJSON } = require('bson');
44

55
// TODO(NODE-6685): use secrets manager variables
66
// const csfleKMSProviders = {
@@ -25,25 +25,25 @@ const { Binary, EJSON } = require("bson");
2525
// }
2626
// }
2727

28-
const csfleKMSProviders = EJSON.parse(process.env.CSFLE_KMS_PROVIDERS ?? {}, { relaxed: false });
28+
const csfleKMSProviders = EJSON.parse(process.env.CSFLE_KMS_PROVIDERS ?? '{}', { relaxed: false });
2929

3030
function getCSFLEKMSProviders() {
31-
return structuredClone(
32-
csfleKMSProviders
33-
)
31+
return structuredClone(csfleKMSProviders);
3432
}
3533

3634
const keys = [
37-
'FLE_AWS_KEY',
38-
'FLE_AWS_SECRET',
39-
'FLE_AZURE_TENANTID',
40-
'FLE_AZURE_CLIENTID',
41-
'FLE_AZURE_CLIENTSECRET',
42-
'FLE_GCP_EMAIL',
43-
'FLE_GCP_PRIVATEKEY'
35+
'FLE_AWS_KEY',
36+
'FLE_AWS_SECRET',
37+
'FLE_AZURE_TENANTID',
38+
'FLE_AZURE_CLIENTID',
39+
'FLE_AZURE_CLIENTSECRET',
40+
'FLE_GCP_EMAIL',
41+
'FLE_GCP_PRIVATEKEY'
4442
];
4543

4644
module.exports = {
47-
getCSFLEKMSProviders,
48-
kmsCredentialsPresent: keys.every(key => typeof process.env[key] === 'string' && process.env[key].length > 0)
49-
}
45+
getCSFLEKMSProviders,
46+
kmsCredentialsPresent: keys.every(
47+
key => typeof process.env[key] === 'string' && process.env[key].length > 0
48+
)
49+
};

test/integration/client-side-encryption/client_side_encryption.prose.06.corpus.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import * as path from 'path';
77

88
// eslint-disable-next-line @typescript-eslint/no-restricted-imports
99
import { ClientEncryption } from '../../../src/client-side-encryption/client_encryption';
10+
import { getCSFLEKMSProviders } from '../../csfle-kms-providers';
1011
import { type MongoClient, WriteConcern } from '../../mongodb';
1112
import { getEncryptExtraOptions } from '../../tools/utils';
12-
import { getCSFLEKMSProviders } from '../../csfle-env';
1313

1414
describe('Client Side Encryption Prose Corpus Test', function () {
1515
const metadata = {

test/integration/client-side-encryption/client_side_encryption.prose.21.automatic_data_encryption_keys.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import { expect } from 'chai';
44
import { ClientEncryption } from '../../../src/client-side-encryption/client_encryption';
55
/* eslint-disable @typescript-eslint/no-restricted-imports */
66
import { MongoCryptCreateEncryptedCollectionError } from '../../../src/client-side-encryption/errors';
7+
import { getCSFLEKMSProviders, kmsCredentialsPresent } from '../../csfle-kms-providers';
78
import { Collection, type Db, MongoServerError } from '../../mongodb';
8-
import { getCSFLEKMSProviders, kmsCredentialsPresent } from '../../csfle-env';
99

1010
const metadata: MongoDBMetadataUI = {
1111
requires: {

test/integration/client-side-encryption/client_side_encryption.prose.22.range_explicit_encryption.test.ts

Lines changed: 77 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { Decimal128, type Document, Double, Long, type MongoClient } from '../..
88
import { ClientEncryption } from '../../../src/client-side-encryption/client_encryption';
99
/* eslint-disable @typescript-eslint/no-restricted-imports */
1010
import { MongoCryptError } from '../../../src/client-side-encryption/errors';
11-
import { getCSFLEKMSProviders } from '../../csfle-env';
11+
import { getCSFLEKMSProviders } from '../../csfle-kms-providers';
1212

1313
const getKmsProviders = () => {
1414
const result = getCSFLEKMSProviders();
@@ -45,85 +45,85 @@ const prepareOptions = opts =>
4545

4646
const dataTypes: ReadonlyArray<{
4747
type:
48-
| 'DecimalNoPrecision'
49-
| 'DecimalPrecision'
50-
| 'DoubleNoPrecision'
51-
| 'DoublePrecision'
52-
| 'Long'
53-
| 'Int'
54-
| 'Date';
48+
| 'DecimalNoPrecision'
49+
| 'DecimalPrecision'
50+
| 'DoubleNoPrecision'
51+
| 'DoublePrecision'
52+
| 'Long'
53+
| 'Int'
54+
| 'Date';
5555
rangeOptions: Document;
5656
factory: (number) => unknown;
5757
}> = [
58-
{
59-
type: 'DecimalNoPrecision',
60-
rangeOptions: prepareOptions({
61-
sparsity: { $numberLong: '1' },
62-
trimFactor: { $numberInt: '1' }
63-
}),
64-
factory: value => new Decimal128(value.toString())
65-
},
66-
{
67-
type: 'DecimalPrecision',
68-
rangeOptions: prepareOptions({
69-
min: { $numberDecimal: '0' },
70-
max: { $numberDecimal: '200' },
71-
trimFactor: { $numberInt: '1' },
72-
sparsity: { $numberLong: '1' },
73-
precision: 2
74-
}),
75-
factory: value => new Decimal128(value.toString())
76-
},
77-
{
78-
type: 'DoubleNoPrecision',
79-
rangeOptions: prepareOptions({
80-
trimFactor: { $numberInt: '1' },
81-
sparsity: { $numberLong: '1' }
82-
}),
83-
factory: value => new Double(value)
84-
},
85-
{
86-
type: 'DoublePrecision',
87-
rangeOptions: prepareOptions({
88-
min: { $numberDouble: '0' },
89-
max: { $numberDouble: '200' },
90-
trimFactor: { $numberInt: '1' },
91-
sparsity: { $numberLong: '1' },
92-
precision: 2
93-
}),
94-
factory: value => new Double(value)
95-
},
96-
{
97-
type: 'Date',
98-
rangeOptions: prepareOptions({
99-
min: { $date: { $numberLong: '0' } },
100-
max: { $date: { $numberLong: '200' } },
101-
trimFactor: { $numberInt: '1' },
102-
sparsity: { $numberLong: '1' }
103-
}),
104-
factory: value => new Date(value)
105-
},
106-
{
107-
type: 'Int',
108-
rangeOptions: prepareOptions({
109-
min: { $numberInt: '0' },
110-
max: { $numberInt: '200' },
111-
trimFactor: { $numberInt: '1' },
112-
sparsity: { $numberLong: '1' }
113-
}),
114-
factory: value => value
115-
},
116-
{
117-
type: 'Long',
118-
rangeOptions: prepareOptions({
119-
min: { $numberLong: '0' },
120-
max: { $numberLong: '200' },
121-
trimFactor: { $numberInt: '1' },
122-
sparsity: { $numberLong: '1' }
123-
}),
124-
factory: value => Long.fromNumber(value)
125-
}
126-
];
58+
{
59+
type: 'DecimalNoPrecision',
60+
rangeOptions: prepareOptions({
61+
sparsity: { $numberLong: '1' },
62+
trimFactor: { $numberInt: '1' }
63+
}),
64+
factory: value => new Decimal128(value.toString())
65+
},
66+
{
67+
type: 'DecimalPrecision',
68+
rangeOptions: prepareOptions({
69+
min: { $numberDecimal: '0' },
70+
max: { $numberDecimal: '200' },
71+
trimFactor: { $numberInt: '1' },
72+
sparsity: { $numberLong: '1' },
73+
precision: 2
74+
}),
75+
factory: value => new Decimal128(value.toString())
76+
},
77+
{
78+
type: 'DoubleNoPrecision',
79+
rangeOptions: prepareOptions({
80+
trimFactor: { $numberInt: '1' },
81+
sparsity: { $numberLong: '1' }
82+
}),
83+
factory: value => new Double(value)
84+
},
85+
{
86+
type: 'DoublePrecision',
87+
rangeOptions: prepareOptions({
88+
min: { $numberDouble: '0' },
89+
max: { $numberDouble: '200' },
90+
trimFactor: { $numberInt: '1' },
91+
sparsity: { $numberLong: '1' },
92+
precision: 2
93+
}),
94+
factory: value => new Double(value)
95+
},
96+
{
97+
type: 'Date',
98+
rangeOptions: prepareOptions({
99+
min: { $date: { $numberLong: '0' } },
100+
max: { $date: { $numberLong: '200' } },
101+
trimFactor: { $numberInt: '1' },
102+
sparsity: { $numberLong: '1' }
103+
}),
104+
factory: value => new Date(value)
105+
},
106+
{
107+
type: 'Int',
108+
rangeOptions: prepareOptions({
109+
min: { $numberInt: '0' },
110+
max: { $numberInt: '200' },
111+
trimFactor: { $numberInt: '1' },
112+
sparsity: { $numberLong: '1' }
113+
}),
114+
factory: value => value
115+
},
116+
{
117+
type: 'Long',
118+
rangeOptions: prepareOptions({
119+
min: { $numberLong: '0' },
120+
max: { $numberLong: '200' },
121+
trimFactor: { $numberInt: '1' },
122+
sparsity: { $numberLong: '1' }
123+
}),
124+
factory: value => Long.fromNumber(value)
125+
}
126+
];
127127

128128
const basePath = '/test/spec/client-side-encryption/etc/data';
129129

test/integration/client-side-encryption/client_side_encryption.prose.23.range_encryption_defaults.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { expect } from 'chai';
22

33
/* eslint-disable @typescript-eslint/no-restricted-imports */
44
import { ClientEncryption } from '../../../src/client-side-encryption/client_encryption';
5+
import { getCSFLEKMSProviders } from '../../csfle-kms-providers';
56
import { type Binary, Int32, Long } from '../../mongodb';
6-
import { getCSFLEKMSProviders } from '../../csfle-env';
77

88
const metaData: MongoDBMetadataUI = {
99
requires: {

test/integration/client-side-encryption/client_side_encryption.prose.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const { ClientEncryption } = require('../../../src/client-side-encryption/client
1919
const {
2020
ClientSideEncryptionFilter
2121
} = require('../../tools/runner/filters/client_encryption_filter');
22-
const { getCSFLEKMSProviders } = require('../../csfle-env');
22+
const { getCSFLEKMSProviders } = require('../../csfle-kms-providers');
2323

2424
const getKmsProviders = (localKey, kmipEndpoint, azureEndpoint, gcpEndpoint) => {
2525
const result = getCSFLEKMSProviders();

test/integration/client-side-encryption/driver.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
import { type Binary, EJSON, UUID } from 'bson';
1+
import { UUID } from 'bson';
22
import { expect } from 'chai';
33
import * as crypto from 'crypto';
44
import * as sinon from 'sinon';
55
import { setTimeout } from 'timers/promises';
66

77
// eslint-disable-next-line @typescript-eslint/no-restricted-imports
88
import { ClientEncryption } from '../../../src/client-side-encryption/client_encryption';
9+
import { getCSFLEKMSProviders } from '../../csfle-kms-providers';
910
import {
1011
BSON,
1112
type Collection,
@@ -29,7 +30,6 @@ import {
2930
sleep
3031
} from '../../tools/utils';
3132
import { filterForCommands } from '../shared';
32-
import { getCSFLEKMSProviders } from '../../csfle-env';
3333

3434
const metadata: MongoDBMetadataUI = {
3535
requires: {

test/integration/node-specific/client_close.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* eslint-disable @typescript-eslint/no-empty-function */
2-
import { getCSFLEKMSProviders } from '../../csfle-env';
2+
import { getCSFLEKMSProviders } from '../../csfle-kms-providers';
33
import { type TestConfiguration } from '../../tools/runner/config';
44
import { runScriptAndGetProcessInfo } from './resource_tracking_script_builder';
55

@@ -455,27 +455,27 @@ describe.skip('MongoClient.close() Integration', () => {
455455
describe('ClientSession (Implicit)', () => {
456456
describe('Server resource: LSID/ServerSession', () => {
457457
describe('after a clientSession is implicitly created and used', () => {
458-
it.skip('the server-side ServerSession is cleaned up by client.close()', async function () { });
458+
it.skip('the server-side ServerSession is cleaned up by client.close()', async function () {});
459459
});
460460
});
461461

462462
describe('Server resource: Transactions', () => {
463463
describe('after a clientSession is implicitly created and used', () => {
464-
it.skip('the server-side transaction is cleaned up by client.close()', async function () { });
464+
it.skip('the server-side transaction is cleaned up by client.close()', async function () {});
465465
});
466466
});
467467
});
468468

469469
describe('ClientSession (Explicit)', () => {
470470
describe('Server resource: LSID/ServerSession', () => {
471471
describe('after a clientSession is created and used', () => {
472-
it.skip('the server-side ServerSession is cleaned up by client.close()', async function () { });
472+
it.skip('the server-side ServerSession is cleaned up by client.close()', async function () {});
473473
});
474474
});
475475

476476
describe('Server resource: Transactions', () => {
477477
describe('after a clientSession is created and used', () => {
478-
it.skip('the server-side transaction is cleaned up by client.close()', async function () { });
478+
it.skip('the server-side transaction is cleaned up by client.close()', async function () {});
479479
});
480480
});
481481
});
@@ -578,14 +578,14 @@ describe.skip('MongoClient.close() Integration', () => {
578578
});
579579

580580
describe('Node.js resource: Socket', () => {
581-
it.skip('no sockets remain after client.close()', metadata, async () => { });
581+
it.skip('no sockets remain after client.close()', metadata, async () => {});
582582
});
583583
});
584584
});
585585

586586
describe('Server resource: Cursor', () => {
587587
describe('after cursors are created', () => {
588-
it.skip('all active server-side cursors are closed by client.close()', async function () { });
588+
it.skip('all active server-side cursors are closed by client.close()', async function () {});
589589
});
590590
});
591591
});

test/tools/runner/config.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,11 @@ export class TestConfiguration {
116116
replicaSet: url.searchParams.get('replicaSet'),
117117
proxyURIParams: url.searchParams.get('proxyHost')
118118
? {
119-
proxyHost: url.searchParams.get('proxyHost'),
120-
proxyPort: Number(url.searchParams.get('proxyPort')),
121-
proxyUsername: url.searchParams.get('proxyUsername'),
122-
proxyPassword: url.searchParams.get('proxyPassword')
123-
}
119+
proxyHost: url.searchParams.get('proxyHost'),
120+
proxyPort: Number(url.searchParams.get('proxyPort')),
121+
proxyUsername: url.searchParams.get('proxyUsername'),
122+
proxyPassword: url.searchParams.get('proxyPassword')
123+
}
124124
: undefined
125125
};
126126
if (url.username) {

test/tools/runner/filters/client_encryption_filter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import { dirname, resolve } from 'path';
33
import * as process from 'process';
44
import { satisfies } from 'semver';
55

6+
import { kmsCredentialsPresent } from '../../../csfle-kms-providers';
67
import { type MongoClient } from '../../../mongodb';
78
import { Filter } from './filter';
8-
import { kmsCredentialsPresent } from '../../../csfle-env';
99

1010
/**
1111
* Filter for whether or not a test needs / doesn't need Client Side Encryption

0 commit comments

Comments
 (0)