Skip to content
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

(DOCSP-33626) Document metadata encryption #3068

Merged
merged 11 commits into from
Nov 6, 2023

Conversation

krollins-mdb
Copy link
Collaborator

@krollins-mdb krollins-mdb commented Nov 3, 2023

Pull Request Info

Jira

Staged Changes

Review Guidelines

REVIEWING.md

Animal Wearing a Hat

- Add test for encrypting metadata
- Add test for encrypting a realm
- Generate snippets
- Remove old encrypt example
- Add content and clean up old content
Copy link

github-actions bot commented Nov 3, 2023

Readability for Commit Hash: a0fe4ff

You can see any previous Readability scores (if they exist) by looking
at the comment's history.

Readability scores for changed documents:

  • source/sdk/react-native/realm-files/encrypt: Grade Level: 9.2, Reading Ease: 56.05
  • source/sdk/react-native/app-services/connect-to-app-services-app: Grade Level: 7.3, Reading Ease: 61.02
  • source/sdk/node/realm-files/encrypt: Grade Level: 8.7, Reading Ease: 57.37
  • source/sdk/node/app-services/connect-to-app-services-backend: Grade Level: 8.7, Reading Ease: 51.95

For Grade Level, aim for 8 or below.

For Reading Ease scores, aim for 60 or above:

Score Difficulty
90-100 Very Easy
80-89 Easy
70-79 Fairly Easy
60-69 Medium
50-59 Fairly Hard
30-49 Hard
0-29 Very Hard

For help improving readability, try Hemingway App.

- Add React Native versions of encryption
@krollins-mdb
Copy link
Collaborator Author

The React Native test suite has an unrelated failing test. I'm looking into that separately.

@krollins-mdb krollins-mdb marked this pull request as ready for review November 6, 2023 15:51
Copy link
Collaborator

@cbullinger cbullinger left a comment

Choose a reason for hiding this comment

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

some non-blocking questions. overall LGTM


To encrypt App metadata:

#. Import ``MetadataMode`` from ``Realm``.
Copy link
Collaborator

Choose a reason for hiding this comment

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

just curious why we're not including the explicit import statements like we've done in the RN Connect to an App Services page

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good question! Mostly because the imports are less... intense for Node. But it would still be good to include them. Thanks for pointing this out.


#. Import ``MetadataMode`` from ``Realm``.
#. Create an App configuration object that contains the ``metadata`` property.
#. Set ``metadata.mode`` to a value from the ``MetadataMode`` enum.
Copy link
Collaborator

Choose a reason for hiding this comment

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

for the purposes of this procedure, would you only use Encryption or am I misreading the other enum values?

Copy link
Collaborator Author

@krollins-mdb krollins-mdb Nov 6, 2023

Choose a reason for hiding this comment

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

Hmm, yeah. I should probably explain what the enum values mean. Although for now, just documenting Encryption is probably enough?

.. include:: /examples/generated/react-native/v12/EncryptMetadata.snippet.imports.tsx.rst

#. Create an App configuration object that contains the ``metadata`` property.
#. Set ``metadata.mode`` to a value from the ``MetadataMode`` enum.
Copy link
Collaborator

Choose a reason for hiding this comment

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

same Q as earlier

@@ -0,0 +1,13 @@
.. code-block:: typescript
:emphasize-lines: 1, 7, 7
Copy link
Collaborator

Choose a reason for hiding this comment

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

ah, interesting. looks like those duped emphasize lines are happening in your generated snippets too. i wonder what's causing 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.

Huh. That's really odd! I rarely look at the generated snippets themselves, so it's probably in a lot of my snippets.

krollins-mdb and others added 3 commits November 6, 2023 11:17
Co-authored-by: cbullinger <115956901+cbullinger@users.noreply.github.com>
@krollins-mdb krollins-mdb merged commit 60532d0 into mongodb:master Nov 6, 2023
@krollins-mdb krollins-mdb deleted the DOCSP-33626 branch November 6, 2023 20:44
@docs-builder-bot
Copy link

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.

3 participants