Skip to content

Commit

Permalink
feat(NODE-5838): remove support for server 3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
durran committed Jul 25, 2024
1 parent 74916f2 commit d5648de
Show file tree
Hide file tree
Showing 263 changed files with 611 additions and 910 deletions.
2 changes: 1 addition & 1 deletion .evergreen/ci_matrix_constants.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const MONGODB_VERSIONS = ['latest', 'rapid', '8.0', '7.0', '6.0', '5.0', '4.4', '4.2', '4.0', '3.6'];
const MONGODB_VERSIONS = ['latest', 'rapid', '8.0', '7.0', '6.0', '5.0', '4.4', '4.2', '4.0'];
const versions = [
{ codeName: 'gallium', versionNumber: 16, npmVersion: 9 },
{ codeName: 'hydrogen', versionNumber: 18, npmVersion: 'latest' },
Expand Down
129 changes: 0 additions & 129 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1735,57 +1735,6 @@ tasks:
- func: bootstrap mongo-orchestration
- func: bootstrap kms servers
- func: run tests
- name: test-3.6-server
tags:
- '3.6'
- server
commands:
- command: expansions.update
type: setup
params:
updates:
- {key: NPM_VERSION, value: '9'}
- {key: VERSION, value: '3.6'}
- {key: TOPOLOGY, value: server}
- {key: AUTH, value: auth}
- func: install dependencies
- func: bootstrap mongo-orchestration
- func: bootstrap kms servers
- func: run tests
- name: test-3.6-replica_set
tags:
- '3.6'
- replica_set
commands:
- command: expansions.update
type: setup
params:
updates:
- {key: NPM_VERSION, value: '9'}
- {key: VERSION, value: '3.6'}
- {key: TOPOLOGY, value: replica_set}
- {key: AUTH, value: auth}
- func: install dependencies
- func: bootstrap mongo-orchestration
- func: bootstrap kms servers
- func: run tests
- name: test-3.6-sharded_cluster
tags:
- '3.6'
- sharded_cluster
commands:
- command: expansions.update
type: setup
params:
updates:
- {key: NPM_VERSION, value: '9'}
- {key: VERSION, value: '3.6'}
- {key: TOPOLOGY, value: sharded_cluster}
- {key: AUTH, value: auth}
- func: install dependencies
- func: bootstrap mongo-orchestration
- func: bootstrap kms servers
- func: run tests
- name: test-latest-server-v1-api
tags:
- latest
Expand Down Expand Up @@ -4081,60 +4030,6 @@ tasks:
- func: bootstrap mongo-orchestration
- func: bootstrap kms servers
- func: run tests
- name: test-3.6-server-noauth
tags:
- '3.6'
- server
- noauth
commands:
- command: expansions.update
type: setup
params:
updates:
- {key: NPM_VERSION, value: '9'}
- {key: VERSION, value: '3.6'}
- {key: TOPOLOGY, value: server}
- {key: AUTH, value: noauth}
- func: install dependencies
- func: bootstrap mongo-orchestration
- func: bootstrap kms servers
- func: run tests
- name: test-3.6-replica_set-noauth
tags:
- '3.6'
- replica_set
- noauth
commands:
- command: expansions.update
type: setup
params:
updates:
- {key: NPM_VERSION, value: '9'}
- {key: VERSION, value: '3.6'}
- {key: TOPOLOGY, value: replica_set}
- {key: AUTH, value: noauth}
- func: install dependencies
- func: bootstrap mongo-orchestration
- func: bootstrap kms servers
- func: run tests
- name: test-3.6-sharded_cluster-noauth
tags:
- '3.6'
- sharded_cluster
- noauth
commands:
- command: expansions.update
type: setup
params:
updates:
- {key: NPM_VERSION, value: '9'}
- {key: VERSION, value: '3.6'}
- {key: TOPOLOGY, value: sharded_cluster}
- {key: AUTH, value: noauth}
- func: install dependencies
- func: bootstrap mongo-orchestration
- func: bootstrap kms servers
- func: run tests
- name: test-lambda-example
tags:
- latest
Expand Down Expand Up @@ -4579,9 +4474,6 @@ buildvariants:
- test-4.0-server
- test-4.0-replica_set
- test-4.0-sharded_cluster
- test-3.6-server
- test-3.6-replica_set
- test-3.6-sharded_cluster
- test-latest-server-v1-api
- test-x509-authentication
- test-atlas-connectivity
Expand Down Expand Up @@ -4638,9 +4530,6 @@ buildvariants:
- test-4.0-server
- test-4.0-replica_set
- test-4.0-sharded_cluster
- test-3.6-server
- test-3.6-replica_set
- test-3.6-sharded_cluster
- test-latest-server-v1-api
- test-x509-authentication
- test-atlas-connectivity
Expand Down Expand Up @@ -4697,9 +4586,6 @@ buildvariants:
- test-4.0-server
- test-4.0-replica_set
- test-4.0-sharded_cluster
- test-3.6-server
- test-3.6-replica_set
- test-3.6-sharded_cluster
- test-latest-server-v1-api
- test-x509-authentication
- test-atlas-connectivity
Expand Down Expand Up @@ -4755,9 +4641,6 @@ buildvariants:
- test-4.0-server
- test-4.0-replica_set
- test-4.0-sharded_cluster
- test-3.6-server
- test-3.6-replica_set
- test-3.6-sharded_cluster
- test-latest-server-v1-api
- test-x509-authentication
- test-atlas-connectivity
Expand Down Expand Up @@ -4813,9 +4696,6 @@ buildvariants:
- test-4.0-server
- test-4.0-replica_set
- test-4.0-sharded_cluster
- test-3.6-server
- test-3.6-replica_set
- test-3.6-sharded_cluster
- test-latest-server-v1-api
- test-socks5
- test-socks5-tls
Expand Down Expand Up @@ -4860,9 +4740,6 @@ buildvariants:
- test-4.0-server
- test-4.0-replica_set
- test-4.0-sharded_cluster
- test-3.6-server
- test-3.6-replica_set
- test-3.6-sharded_cluster
- test-latest-server-v1-api
- test-socks5
- test-socks5-tls
Expand Down Expand Up @@ -4907,9 +4784,6 @@ buildvariants:
- test-4.0-server
- test-4.0-replica_set
- test-4.0-sharded_cluster
- test-3.6-server
- test-3.6-replica_set
- test-3.6-sharded_cluster
- test-latest-server-v1-api
- test-socks5
- test-socks5-tls
Expand Down Expand Up @@ -5157,9 +5031,6 @@ buildvariants:
- test-4.0-server-noauth
- test-4.0-replica_set-noauth
- test-4.0-sharded_cluster-noauth
- test-3.6-server-noauth
- test-3.6-replica_set-noauth
- test-3.6-sharded_cluster-noauth
- name: rhel8-test-lambda
display_name: AWS Lambda handler tests
run_on: rhel80-large
Expand Down
10 changes: 2 additions & 8 deletions src/cmap/auth/mongo_credentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,10 @@ function getDefaultAuthMechanism(hello: Document | null): AuthMechanism {
? AuthMechanism.MONGODB_SCRAM_SHA256
: AuthMechanism.MONGODB_SCRAM_SHA1;
}

// Fallback to legacy selection method. If wire version >= 3, use scram-sha-1
if (hello.maxWireVersion >= 3) {
return AuthMechanism.MONGODB_SCRAM_SHA1;
}
}

