-
Notifications
You must be signed in to change notification settings - Fork 263
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
PHPLIB-1176: Various improvements for In-Use Encryption tutorial #1122
PHPLIB-1176: Various improvements for In-Use Encryption tutorial #1122
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.
This tutorial is much better than the previous version. Not sure if literalinclude
is supported on Snooty (whenever we migrate to it), but that's something to worry about once the time comes.
11e7964
to
de1f890
Compare
Added test coverage for example script output. Also fixed some issues in the original example scripts:
|
c85e70c
to
cf0b7e1
Compare
f2328c3
to
890dd41
Compare
See: https://github.com/mongodb/snooty-parser/blob/master/snooty/rstspec.toml#L194 |
4c9f55a
to
29db0f8
Compare
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.
Thanks, CSFLE holds no secrets for me now 👍🏻
|
||
/* Note: this script assumes that the test database is empty and that the key | ||
* vault collection exists and has a partial, unique index on keyAltNames (as | ||
* demonstrated in the encryption key management scripts). */ |
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 note is included in scripts other than create_data_key.php
and key_alt_name.php
, which demonstrate creation of the unique index on the key vault. I'm reasonably happy with this, as it avoids repetition, and also goes along with the note I added in the RST prose above the key_alt_name.php
example.
This means all drop()
calls are removed and createCollection()
only exists in the QE example scripts, since it's necessary to handle encryptedFields
. I've revised the comments to remind users about encryptedFields
when dropping collections.
ExamplesTest was also updated to ensure a clean test environment going into each script, and create the necessary key vault index.
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
Adds additional non-enterprise examples from the PyMongo tutorial: "Explicit Encryption with Automatic Decryption" and "Explicit Queryable Encryption". Examples are now broken out into separate files, which are tested in ExamplesTest. Renames "Client-Side Encryption" to "In-Use Encryption" (PHPLIB-997). This will warrant adding a redirect from "/tutorial/client-side-encryption/" to "/tutorial/encryption/" in the related docs-php-library project. Adds docs for crypt_shared and mongocryptd (PHPLIB-985).
Demonstrates schema validation errors in example scripts Relocates local schema section after server-side schema, and clarifies that it should be used in conjunction with server-side schemas (not instead of). Revise comments and variable names in scripts and update expected output for tests accordingly.
…e elsewhere This replaces the setup code with a top-of-script comment to avoid repetition. ExamplesTest now prepares the cleans up the necessary collections. Add a note about creating the partial, unique index on keyAltNames.
bb1393b
to
847023d
Compare
https://jira.mongodb.org/browse/PHPLIB-1176
Note: this is rebased on #1123, which fixes the docs build.
Also, I'll plan to create a separate PR (or DOCSP ticket) to setup the redirect in mongodb/docs-php-library.
Summary of changes
Adds additional non-enterprise examples from the PyMongo tutorial: "Explicit Encryption with Automatic Decryption" and "Explicit Queryable Encryption".
Examples are now broken out into separate files, which are tested in ExamplesTest.
Renames "Client-Side Encryption" to "In-Use Encryption" (PHPLIB-997). This will warrant adding a redirect from "/tutorial/client-side-encryption/" to "/tutorial/encryption/" in the related docs-php-library project.
Adds docs for crypt_shared and mongocryptd (PHPLIB-985).