-
Notifications
You must be signed in to change notification settings - Fork 232
[Encryption] Fix format of encryptedFieldsMaps
in the autoEncryption
configuration
#905
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
base: feature/queryable-encryption
Are you sure you want to change the base?
[Encryption] Fix format of encryptedFieldsMaps
in the autoEncryption
configuration
#905
Conversation
$encryptedFieldsMap = []; | ||
foreach ($documentManager->getMetadataFactory()->getAllMetadata() as $metadata) { | ||
$database = $documentManager->getDocumentDatabase($metadata->getName()); | ||
$collectionInfoIterator = $database->listCollections(['filter' => ['name' => $metadata->getCollection()]]); |
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.
This is inspired by the get_encrypted_fields_from_server
function.
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.
I think this change is reasonable. We need to make sure how to properly generate the encryptedFieldsMap for use in the configuration. For a future improvement, we can consider dumping the encryptedFieldsMap
based on the return value of createEncryptedCollection
calls in the schema:create
command.
125545d
to
96849e3
Compare
<doctrine:queries queryType="equality" /> | ||
</doctrine:field> | ||
</doctrine:encryptedFields> | ||
<![CDATA[ |
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.
@alcaeus Since the XML format is set to disappear, I have simplified the configuration here. EncryptedFieldsMap is a JSON string that is copied from the dump command in the XML. It is too complicated to convert this to XML tags, and most likely unusable anyway.
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.
That makes sense 👍
encryptedFieldsMaps
in the autoEncryption
configurationencryptedFieldsMaps
in the autoEncryption
configuration
96849e3
to
3eb3779
Compare
In driver options, the
encryptedFieldsMap
option must:fields
key with the list of fieldsquery.min
andquery.max
to the same BSON type as the fieldkeyId
. But this value will change every time the database is reset.This needs to be improved by leveraging
keyAltNames
.