|
Create a class APIParametersFromClient that parses the three API parameters. All parameters are "optional". Imitate OperationSessionInfoFromClient in logical_session_id.idl.
Create a function initializeAPIParameters in a new file initialize_api_parameters.cpp; imitate initialize_operation_session_info.cpp. The new function checks the following rule (from the "Command Syntax" section in the scope doc): If the client passed apiStrict and/or apiDeprecationErrors but not apiVersion, reply with InvalidOptions.
In execCommandDatabase in service_entry_point_common.cpp (mongod) and runCommand in strategy.cpp (mongos), create an APIParametersFromClient instance with initializeAPIParameters.
Write a JSTest to check that the rules are enforced on mongod and mongos.
(More rules will be enforced in a later ticket.)
|