Skip to content

chore: comments on CSFLE feature branch PR#2 #15407

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 7, 2025

Conversation

baileympearson
Copy link
Contributor

Summary

This PR address a few more comments on the CSFLE feature branch: #15390

Additionally, I did a final review of the documentation and made a few small changes. Additionally, I added Typescript support for the new clientEncryption() method on Mongoose's Model class.

Examples

@@ -16,104 +16,6 @@ The resulting document will look similar to the following to a client that doesn

You can read more about CSFLE on the [MongoDB CSFLE documentation](https://www.mongodb.com/docs/manual/core/csfle/) and [this blog post about CSFLE in Node.js](https://www.mongodb.com/developer/languages/javascript/client-side-field-level-encryption-csfle-mongodb-node/).

Note that Mongoose does **not** currently have any Mongoose-specific APIs for CSFLE.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved this to the bottom of the page to emphasize the new Mongoose API for FLE.

@baileympearson baileympearson mentioned this pull request May 6, 2025
Copy link
Collaborator

@hasezoey hasezoey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, lint will need to be resolved though.

@baileympearson baileympearson requested a review from hasezoey May 7, 2025 14:17
Copy link
Collaborator

@hasezoey hasezoey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still looks good to me.

@vkarpov15 vkarpov15 requested a review from Copilot May 7, 2025 15:31
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR provides additional comments on the CSFLE feature branch by adding new tests for duplicate key handling in discriminator schemas, updating the documentation for field-level encryption, and adding Typescript support for Model.clientEncryption().

  • New integration tests for cloned parent schemas with CSFLE and queryable encryption
  • Minor refactor with optional chaining on connection.close() and comment clarification in sort function
  • Documentation updates with revised instructions and an added section for Manual FLE

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
test/encryption/encryption.test.js Added new tests to verify error throwing for duplicate encrypted keys and minor code refinements
docs/field-level-encryption.md Updated documentation text, restructured content, and added Manual FLE setup instructions

model = connection.model('Schema', schema);

assert.throws(() => {
const clonedSchema = schema.clone().add({
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In an ideal world, we would support this behavior because there are a number of users that rely on this pattern. However, we can consider throwing an error when using cloned schemas for disctiminator() a simplifying assumption, and add support for it later if there is demand.

@vkarpov15 vkarpov15 merged commit 387c957 into Automattic:csfle May 7, 2025
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants