-
Notifications
You must be signed in to change notification settings - Fork 235
feat: visually identify CSFLE-decrypted fields COMPASS-5628 #2951
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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! |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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"> | ||
: | ||
{ | ||
/* TODO: figure out exact placement */ |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 ;)
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm! nice
Note: This only works with the changes in mongodb-js/devtools-connect#9 and mongodb/libmongocrypt@adfdce0.
(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
Motivation and Context
Open Questions
Dependents
Types of changes