// Default for wireprotocol < 3
return AuthMechanism.MONGODB_CR;
// Default auth mechanism for 4.0 and higher.
return AuthMechanism.MONGODB_SCRAM_SHA256;
}

const ALLOWED_ENVIRONMENT_NAMES: AuthMechanismProperties['ENVIRONMENT'][] = [
Expand Down Expand Up @@ -173,7 +168,6 @@ export class MongoCredentials {
validate(): void {
if (
(this.mechanism === AuthMechanism.MONGODB_GSSAPI ||
this.mechanism === AuthMechanism.MONGODB_CR ||
this.mechanism === AuthMechanism.MONGODB_PLAIN ||
this.mechanism === AuthMechanism.MONGODB_SCRAM_SHA1 ||
this.mechanism === AuthMechanism.MONGODB_SCRAM_SHA256) &&
Expand Down
38 changes: 0 additions & 38 deletions src/cmap/auth/mongocr.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/cmap/auth/providers.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/** @public */
export const AuthMechanism = Object.freeze({
MONGODB_AWS: 'MONGODB-AWS',
MONGODB_CR: 'MONGODB-CR',
MONGODB_DEFAULT: 'DEFAULT',
MONGODB_GSSAPI: 'GSSAPI',
MONGODB_PLAIN: 'PLAIN',
Expand Down
4 changes: 2 additions & 2 deletions src/cmap/wire_protocol/constants.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const MIN_SUPPORTED_SERVER_VERSION = '3.6';
export const MIN_SUPPORTED_SERVER_VERSION = '4.0';
export const MAX_SUPPORTED_SERVER_VERSION = '8.0';
export const MIN_SUPPORTED_WIRE_VERSION = 6;
export const MIN_SUPPORTED_WIRE_VERSION = 7;
export const MAX_SUPPORTED_WIRE_VERSION = 25;
export const MIN_SUPPORTED_QE_WIRE_VERSION = 21;
export const MIN_SUPPORTED_QE_SERVER_VERSION = '7.0';
Expand Down
2 changes: 0 additions & 2 deletions src/mongo_client_auth_providers.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { type AuthProvider } from './cmap/auth/auth_provider';
import { GSSAPI } from './cmap/auth/gssapi';
import { type AuthMechanismProperties } from './cmap/auth/mongo_credentials';
import { MongoCR } from './cmap/auth/mongocr';
import { MongoDBAWS } from './cmap/auth/mongodb_aws';
import { MongoDBOIDC, OIDC_WORKFLOWS, type Workflow } from './cmap/auth/mongodb_oidc';
import { AutomatedCallbackWorkflow } from './cmap/auth/mongodb_oidc/automated_callback_workflow';
Expand All @@ -16,7 +15,6 @@ import { MongoInvalidArgumentError } from './error';
/** @internal */
const AUTH_PROVIDERS = new Map<AuthMechanism | string, (workflow?: Workflow) => AuthProvider>([
[AuthMechanism.MONGODB_AWS, () => new MongoDBAWS()],
[AuthMechanism.MONGODB_CR, () => new MongoCR()],
[AuthMechanism.MONGODB_GSSAPI, () => new GSSAPI()],
[AuthMechanism.MONGODB_OIDC, (workflow?: Workflow) => new MongoDBOIDC(workflow)],
[AuthMechanism.MONGODB_PLAIN, () => new Plain()],
Expand Down
1 change: 0 additions & 1 deletion test/mongodb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ export * from '../src/cmap/auth/auth_provider';
export * from '../src/cmap/auth/aws_temporary_credentials';
export * from '../src/cmap/auth/gssapi';
export * from '../src/cmap/auth/mongo_credentials';
export * from '../src/cmap/auth/mongocr';
export * from '../src/cmap/auth/mongodb_aws';
export * from '../src/cmap/auth/mongodb_oidc';
export * from '../src/cmap/auth/mongodb_oidc/azure_machine_workflow';
Expand Down
45 changes: 2 additions & 43 deletions test/spec/auth/legacy/connection-string.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,47 +163,6 @@
"uri": "mongodb://localhost/?authMechanism=GSSAPI",
"valid": false
},
{
"description": "should recognize the mechanism (MONGODB-CR)",
"uri": "mongodb://user:password@localhost/?authMechanism=MONGODB-CR",
"valid": true,
"credential": {
"username": "user",
"password": "password",
"source": "admin",
"mechanism": "MONGODB-CR",
"mechanism_properties": null
}
},
{
"description": "should use the database when no authSource is specified (MONGODB-CR)",
"uri": "mongodb://user:password@localhost/foo?authMechanism=MONGODB-CR",
"valid": true,
"credential": {
"username": "user",
"password": "password",
"source": "foo",
"mechanism": "MONGODB-CR",
"mechanism_properties": null
}
},
{
"description": "should use the authSource when specified (MONGODB-CR)",
"uri": "mongodb://user:password@localhost/foo?authMechanism=MONGODB-CR&authSource=bar",
"valid": true,
"credential": {
"username": "user",
"password": "password",
"source": "bar",
"mechanism": "MONGODB-CR",
"mechanism_properties": null
}
},
{
"description": "should throw an exception if no username is supplied (MONGODB-CR)",
"uri": "mongodb://localhost/?authMechanism=MONGODB-CR",
"valid": false
},
{
"description": "should recognize the mechanism (MONGODB-X509)",
"uri": "mongodb://CN%3DmyName%2COU%3DmyOrgUnit%2CO%3DmyOrg%2CL%3DmyLocality%2CST%3DmyState%2CC%3DmyCountry@localhost/?authMechanism=MONGODB-X509",
Expand Down Expand Up @@ -517,7 +476,7 @@
},
{
"description": "should throw an exception if username is specified for test (MONGODB-OIDC)",
"uri": "mongodb://principalName@localhost/?authMechanism=MONGODB-OIDC&ENVIRONMENT:test",
"uri": "mongodb://principalName@localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=ENVIRONMENT:test",
"valid": false,
"credential": null
},
Expand Down Expand Up @@ -669,4 +628,4 @@
"credential": null
}
]
}
}
Loading

0 comments on commit d5648de

Please sign in to comment.