-
Notifications
You must be signed in to change notification settings - Fork 208
PHPC-2197: Support queryable encryption range indexes #1409
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
179778f
to
0f5a0c2
Compare
Define algorithm and query type constants for range preview
Note that it is not possible to write a test for decrypt() since Binary instances always encode to BSON.
var_dump($encryptedExpr->{'$and'}[0]->encryptedInt->{'$gte'}->getType() === MongoDB\BSON\Binary::TYPE_ENCRYPTED); | ||
|
||
var_dump($encryptedExpr->{'$and'}[1]->encryptedInt->{'$lte'} instanceof MongoDB\BSON\Binary); | ||
var_dump($encryptedExpr->{'$and'}[1]->encryptedInt->{'$lte'}->getType() === MongoDB\BSON\Binary::TYPE_ENCRYPTED); |
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.
@@ -943,6 +1089,10 @@ static void phongo_clientencryption_decrypt(php_phongo_clientencryption_t* clien | |||
|
|||
php_phongo_zval_to_bson_value(zciphertext, PHONGO_BSON_NONE, &ciphertext); | |||
|
|||
if (EG(exception)) { | |||
goto cleanup; |
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 added for consistency but we don't actually test for this since decrypt()
expects a Binary and that is always going to successfully encode to BSON.
This is also mentioned in the commit message.
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.
You mean it's inaccessible code, intentionally added? That seems strange to me. A comment in the code would be more appropriate.
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.
See #1412 (comment) for a recent discussion about this very issue in @alcaeus' PR.
I think ideally we'd use assertions here, as is sometimes done in libmongoc; however, there's no prior art in PHPC for doing so.
I created PHPC-2235 to track this, but I'd prefer to leave this in place for now since it'd be easily detected by tooling should we end up integrating that.
https://jira.mongodb.org/browse/PHPC-2197