Skip to content

Commit 6184625

Browse files
committed
feat(NODE-5838): remove support for server 3.6
1 parent 833eaa4 commit 6184625

File tree

259 files changed

+616
-906
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

259 files changed

+616
-906
lines changed

.evergreen/ci_matrix_constants.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const MONGODB_VERSIONS = ['latest', 'rapid', '8.0', '7.0', '6.0', '5.0', '4.4', '4.2', '4.0', '3.6'];
1+
const MONGODB_VERSIONS = ['latest', 'rapid', '8.0', '7.0', '6.0', '5.0', '4.4', '4.2', '4.0'];
22
const versions = [
33
{ codeName: 'gallium', versionNumber: 16, npmVersion: 9 },
44
{ codeName: 'hydrogen', versionNumber: 18, npmVersion: 'latest' },

.evergreen/config.yml

Lines changed: 0 additions & 129 deletions
Original file line numberDiff line numberDiff line change
@@ -1760,57 +1760,6 @@ tasks:
17601760
- func: bootstrap mongo-orchestration
17611761
- func: bootstrap kms servers
17621762
- func: run tests
1763-
- name: test-3.6-server
1764-
tags:
1765-
- '3.6'
1766-
- server
1767-
commands:
1768-
- command: expansions.update
1769-
type: setup
1770-
params:
1771-
updates:
1772-
- {key: NPM_VERSION, value: '9'}
1773-
- {key: VERSION, value: '3.6'}
1774-
- {key: TOPOLOGY, value: server}
1775-
- {key: AUTH, value: auth}
1776-
- func: install dependencies
1777-
- func: bootstrap mongo-orchestration
1778-
- func: bootstrap kms servers
1779-
- func: run tests
1780-
- name: test-3.6-replica_set
1781-
tags:
1782-
- '3.6'
1783-
- replica_set
1784-
commands:
1785-
- command: expansions.update
1786-
type: setup
1787-
params:
1788-
updates:
1789-
- {key: NPM_VERSION, value: '9'}
1790-
- {key: VERSION, value: '3.6'}
1791-
- {key: TOPOLOGY, value: replica_set}
1792-
- {key: AUTH, value: auth}
1793-
- func: install dependencies
1794-
- func: bootstrap mongo-orchestration
1795-
- func: bootstrap kms servers
1796-
- func: run tests
1797-
- name: test-3.6-sharded_cluster
1798-
tags:
1799-
- '3.6'
1800-
- sharded_cluster
1801-
commands:
1802-
- command: expansions.update
1803-
type: setup
1804-
params:
1805-
updates:
1806-
- {key: NPM_VERSION, value: '9'}
1807-
- {key: VERSION, value: '3.6'}
1808-
- {key: TOPOLOGY, value: sharded_cluster}
1809-
- {key: AUTH, value: auth}
1810-
- func: install dependencies
1811-
- func: bootstrap mongo-orchestration
1812-
- func: bootstrap kms servers
1813-
- func: run tests
18141763
- name: test-latest-server-v1-api
18151764
tags:
18161765
- latest
@@ -4178,60 +4127,6 @@ tasks:
41784127
- func: bootstrap mongo-orchestration
41794128
- func: bootstrap kms servers
41804129
- func: run tests
4181-
- name: test-3.6-server-noauth
4182-
tags:
4183-
- '3.6'
4184-
- server
4185-
- noauth
4186-
commands:
4187-
- command: expansions.update
4188-
type: setup
4189-
params:
4190-
updates:
4191-
- {key: NPM_VERSION, value: '9'}
4192-
- {key: VERSION, value: '3.6'}
4193-
- {key: TOPOLOGY, value: server}
4194-
- {key: AUTH, value: noauth}
4195-
- func: install dependencies
4196-
- func: bootstrap mongo-orchestration
4197-
- func: bootstrap kms servers
4198-
- func: run tests
4199-
- name: test-3.6-replica_set-noauth
4200-
tags:
4201-
- '3.6'
4202-
- replica_set
4203-
- noauth
4204-
commands:
4205-
- command: expansions.update
4206-
type: setup
4207-
params:
4208-
updates:
4209-
- {key: NPM_VERSION, value: '9'}
4210-
- {key: VERSION, value: '3.6'}
4211-
- {key: TOPOLOGY, value: replica_set}
4212-
- {key: AUTH, value: noauth}
4213-
- func: install dependencies
4214-
- func: bootstrap mongo-orchestration
4215-
- func: bootstrap kms servers
4216-
- func: run tests
4217-
- name: test-3.6-sharded_cluster-noauth
4218-
tags:
4219-
- '3.6'
4220-
- sharded_cluster
4221-
- noauth
4222-
commands:
4223-
- command: expansions.update
4224-
type: setup
4225-
params:
4226-
updates:
4227-
- {key: NPM_VERSION, value: '9'}
4228-
- {key: VERSION, value: '3.6'}
4229-
- {key: TOPOLOGY, value: sharded_cluster}
4230-
- {key: AUTH, value: noauth}
4231-
- func: install dependencies
4232-
- func: bootstrap mongo-orchestration
4233-
- func: bootstrap kms servers
4234-
- func: run tests
42354130
- name: test-lambda-example
42364131
tags:
42374132
- latest
@@ -4676,9 +4571,6 @@ buildvariants:
46764571
- test-4.0-server
46774572
- test-4.0-replica_set
46784573
- test-4.0-sharded_cluster
4679-
- test-3.6-server
4680-
- test-3.6-replica_set
4681-
- test-3.6-sharded_cluster
46824574
- test-latest-server-v1-api
46834575
- test-x509-authentication
46844576
- test-atlas-connectivity
@@ -4735,9 +4627,6 @@ buildvariants:
47354627
- test-4.0-server
47364628
- test-4.0-replica_set
47374629
- test-4.0-sharded_cluster
4738-
- test-3.6-server
4739-
- test-3.6-replica_set
4740-
- test-3.6-sharded_cluster
47414630
- test-latest-server-v1-api
47424631
- test-x509-authentication
47434632
- test-atlas-connectivity
@@ -4794,9 +4683,6 @@ buildvariants:
47944683
- test-4.0-server
47954684
- test-4.0-replica_set
47964685
- test-4.0-sharded_cluster
4797-
- test-3.6-server
4798-
- test-3.6-replica_set
4799-
- test-3.6-sharded_cluster
48004686
- test-latest-server-v1-api
48014687
- test-x509-authentication
48024688
- test-atlas-connectivity
@@ -4852,9 +4738,6 @@ buildvariants:
48524738
- test-4.0-server
48534739
- test-4.0-replica_set
48544740
- test-4.0-sharded_cluster
4855-
- test-3.6-server
4856-
- test-3.6-replica_set
4857-
- test-3.6-sharded_cluster
48584741
- test-latest-server-v1-api
48594742
- test-x509-authentication
48604743
- test-atlas-connectivity
@@ -4910,9 +4793,6 @@ buildvariants:
49104793
- test-4.0-server
49114794
- test-4.0-replica_set
49124795
- test-4.0-sharded_cluster
4913-
- test-3.6-server
4914-
- test-3.6-replica_set
4915-
- test-3.6-sharded_cluster
49164796
- test-latest-server-v1-api
49174797
- test-socks5
49184798
- test-socks5-tls
@@ -4957,9 +4837,6 @@ buildvariants:
49574837
- test-4.0-server
49584838
- test-4.0-replica_set
49594839
- test-4.0-sharded_cluster
4960-
- test-3.6-server
4961-
- test-3.6-replica_set
4962-
- test-3.6-sharded_cluster
49634840
- test-latest-server-v1-api
49644841
- test-socks5
49654842
- test-socks5-tls
@@ -5004,9 +4881,6 @@ buildvariants:
50044881
- test-4.0-server
50054882
- test-4.0-replica_set
50064883
- test-4.0-sharded_cluster
5007-
- test-3.6-server
5008-
- test-3.6-replica_set
5009-
- test-3.6-sharded_cluster
50104884
- test-latest-server-v1-api
50114885
- test-socks5
50124886
- test-socks5-tls
@@ -5254,9 +5128,6 @@ buildvariants:
52545128
- test-4.0-server-noauth
52555129
- test-4.0-replica_set-noauth
52565130
- test-4.0-sharded_cluster-noauth
5257-
- test-3.6-server-noauth
5258-
- test-3.6-replica_set-noauth
5259-
- test-3.6-sharded_cluster-noauth
52605131
- name: rhel8-test-lambda
52615132
display_name: AWS Lambda handler tests
52625133
run_on: rhel80-large

src/cmap/auth/mongo_credentials.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,10 @@ function getDefaultAuthMechanism(hello: Document | null): AuthMechanism {
2020
? AuthMechanism.MONGODB_SCRAM_SHA256
2121
: AuthMechanism.MONGODB_SCRAM_SHA1;
2222
}
23-
24-
// Fallback to legacy selection method. If wire version >= 3, use scram-sha-1
25-
if (hello.maxWireVersion >= 3) {
26-
return AuthMechanism.MONGODB_SCRAM_SHA1;
27-
}
2823
}
2924

30-
// Default for wireprotocol < 3
31-
return AuthMechanism.MONGODB_CR;
25+
// Default auth mechanism for 4.0 and higher.
26+
return AuthMechanism.MONGODB_SCRAM_SHA256;
3227
}
3328

3429
const ALLOWED_ENVIRONMENT_NAMES: AuthMechanismProperties['ENVIRONMENT'][] = [
@@ -173,7 +168,6 @@ export class MongoCredentials {
173168
validate(): void {
174169
if (
175170
(this.mechanism === AuthMechanism.MONGODB_GSSAPI ||
176-
this.mechanism === AuthMechanism.MONGODB_CR ||
177171
this.mechanism === AuthMechanism.MONGODB_PLAIN ||
178172
this.mechanism === AuthMechanism.MONGODB_SCRAM_SHA1 ||
179173
this.mechanism === AuthMechanism.MONGODB_SCRAM_SHA256) &&

src/cmap/auth/mongocr.ts

Lines changed: 0 additions & 38 deletions
This file was deleted.

src/cmap/wire_protocol/constants.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
export const MIN_SUPPORTED_SERVER_VERSION = '3.6';
1+
export const MIN_SUPPORTED_SERVER_VERSION = '4.0';
22
export const MAX_SUPPORTED_SERVER_VERSION = '8.0';
3-
export const MIN_SUPPORTED_WIRE_VERSION = 6;
3+
export const MIN_SUPPORTED_WIRE_VERSION = 7;
44
export const MAX_SUPPORTED_WIRE_VERSION = 25;
55
export const MIN_SUPPORTED_QE_WIRE_VERSION = 21;
66
export const MIN_SUPPORTED_QE_SERVER_VERSION = '7.0';

src/mongo_client_auth_providers.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { type AuthProvider } from './cmap/auth/auth_provider';
22
import { GSSAPI } from './cmap/auth/gssapi';
33
import { type AuthMechanismProperties } from './cmap/auth/mongo_credentials';
4-
import { MongoCR } from './cmap/auth/mongocr';
54
import { MongoDBAWS } from './cmap/auth/mongodb_aws';
65
import { MongoDBOIDC, OIDC_WORKFLOWS, type Workflow } from './cmap/auth/mongodb_oidc';
76
import { AutomatedCallbackWorkflow } from './cmap/auth/mongodb_oidc/automated_callback_workflow';
@@ -16,7 +15,14 @@ import { MongoInvalidArgumentError } from './error';
1615
/** @internal */
1716
const AUTH_PROVIDERS = new Map<AuthMechanism | string, (workflow?: Workflow) => AuthProvider>([
1817
[AuthMechanism.MONGODB_AWS, () => new MongoDBAWS()],
19-
[AuthMechanism.MONGODB_CR, () => new MongoCR()],
18+
[
19+
AuthMechanism.MONGODB_CR,
20+
() => {
21+
throw new MongoInvalidArgumentError(
22+
'MONGODB-CR is no longer a supported auth mechanism in MongoDB 4.0+'
23+
);
24+
}
25+
],
2026
[AuthMechanism.MONGODB_GSSAPI, () => new GSSAPI()],
2127
[AuthMechanism.MONGODB_OIDC, (workflow?: Workflow) => new MongoDBOIDC(workflow)],
2228
[AuthMechanism.MONGODB_PLAIN, () => new Plain()],

test/mongodb.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ export * from '../src/cmap/auth/auth_provider';
107107
export * from '../src/cmap/auth/aws_temporary_credentials';
108108
export * from '../src/cmap/auth/gssapi';
109109
export * from '../src/cmap/auth/mongo_credentials';
110-
export * from '../src/cmap/auth/mongocr';
111110
export * from '../src/cmap/auth/mongodb_aws';
112111
export * from '../src/cmap/auth/mongodb_oidc';
113112
export * from '../src/cmap/auth/mongodb_oidc/azure_machine_workflow';

test/spec/auth/legacy/connection-string.json

Lines changed: 2 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -163,47 +163,6 @@
163163
"uri": "mongodb://localhost/?authMechanism=GSSAPI",
164164
"valid": false
165165
},
166-
{
167-
"description": "should recognize the mechanism (MONGODB-CR)",
168-
"uri": "mongodb://user:password@localhost/?authMechanism=MONGODB-CR",
169-
"valid": true,
170-
"credential": {
171-
"username": "user",
172-
"password": "password",
173-
"source": "admin",
174-
"mechanism": "MONGODB-CR",
175-
"mechanism_properties": null
176-
}
177-
},
178-
{
179-
"description": "should use the database when no authSource is specified (MONGODB-CR)",
180-
"uri": "mongodb://user:password@localhost/foo?authMechanism=MONGODB-CR",
181-
"valid": true,
182-
"credential": {
183-
"username": "user",
184-
"password": "password",
185-
"source": "foo",
186-
"mechanism": "MONGODB-CR",
187-
"mechanism_properties": null
188-
}
189-
},
190-
{
191-
"description": "should use the authSource when specified (MONGODB-CR)",
192-
"uri": "mongodb://user:password@localhost/foo?authMechanism=MONGODB-CR&authSource=bar",
193-
"valid": true,
194-
"credential": {
195-
"username": "user",
196-
"password": "password",
197-
"source": "bar",
198-
"mechanism": "MONGODB-CR",
199-
"mechanism_properties": null
200-
}
201-
},
202-
{
203-
"description": "should throw an exception if no username is supplied (MONGODB-CR)",
204-
"uri": "mongodb://localhost/?authMechanism=MONGODB-CR",
205-
"valid": false
206-
},
207166
{
208167
"description": "should recognize the mechanism (MONGODB-X509)",
209168
"uri": "mongodb://CN%3DmyName%2COU%3DmyOrgUnit%2CO%3DmyOrg%2CL%3DmyLocality%2CST%3DmyState%2CC%3DmyCountry@localhost/?authMechanism=MONGODB-X509",
@@ -517,7 +476,7 @@
517476
},
518477
{
519478
"description": "should throw an exception if username is specified for test (MONGODB-OIDC)",
520-
"uri": "mongodb://principalName@localhost/?authMechanism=MONGODB-OIDC&ENVIRONMENT:test",
479+
"uri": "mongodb://principalName@localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=ENVIRONMENT:test",
521480
"valid": false,
522481
"credential": null
523482
},
@@ -669,4 +628,4 @@
669628
"credential": null
670629
}
671630
]
672-
}
631+
}

0 commit comments

Comments
 (0)