-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DOCSP-34240: Document metadata encryption in Kotlin SDK (#3074)
## Pull Request Info Update existing [Encrypt a Realm](https://www.mongodb.com/docs/realm/sdk/kotlin/realm-database/realm-files/encrypt-a-realm/) and [Connect to App Services](https://www.mongodb.com/docs/realm/sdk/kotlin/app-services/connect-to-app-services-backend/) pages with info on App metadata encryption. ### Jira - https://jira.mongodb.org/browse/DOCSP-34240 ### Staged Changes - [Encrypt a Realm - Kotlin SDK](https://preview-mongodbcbullinger.gatsbyjs.io/realm/docsp-34240-encrypt-app-metadata/sdk/kotlin/realm-database/realm-files/encrypt-a-realm/#std-label-kotlin-encryption-and-device-sync) - [Connect to Atlas App Services - Kotlin SDK](https://preview-mongodbcbullinger.gatsbyjs.io/realm/docsp-34240-encrypt-app-metadata/sdk/kotlin/app-services/connect-to-app-services-backend/#encrypt-app-metadata) ### Reminder Checklist If your PR modifies the docs, you might need to also update some corresponding pages. Check if completed or N/A. - [x] Create Jira ticket for corresponding docs-app-services update(s), if any - [x] Checked/updated Admin API - [x] Checked/updated CLI reference ### Review Guidelines [REVIEWING.md](https://github.com/mongodb/docs-realm/blob/master/REVIEWING.md)
- Loading branch information
1 parent
870c6ff
commit 2d6438a
Showing
14 changed files
with
239 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
source/examples/generated/kotlin/AppClientTest.snippet.configure-app-client.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
// Creates an App with custom configuration values | ||
AppConfiguration.Builder(YOUR_APP_ID) // Replace with your App ID | ||
// Specify your custom configuration values | ||
.appName("my-app-name") | ||
.encryptionKey(myEncryptionKey) | ||
.appVersion("1.0.0") | ||
.baseUrl("http://localhost:9090") | ||
.build() |
4 changes: 4 additions & 0 deletions
4
source/examples/generated/kotlin/AppClientTest.snippet.encrypted-app-client.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
AppConfiguration.Builder(YOUR_APP_ID) | ||
// Specify the encryption key | ||
.encryptionKey(myEncryptionKey) | ||
.build() |
4 changes: 1 addition & 3 deletions
4
source/examples/generated/kotlin/AppClientTest.snippet.set-custom-http-headers.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
AppConfiguration.Builder(YOUR_APP_ID) | ||
.authorizationHeaderName("MyApp-Authorization") | ||
.customRequestHeaders { | ||
put("X-MyApp-Version", "1.0.0") | ||
} | ||
.customRequestHeaders { put("X-MyApp-Version", "1.0.0") } | ||
.build() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
source/examples/generated/kotlin/EncryptARealmTest.snippet.encrypt-synced-realm.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
val syncConfig = SyncConfiguration.Builder(user, setOf(Frog::class)) | ||
.initialSubscriptions { realm -> | ||
add(realm.query<Frog>()) | ||
} | ||
// Specify the encryption key | ||
.encryptionKey(generatedKey) | ||
.build() | ||
val realm = Realm.open(syncConfig) | ||
Log.v("Successfully opened encrypted realm: ${realm.configuration.name}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.