Skip to content

Commit 0db617f

Browse files
committed
feat(NODE-5838): remove support for server 3.6
1 parent 74916f2 commit 0db617f

File tree

262 files changed

+619
-909
lines changed

Some content is hidden

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

262 files changed

+619
-909
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
@@ -1735,57 +1735,6 @@ tasks:
17351735
- func: bootstrap mongo-orchestration
17361736
- func: bootstrap kms servers
17371737
- func: run tests
1738-
- name: test-3.6-server
1739-
tags:
1740-
- '3.6'
1741-
- server
1742-
commands:
1743-
- command: expansions.update
1744-
type: setup
1745-
params:
1746-
updates:
1747-
- {key: NPM_VERSION, value: '9'}
1748-
- {key: VERSION, value: '3.6'}
1749-
- {key: TOPOLOGY, value: server}
1750-
- {key: AUTH, value: auth}
1751-
- func: install dependencies
1752-
- func: bootstrap mongo-orchestration
1753-
- func: bootstrap kms servers
1754-
- func: run tests
1755-
- name: test-3.6-replica_set
1756-
tags:
1757-
- '3.6'
1758-
- replica_set
1759-
commands:
1760-
- command: expansions.update
1761-
type: setup
1762-
params:
1763-
updates:
1764-
- {key: NPM_VERSION, value: '9'}
1765-
- {key: VERSION, value: '3.6'}
1766-
- {key: TOPOLOGY, value: replica_set}
1767-
- {key: AUTH, value: auth}
1768-
- func: install dependencies
1769-
- func: bootstrap mongo-orchestration
1770-
- func: bootstrap kms servers
1771-
- func: run tests
1772-
- name: test-3.6-sharded_cluster
1773-
tags:
1774-
- '3.6'
1775-
- sharded_cluster
1776-
commands:
1777-
- command: expansions.update
1778-
type: setup
1779-
params:
1780-
updates:
1781-
- {key: NPM_VERSION, value: '9'}
1782-
- {key: VERSION, value: '3.6'}
1783-
- {key: TOPOLOGY, value: sharded_cluster}
1784-
- {key: AUTH, value: auth}
1785-
- func: install dependencies
1786-
- func: bootstrap mongo-orchestration
1787-
- func: bootstrap kms servers
1788-
- func: run tests
17891738
- name: test-latest-server-v1-api
17901739
tags:
17911740
- latest
@@ -4081,60 +4030,6 @@ tasks:
40814030
- func: bootstrap mongo-orchestration
40824031
- func: bootstrap kms servers
40834032
- func: run tests
4084-
- name: test-3.6-server-noauth
4085-
tags:
4086-
- '3.6'
4087-
- server
4088-
- noauth
4089-
commands:
4090-
- command: expansions.update
4091-
type: setup
4092-
params:
4093-
updates:
4094-
- {key: NPM_VERSION, value: '9'}
4095-
- {key: VERSION, value: '3.6'}
4096-
- {key: TOPOLOGY, value: server}
4097-
- {key: AUTH, value: noauth}
4098-
- func: install dependencies
4099-
- func: bootstrap mongo-orchestration
4100-
- func: bootstrap kms servers
4101-
- func: run tests
4102-
- name: test-3.6-replica_set-noauth
4103-
tags:
4104-
- '3.6'
4105-
- replica_set
4106-
- noauth
4107-
commands:
4108-
- command: expansions.update
4109-
type: setup
4110-
params:
4111-
updates:
4112-
- {key: NPM_VERSION, value: '9'}
4113-
- {key: VERSION, value: '3.6'}
4114-
- {key: TOPOLOGY, value: replica_set}
4115-
- {key: AUTH, value: noauth}
4116-
- func: install dependencies
4117-
- func: bootstrap mongo-orchestration
4118-
- func: bootstrap kms servers
4119-
- func: run tests
4120-
- name: test-3.6-sharded_cluster-noauth
4121-
tags:
4122-
- '3.6'
4123-
- sharded_cluster
4124-
- noauth
4125-
commands:
4126-
- command: expansions.update
4127-
type: setup
4128-
params:
4129-
updates:
4130-
- {key: NPM_VERSION, value: '9'}
4131-
- {key: VERSION, value: '3.6'}
4132-
- {key: TOPOLOGY, value: sharded_cluster}
4133-
- {key: AUTH, value: noauth}
4134-
- func: install dependencies
4135-
- func: bootstrap mongo-orchestration
4136-
- func: bootstrap kms servers
4137-
- func: run tests
41384033
- name: test-lambda-example
41394034
tags:
41404035
- latest
@@ -4579,9 +4474,6 @@ buildvariants:
45794474
- test-4.0-server
45804475
- test-4.0-replica_set
45814476
- test-4.0-sharded_cluster
4582-
- test-3.6-server
4583-
- test-3.6-replica_set
4584-
- test-3.6-sharded_cluster
45854477
- test-latest-server-v1-api
45864478
- test-x509-authentication
45874479
- test-atlas-connectivity
@@ -4638,9 +4530,6 @@ buildvariants:
46384530
- test-4.0-server
46394531
- test-4.0-replica_set
46404532
- test-4.0-sharded_cluster
4641-
- test-3.6-server
4642-
- test-3.6-replica_set
4643-
- test-3.6-sharded_cluster
46444533
- test-latest-server-v1-api
46454534
- test-x509-authentication
46464535
- test-atlas-connectivity
@@ -4697,9 +4586,6 @@ buildvariants:
46974586
- test-4.0-server
46984587
- test-4.0-replica_set
46994588
- test-4.0-sharded_cluster
4700-
- test-3.6-server
4701-
- test-3.6-replica_set
4702-
- test-3.6-sharded_cluster
47034589
- test-latest-server-v1-api
47044590
- test-x509-authentication
47054591
- test-atlas-connectivity
@@ -4755,9 +4641,6 @@ buildvariants:
47554641
- test-4.0-server
47564642
- test-4.0-replica_set
47574643
- test-4.0-sharded_cluster
4758-
- test-3.6-server
4759-
- test-3.6-replica_set
4760-
- test-3.6-sharded_cluster
47614644
- test-latest-server-v1-api
47624645
- test-x509-authentication
47634646
- test-atlas-connectivity
@@ -4813,9 +4696,6 @@ buildvariants:
48134696
- test-4.0-server
48144697
- test-4.0-replica_set
48154698
- test-4.0-sharded_cluster
4816-
- test-3.6-server
4817-
- test-3.6-replica_set
4818-
- test-3.6-sharded_cluster
48194699
- test-latest-server-v1-api
48204700
- test-socks5
48214701
- test-socks5-tls
@@ -4860,9 +4740,6 @@ buildvariants:
48604740
- test-4.0-server
48614741
- test-4.0-replica_set
48624742
- test-4.0-sharded_cluster
4863-
- test-3.6-server
4864-
- test-3.6-replica_set
4865-
- test-3.6-sharded_cluster
48664743
- test-latest-server-v1-api
48674744
- test-socks5
48684745
- test-socks5-tls
@@ -4907,9 +4784,6 @@ buildvariants:
49074784
- test-4.0-server
49084785
- test-4.0-replica_set
49094786
- test-4.0-sharded_cluster
4910-
- test-3.6-server
4911-
- test-3.6-replica_set
4912-
- test-3.6-sharded_cluster
49134787
- test-latest-server-v1-api
49144788
- test-socks5
49154789
- test-socks5-tls
@@ -5157,9 +5031,6 @@ buildvariants:
51575031
- test-4.0-server-noauth
51585032
- test-4.0-replica_set-noauth
51595033
- test-4.0-sharded_cluster-noauth
5160-
- test-3.6-server-noauth
5161-
- test-3.6-replica_set-noauth
5162-
- test-3.6-sharded_cluster-noauth
51635034
- name: rhel8-test-lambda
51645035
display_name: AWS Lambda handler tests
51655036
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
@@ -104,7 +104,6 @@ export * from '../src/cmap/auth/auth_provider';
104104
export * from '../src/cmap/auth/aws_temporary_credentials';
105105
export * from '../src/cmap/auth/gssapi';
106106
export * from '../src/cmap/auth/mongo_credentials';
107-
export * from '../src/cmap/auth/mongocr';
108107
export * from '../src/cmap/auth/mongodb_aws';
109108
export * from '../src/cmap/auth/mongodb_oidc';
110109
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)