Skip to content

Conversation

addaleax
Copy link
Collaborator

@addaleax addaleax commented Apr 5, 2022

Note: This only works with the changes in mongodb-js/devtools-connect#9 and mongodb/libmongocrypt@adfdce0.

Screenshot from 2022-04-05 22-21-59

(For now not placing this on the right-hand side of the screen as we had discussed last week, because we only actually show the types in edit mode currently)

Description

Checklist

  • New tests and/or benchmarks are included
  • Documentation is changed or added

Motivation and Context

  • Bugfix
  • New feature
  • Dependency update
  • Misc

Open Questions

Dependents

Types of changes

  • Backport Needed
  • Patch (non-breaking change which fixes an issue)
  • Minor (non-breaking change which adds functionality)
  • Major (fix or feature that would cause existing functionality to change)

@addaleax addaleax requested a review from Anemy April 5, 2022 20:24
Copy link
Member

@Anemy Anemy left a comment

Choose a reason for hiding this comment

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

Screen Shot 2022-04-07 at 9 13 42 PM

One or two questions, looking good - also handles that long string case nicely ^^
Looking at the maybeDecorateWithDecryptedKeys it looks like we have to repeat that in a lot of places, is there a way we could keep it more in one place? Not sure if that's possible without some larger refactoring so I'm thinking its fine as is?

* Detemine if this value or any of its children were marked
* as having been decrypted with CSFLE.
*
* Warning: This does *not* apply to the children of these elements!
Copy link
Member

Choose a reason for hiding this comment

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

Maybe I'm misunderstanding this function, but aren't we evaluating here if the children of this element have decrypted children?
Should this warning be for isValueDecrypted?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Maybe I'm misunderstanding this function, but aren't we evaluating here if the children of this element have decrypted children?

I’ve made the comments a bit more explicit – it returns whether a child of this element has been decrypted. That would not apply to a child of a decrypted field, because decrypted fields generally don’t have decrypted children.

I will admit that I’ve never actually checked what happens when nested encryption happens on nested fields. I don’t think anybody would ever really do this on purpose, but I’ve opened COMPASS-5705 to remind myself to look into that, and how we would handle it in Compass. 🙂

Should this warning be for isValueDecrypted?

It also applies there, that’s true 🙂 Added it.

<div className={elementDivider} role="presentation">
:&nbsp;
{
/* TODO: figure out exact placement */
Copy link
Member

Choose a reason for hiding this comment

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

How do we figure out exact placement? Is that pending w/ Claudia? If there is a ticket maybe we can link it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, I’ve opened a ticket and assigned it to her, added the reference here ;)

@addaleax
Copy link
Collaborator Author

addaleax commented Apr 8, 2022

Looking at the maybeDecorateWithDecryptedKeys it looks like we have to repeat that in a lot of places

I don’t think we’ll need to repeat it in more places than the ones that are present here. It is a bit weird that we duplicate the object generation code four times essentially, but I don’t think this PR is making things much worse? 🤷‍♀️ It’s certainly possible to merge those (I certainly feel like I’m leaning towards DRY a bit more than others) but it might also be okay to keep it simple here.

@addaleax addaleax requested a review from Anemy April 8, 2022 14:49
Copy link
Member

@Anemy Anemy left a comment

Choose a reason for hiding this comment

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

lgtm! nice

@addaleax addaleax merged commit 4bea071 into main Apr 8, 2022
@addaleax addaleax deleted the 5628-dev branch April 8, 2022 16:43
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.

2 participants