Skip to content

Commit bed1133

Browse files
authored
DRIVERS-3439 Remove pre-MongoDB 4.2 references from specs and tests (#1929)
Remove spec tests and prose gated on MongoDB server versions < 4.2, now that 4.2 is the minimum supported server version. - YAML spec test files deleted if no tests in them run post 4.0 - Individual tests removed from mixed files - Normative spec text simplified across all spec documents - removed dead version/wire-version-gated behavior, pseudocode branches, and prose conditions that can never be false at a 4.2 floor - Prose/integration test instructions updated across ~15 test READMEs. Removed un-runnable version requirements and vacuous "X.Y or higher" qualifiers; outdated numbered prose tests marked "Removed". - Dead comments cleaned from YAML test files (comment-only changes) - Minimum Server Version front matter headers removed from specs whose stated minimum was below 4.2 Historical/rationale content (e.g. "Version 4.0 of the server introduces...", Design Rationale sections, @SInCE annotations) was intentionally left in place, as were minServerVersion/maxServerVersion test gates regardless of value.
1 parent 93a77b5 commit bed1133

139 files changed

Lines changed: 333 additions & 8549 deletions

File tree

Some content is hidden

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

source/auth/auth.md

Lines changed: 16 additions & 123 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Authentication
22

33
- Status: Accepted
4-
- Minimum Server Version: 2.6
54

65
______________________________________________________________________
76

@@ -103,8 +102,8 @@ Userinfo or authentication parameters in connection options MUST NOT be interpre
103102
#### Errors
104103

105104
Drivers SHOULD raise an error as early as possible when detecting invalid values in a credential. For instance, if a
106-
`mechanism_property` is specified for [MONGODB-CR](#mongodb-cr), the driver should raise an error indicating that the
107-
property does not apply.
105+
`mechanism_property` is specified for a mechanism that does not support it, the driver should raise an error indicating
106+
that the property does not apply.
108107

109108
Drivers MUST raise an error if any required information for a mechanism is missing. For instance, if a `username` is not
110109
specified for SCRAM-SHA-256, the driver must raise an error indicating the the property is missing.
@@ -147,8 +146,7 @@ Drivers MUST follow the following steps for an authentication handshake:
147146
type. If the `hello` or legacy hello of the MongoDB Handshake fails with an error, drivers MUST treat this as an
148147
authentication error.
149148
2. If the server is of type RSArbiter, no authentication is possible and the handshake is complete.
150-
3. Inspect the value of `maxWireVersion`. If the value is greater than or equal to `6`, then the driver MUST use
151-
`OP_MSG` for authentication. Otherwise, it MUST use `OP_QUERY`.
149+
3. Drivers MUST use `OP_MSG` for authentication.
152150
4. If credentials exist: 3.1. A driver MUST authenticate with all credentials provided to the MongoClient. 3.2. A single
153151
invalid credential is the same as all credentials being invalid.
154152

@@ -162,8 +160,6 @@ All blocking operations executed as part of the authentication handshake MUST ap
162160

163161
#### Mechanism Negotiation via Handshake
164162

165-
- Since: 4.0
166-
167163
If an application provides a username but does not provide an authentication mechanism, drivers MUST negotiate a
168164
mechanism via a `hello` or legacy hello command requesting a user's supported SASL mechanisms:
169165

@@ -177,8 +173,7 @@ in the auth credential. The username MUST NOT be modified from the form provided
177173
SASLprep), as the server uses the raw form to look for conflicts with legacy credentials.
178174

179175
If the handshake response includes a `saslSupportedMechs` field, then drivers MUST use the contents of that field to
180-
select a default mechanism as described later. If the command succeeds and the response does not include a
181-
`saslSupportedMechs` field, then drivers MUST use the legacy default mechanism rules for servers older than 4.0.
176+
select a default mechanism as described later.
182177

183178
Drivers MUST NOT validate the contents of the `saslSupportedMechs` attribute of the initial handshake reply. Drivers
184179
MUST NOT raise an error if the `saslSupportedMechs` attribute of the reply includes an unknown mechanism.
@@ -198,13 +193,8 @@ Drivers with a list of credentials at the time a connection is opened MAY do mec
198193
handshake, but only for the first credential in the list of credentials.
199194

200195
When authenticating each credential, if the authentication mechanism is not specified and has not been negotiated for
201-
that credential:
202-
203-
- If the connection handshake results indicate the server version is 4.0 or later, drivers MUST send a new `hello` or
204-
legacy hello negotiation command for the credential to determine the default authentication mechanism.
205-
- Otherwise, when the server version is earlier than 4.0, the driver MUST select a default authentication mechanism for
206-
the credential following the instructions for when the `saslSupportedMechs` field is not present in a legacy hello
207-
response.
196+
that credential, drivers MUST send a new `hello` or legacy hello negotiation command for the credential to determine the
197+
default authentication mechanism.
208198

209199
### Caching credentials in SCRAM
210200

@@ -232,9 +222,6 @@ used when running the authentication spec tests.
232222

233223
### Default Authentication Methods
234224

235-
- Since: 3.0
236-
- Revised: 4.0
237-
238225
If the user did not provide a mechanism via the connection string or via code, the following logic describes how to
239226
select a default.
240227

@@ -255,101 +242,22 @@ be used as the default, regardless of whether SCRAM-SHA-1 is in the list. Driver
255242
mechanism (e.g. PLAIN) as the default.
256243

257244
If `saslSupportedMechs` is not present in the handshake response for mechanism negotiation, then SCRAM-SHA-1 MUST be
258-
used when talking to servers >= 3.0. Prior to server 3.0, MONGODB-CR MUST be used.
245+
used as the default.
259246

260247
When a user has specified a mechanism, regardless of the server version, the driver MUST honor this.
261248

262-
#### Determining Server Version
263-
264-
Drivers SHOULD use the server's wire version ranges to determine the server's version.
265-
266-
### MONGODB-CR
267-
268-
- Since: 1.4
269-
- Deprecated: 3.0
270-
- Removed: 4.0
271-
272-
MongoDB Challenge Response is a nonce and MD5 based system. The driver sends a `getnonce` command, encodes and hashes
273-
the password using the returned nonce, and then sends an `authenticate` command.
274-
275-
#### Conversation
276-
277-
1. Send `getnonce` command
278-
279-
```javascript
280-
CMD = { getnonce: 1 }
281-
RESP = { nonce: <nonce> }
282-
```
283-
284-
2. Compute key
285-
286-
```javascript
287-
passwordDigest = HEX( MD5( UTF8( username + ':mongo:' + password )))
288-
key = HEX( MD5( UTF8( nonce + username + passwordDigest )))
289-
```
290-
291-
3. Send `authenticate` command
292-
293-
```javascript
294-
CMD = { authenticate: 1, nonce: nonce, user: username, key: key }
295-
```
296-
297-
As an example, given a username of "user" and a password of "pencil", the conversation would appear as follows:
298-
299-
```javascript
300-
CMD = {getnonce : 1}
301-
RESP = {nonce: "2375531c32080ae8", ok: 1}
302-
CMD = {authenticate: 1, user: "user", nonce: "2375531c32080ae8", key: "21742f26431831d5cfca035a08c5bdf6"}
303-
RESP = {ok: 1}
304-
```
305-
306-
#### [MongoCredential](#mongocredential) Properties
307-
308-
- username
309-
310-
MUST be specified and non-zero length.
311-
312-
- source
313-
314-
MUST be specified. Defaults to the database name if supplied on the connection string or `admin`.
315-
316-
- password
317-
318-
MUST be specified.
319-
320-
- mechanism
321-
322-
MUST be "MONGODB-CR"
323-
324-
- mechanism_properties
325-
326-
MUST NOT be specified.
327-
328249
### MONGODB-X509
329250

330-
- Since: 2.6
331-
- Changed: 3.4
332-
333251
MONGODB-X509 is the usage of X.509 certificates to validate a client where the distinguished subject name of the client
334252
certificate acts as the username.
335253

336-
When connected to MongoDB 3.4:
337-
338254
- You MUST NOT raise an error when the application only provides an X.509 certificate and no username.
339255
- If the application does not provide a username you MUST NOT send a username to the server.
340256
- If the application provides a username you MUST send that username to the server.
341257

342-
When connected to MongoDB 3.2 or earlier:
343-
344-
- You MUST send a username to the server.
345-
- If no username is provided by the application, you MAY extract the username from the X.509 certificate instead of
346-
requiring the application to provide it.
347-
- If you choose not to automatically extract the username from the certificate you MUST error when no username is
348-
provided by the application.
349-
350258
#### Conversation
351259

352-
1. Send `authenticate` command (MongoDB 3.4+)
260+
1. Send `authenticate` command
353261

354262
```javascript
355263
CMD = {"authenticate": 1, "mechanism": "MONGODB-X509"}
@@ -371,7 +279,7 @@ When connected to MongoDB 3.2 or earlier:
371279

372280
- username
373281

374-
SHOULD NOT be provided for MongoDB 3.4+ MUST be specified and non-zero length for MongoDB prior to 3.4
282+
SHOULD NOT be provided
375283

376284
- source
377285

@@ -393,8 +301,6 @@ TODO: Errors
393301
394302
### SASL Mechanisms
395303
396-
- Since: 2.4 Enterprise
397-
398304
SASL mechanisms are all implemented using the same sasl commands and interpreted as defined by the
399305
[SASL specification RFC 4422](http://tools.ietf.org/html/rfc4422).
400306
@@ -428,12 +334,6 @@ SASL mechanisms are all implemented using the same sasl commands and interpreted
428334
429335
### GSSAPI
430336
431-
- Since:
432-
433-
2.4 Enterprise
434-
435-
2.6 Enterprise on Windows
436-
437337
GSSAPI is kerberos authentication as defined in [RFC 4752](http://tools.ietf.org/html/rfc4752). Microsoft has a
438338
proprietary implementation called SSPI which is compatible with both Windows and Linux clients.
439339
@@ -557,8 +457,6 @@ configuration option is set to `false`.
557457

558458
### PLAIN
559459

560-
- Since: 2.6 Enterprise
561-
562460
The PLAIN mechanism, as defined in [RFC 4616](http://tools.ietf.org/html/rfc4616), is used in MongoDB to perform LDAP
563461
authentication. It cannot be used to perform any other type of authentication. Since the credentials are stored outside
564462
of MongoDB, the `$external` database must be used for authentication.
@@ -605,8 +503,6 @@ MongoDB supports either of these forms.
605503

606504
### SCRAM-SHA-1
607505

608-
- Since: 3.0
609-
610506
SCRAM-SHA-1 is defined in [RFC 5802](http://tools.ietf.org/html/rfc5802).
611507

612508
[Page 11 of the RFC](http://tools.ietf.org/html/rfc5802#page-11) specifies that user names be prepared with SASLprep,
@@ -691,8 +587,6 @@ RESP = {conversationId: 1, payload: BinData(0,"dj1VTVdlSTI1SkQxeU5ZWlJNcFo0Vkh2a
691587
692588
### SCRAM-SHA-256
693589
694-
- Since: 4.0
695-
696590
SCRAM-SHA-256 extends [RFC 5802](http://tools.ietf.org/html/rfc5802) and is formally defined in
697591
[RFC 7677](https://tools.ietf.org/html/rfc7677).
698592
@@ -1903,19 +1797,18 @@ def reauth(connection):
19031797

19041798
- authMechanism
19051799

1906-
MONGODB-CR, MONGODB-X509, GSSAPI, PLAIN, SCRAM-SHA-1, SCRAM-SHA-256, MONGODB-AWS
1800+
MONGODB-X509, GSSAPI, PLAIN, SCRAM-SHA-1, SCRAM-SHA-256, MONGODB-AWS
19071801

1908-
Sets the Mechanism property on the MongoCredential. When not set, the default will be one of SCRAM-SHA-256,
1909-
SCRAM-SHA-1 or MONGODB-CR, following the auth spec default mechanism rules.
1802+
Sets the Mechanism property on the MongoCredential. When not set, the default will be SCRAM-SHA-256 or SCRAM-SHA-1,
1803+
following the auth spec default mechanism rules.
19101804

19111805
- authSource
19121806

19131807
Sets the Source property on the MongoCredential.
19141808

19151809
For GSSAPI, MONGODB-X509 and MONGODB-AWS authMechanisms the authSource defaults to `$external`. For PLAIN the authSource
1916-
defaults to the database name if supplied on the connection string or `$external`. For MONGODB-CR, SCRAM-SHA-1 and
1917-
SCRAM-SHA-256 authMechanisms, the authSource defaults to the database name if supplied on the connection string or
1918-
`admin`.
1810+
defaults to the database name if supplied on the connection string or `$external`. For SCRAM-SHA-1 and SCRAM-SHA-256
1811+
authMechanisms, the authSource defaults to the database name if supplied on the connection string or `admin`.
19191812

19201813
- authMechanismProperties=PROPERTY_NAME:PROPERTY_VALUE,PROPERTY_NAME2:PROPERTY_VALUE2
19211814

@@ -1960,8 +1853,6 @@ Connection string tests have been defined in the associated files:
19601853

19611854
### SCRAM-SHA-256 and mechanism negotiation
19621855

1963-
Testing SCRAM-SHA-256 requires server version 3.7.3 or later with `featureCompatibilityVersion` of "4.0" or later.
1964-
19651856
Drivers that allow specifying auth parameters in code as well as via connection string should test both for the test
19661857
cases described below.
19671858

@@ -2143,6 +2034,8 @@ practice to avoid this. (See
21432034

21442035
## Changelog
21452036

2037+
- 2026-06-17: Remove additional pre-4.2 version references.
2038+
21462039
- 2025-11-25: Remove redundant `*.mongodbgov.net` on `ALLOWED_HOSTS`
21472040

21482041
- 2025-11-19: Extend `ALLOWED_HOSTS` with `*.mongo.com` and `*.mongodbgov.net`

source/bson-decimal128/decimal128.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
# BSON Decimal128
22

33
- Status: Accepted
4-
- Minimum Server Version: 3.4
54

65
______________________________________________________________________
76

87
## Abstract
98

10-
MongoDB 3.4 introduces a new BSON type representing high precision decimal (`"\x13"`), known as Decimal128. 3.4
11-
compatible drivers must support this type by creating a Value Object for it, possibly with accessor functions for
12-
retrieving its value in data types supported by the respective languages.
9+
Decimal128 is a BSON type representing high precision decimal (`"\x13"`). Drivers must support this type by creating a
10+
Value Object for it, possibly with accessor functions for retrieving its value in data types supported by the respective
11+
languages.
1312

1413
Round-tripping Decimal128 types between driver and server MUST not change its value or representation in any way.
1514
Conversion to and from native language types is complicated and there are many pitfalls to represent Decimal128
@@ -340,15 +339,12 @@ Most of the tests are converted from the
340339

341340
- NumberDecimal("2.000")
342341

343-
- Should a driver avoid sending Decimal128 values to pre-3.4 servers?
344-
345-
- No
346-
347342
- Is there a wire version bump or something for Decimal128?
348343

349344
- No
350345

351346
## Changelog
352347

348+
- 2026-06-17: Remove pre-4.2 version references.
353349
- 2024-02-08: Migrated from reStructuredText to Markdown.
354350
- 2022-10-05: Remove spec front matter.

source/causal-consistency/causal-consistency.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Causal Consistency Specification
22

33
- Status: Accepted
4-
- Minimum Server Version: 3.6
54

65
______________________________________________________________________
76

@@ -196,9 +195,9 @@ started with `causalConsistency = true` then all operations using that session w
196195

197196
There are no new server commands related to causal consistency. Instead, causal consistency is implemented by:
198197

199-
1. Saving the `operationTime` returned by 3.6+ servers for all operations in a property of the `ClientSession` object.
200-
The server reports the `operationTime` whether the operation succeeded or not and drivers MUST save the
201-
`operationTime` in the `ClientSession` whether the operation succeeded or not.
198+
1. Saving the `operationTime` returned by servers for all operations in a property of the `ClientSession` object. The
199+
server reports the `operationTime` whether the operation succeeded or not and drivers MUST save the `operationTime`
200+
in the `ClientSession` whether the operation succeeded or not.
202201
2. Passing that `operationTime` in the `afterClusterTime` field of the `readConcern` field for subsequent causally
203202
consistent read and write operations (for all commands that support a `readConcern`)
204203
3. Gossiping clusterTime (described in the Driver Session Specification)
@@ -284,7 +283,7 @@ that causally consistent operations are not causally consistent with unacknowled
284283
Below is a list of test cases to write.
285284

286285
Note: some tests are only relevant to certain deployments. For the purpose of deciding which tests to run assume that
287-
any deployment that is version 3.6 or higher and is either a replica set or a sharded cluster supports cluster times.
286+
any deployment that is either a replica set or a sharded cluster supports cluster times.
288287

289288
1. When a `ClientSession` is first created the `operationTime` has no value.
290289
- `session = client.startSession()`
@@ -374,7 +373,7 @@ any deployment that is version 3.6 or higher and is either a replica set or a sh
374373

375374
## Motivation
376375

377-
To support causal consistency. Only supported with server version 3.6 or newer.
376+
To support causal consistency.
378377

379378
## Design Rationale
380379

0 commit comments

Comments
 (0)