[SERVER-73872] APIStrict validation is not performed for fields in inner structs in commands Created: 10/Feb/23  Updated: 29/Oct/23  Resolved: 21/Feb/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.0.0-rc0

Type: Bug Priority: Major - P3
Reporter: Projjal Chanda Assignee: Projjal Chanda
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Backwards Compatibility: Minor Change
Operating System: ALL
Backport Requested:
v6.3, v6.0, v5.0
Sprint: QE 2023-02-20, QE 2023-03-06
Participants:

 Description   

For example for unstable fields in UpdateOpEntry in update command, DeleteOpEntry in delete command, CollModIndex in collMod command, etc, the APIStrictError is not thrown when apistrict is set to true.

This looks to be happening because this constructor of IDLParserContext doesn't set the value of _apiStrict to  that of predecessor.

Confirmed this behavior in 6.0



 Comments   
Comment by Projjal Chanda [ 27/Feb/23 ]

This change doesn't fix the issue in createIndex command since there the parsing happens manually. Created ticket https://jira.mongodb.org/browse/SERVER-74305 to fix that.

Comment by Githook User [ 23/Feb/23 ]

Author:

{'name': 'Anna Henningsen', 'email': 'anna.henningsen@mongodb.com', 'username': 'addaleax'}

Message: chore(cli-repl): skip unique index creation test for apistrict (#1417)

This recently started failing in CI because of SERVER-73872.
Branch: MONGOSH-1316-automatically-create-encryption-keys
https://github.com/mongodb-js/mongosh/commit/11506970447d8c0d76a40ae4d361fbf4c1504c65

Comment by Githook User [ 23/Feb/23 ]

Author:

{'name': 'Anna Henningsen', 'email': 'anna.henningsen@mongodb.com', 'username': 'addaleax'}

Message: chore(cli-repl): skip unique index creation test for apistrict (#1417)

This recently started failing in CI because of SERVER-73872.
Branch: main
https://github.com/mongodb-js/mongosh/commit/11506970447d8c0d76a40ae4d361fbf4c1504c65

Comment by Githook User [ 23/Feb/23 ]

Author:

{'name': 'Anna Henningsen', 'email': 'anna.henningsen@mongodb.com', 'username': 'addaleax'}

Message: chore(cli-repl): skip unique index creation test for apistrict

This recently started failing in CI because of SERVER-73872.
Branch: fix-latest-apistrict-tests
https://github.com/mongodb-js/mongosh/commit/e63f72c5ec82ceaa7f364e598c5c74f6d101733f

Comment by Projjal Chanda [ 21/Feb/23 ]

There is a behaviour change (queries working in earlier versions can start failing) but it is an expected bug fix.

Comment by Githook User [ 21/Feb/23 ]

Author:

{'name': 'Projjal Chanda', 'email': 'projjal.chanda@mongodb.com', 'username': 'projjal'}

Message: SERVER-73872: Perform apiStrict checking for fields in inner structs in a command.
During parsing a command, before parsing an inner struct we construct a new IDLParserContext for it by passing the original context. The apiStrict value is however not retained in the new context object.
Branch: master
https://github.com/mongodb/mongo/commit/a5100222e771814ced026b2040c1653cbf231f2c

Generated at Thu Feb 08 06:25:52 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.