[SERVER-38900] Implement JSON Schema parsing for "encrypt" Created: 08/Jan/19  Updated: 29/Oct/23  Resolved: 25/Jan/19

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: 4.1.8

Type: Task Priority: Major - P3
Reporter: Nicholas Zolnierz Assignee: Vlad Rachev (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-39171 Implement 'encrypt.bsonType' keyword ... Closed
is depended on by SERVER-39182 Implement parsing for allowed keyword... Closed
is depended on by SERVER-39248 Implement FCV check for new JSON Sche... Closed
Documented
is documented by DOCS-12398 Docs for SERVER-38900: Implement JSON... Closed
Backwards Compatibility: Fully Compatible
Sprint: Query 2019-01-14, Query 2019-01-28, Query 2019-02-11
Participants:

 Description   
  • Can be present anywhere in the schema, including top-level.
  • Suggest starting with a new "translateEncryptionKeywords" method at the[ entry point in the parser|https://github.com/mongodb/mongo/blob/83a494cb0a1afca5cfaaf9d29eeb8a2ce1e02264/src/mongo/db/matcher/schema/json_schema_parser.cpp#L1355].
  • Resulting match expression should contain the new $_internalSchemaBinDataSubType expression.
  • This ticket should only implement the parsing required for mongod to understand the new keywords, no mongocryptd/FLE specific logic. For now, require that the "encrypt" argument is an empty object.


 Comments   
Comment by David Storch [ 10/Jul/19 ]

ravind.kumar, sorry about the confusion, and happy to field any further questions you may have! +1 to making sure that encryptMetadata is documented in the manual.

(eg.. bsonType is marked as a string|array of strings in one doc, but afaik it only supports a single bsonType)

Hopefully I cleared this up in our discussion on another ticket. Let me know if you see any other discrepancies like this.

Comment by Nicholas Zolnierz [ 09/Jul/19 ]

Sorry about that, I've marked SERVER-39246 as docs needed. Feel free to reach out to myself or Pawel to review!

Comment by Ravind Kumar (Inactive) [ 09/Jul/19 ]

That's what I was looking for - since SERVER-39246 was not marked as docs needed, nothing was generated. There was also some general confusion as to whether encryptMetadata had made it through. This clarifies that.

The link I think covers the full spec, including both auto encryption and explicit encryption. It is indeed a little awkward to depend wholly on the manual for defining encrypt/encryptMetadata, as there are discrepancies between the various available documents (eg.. bsonType is marked as a string|array of strings in one doc, but afaik it only supports a single bsonType). Happy to discuss offline.

Can someone set SERVER-39246 to be docs needed? I'm not sure if it will still generate the appropriate docs ticket automatically at this point. IF not I'll fold it into ongoing work.

Comment by Nicholas Zolnierz [ 09/Jul/19 ]

ravind.kumar I haven't gone through the driver spec in detail, but I suspect the link you gave is for explicit encryption? In that case, encryptMetadata is not relevant as there's no JSON Schema involved. It appears as though the JSON Schema section does only mention encrypt, which is a little awkward but OK because it then references the manual for more details?

As for the commit, this ticket was specifically for encrypt and SERVER-39246 handled encryptMetadata. Does that answer your concerns or did I misunderstand something?

Comment by Githook User [ 25/Jan/19 ]

Author:

{'email': 'vlad.rachev@mongodb.com', 'name': 'vrachev'}

Message: SERVER-38900 Implement JSON Schema parsing for 'encrypt'
Branch: master
https://github.com/mongodb/mongo/commit/ffe35fbcb46d344fef138fe82dfbedc070205ab8

Generated at Thu Feb 08 04:50:22 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.