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

Enable Property Level Encryption app when device is offline. #41

Merged
merged 64 commits into from
Aug 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
317944b
Minimum example for field level encryption
clementetb May 31, 2023
b67f829
Implement keystore in custom data
clementetb Jun 2, 2023
1b71137
Working example
clementetb Jun 5, 2023
b8ade78
Screens and navigations
clementetb Jun 5, 2023
42ede8f
Bind actions
clementetb Jun 6, 2023
c07cfb3
Cleanup
clementetb Jun 6, 2023
e70351d
Add dependency injection
clementetb Jun 6, 2023
297abc6
Store cipher spec with key in keystore
clementetb Jun 6, 2023
e476744
Add copyright
clementetb Jun 6, 2023
d20f259
Migrate to use version catalog
clementetb Jun 7, 2023
8c31686
Add server app
clementetb Jun 7, 2023
0ff408c
Clean up
clementetb Jun 7, 2023
9c8ddd8
Check if required apps are available
clementetb Jun 8, 2023
456619d
Improve showing demo statuses
clementetb Jun 9, 2023
6ba84b3
Improve landing UI experience
clementetb Jun 9, 2023
3ab4e51
Ui clean up
clementetb Jun 9, 2023
0a35c3a
Some clean up
clementetb Jun 9, 2023
d8c973e
Add some documentation
clementetb Jun 12, 2023
f4a2c43
Add Readme
clementetb Jun 12, 2023
d846b7b
Add Readme and remove embedded object
clementetb Jun 12, 2023
56707c5
Make keyboard interaction better. (#38)
Jun 22, 2023
4297c11
Use a BKS keystore as the remote keystore
clementetb Jun 22, 2023
769322f
Clean up
clementetb Jun 26, 2023
80cac2e
Presence detection sample
clementetb Jun 26, 2023
2e49755
Push readme updates
clementetb Jun 27, 2023
298300a
Add links
clementetb Jun 27, 2023
c98d0c0
Update CuratedSyncExamples/README.md
clementetb Jun 27, 2023
d28393c
Update CuratedSyncExamples/README.md
clementetb Jun 27, 2023
40ac767
Update CuratedSyncExamples/demo/.gitignore
clementetb Jun 27, 2023
c03ed27
Update CuratedSyncExamples/demo/src/main/java/io/realm/curatedsyncexa…
clementetb Jun 27, 2023
62a7557
Update CuratedSyncExamples/build.gradle.kts
clementetb Jun 27, 2023
aee0244
Update CuratedSyncExamples/demo/build.gradle.kts
clementetb Jun 27, 2023
8a147be
PR change requests
clementetb Jun 27, 2023
ac3c27e
Rename to App Services Usage Samples
clementetb Jun 27, 2023
ea6ac7c
Rename field encryption to property encryption
clementetb Jun 27, 2023
7eeeda0
Add docs to classes
clementetb Jun 27, 2023
37583fc
PR change requests
clementetb Jun 27, 2023
c13e985
No apps available if network is down
clementetb Jun 27, 2023
66b2a15
Merge branch 'ct/field-encryption-sync-examples' into ct/presence-det…
clementetb Jun 27, 2023
9b43478
Add documentation
clementetb Jun 28, 2023
85a6991
Add Surface
clementetb Jun 29, 2023
94ba803
Add main screen
clementetb Jul 4, 2023
128960e
Add logic around entries and connectivity
clementetb Jul 4, 2023
0c97592
Bind error messages
clementetb Jul 4, 2023
baadb07
Error handling with client reset
clementetb Jul 6, 2023
675d219
Add app services app
clementetb Jul 6, 2023
f71283b
Add documentation
clementetb Jul 11, 2023
a0fc5a8
Bind view model lifecycle to activity
clementetb Jul 13, 2023
52f52e1
Merge branch 'ct/field-encryption-sync-examples' into ct/presence-det…
clementetb Jul 13, 2023
79912f7
Bind viewmodel lifecycle to activity
clementetb Jul 13, 2023
a52df45
Merge branch 'ct/presence-detection-sample' into ct/error-handling-sa…
clementetb Jul 14, 2023
907b25f
Clean up
clementetb Jul 14, 2023
dfd842c
Apply suggestions from code review
clementetb Aug 2, 2023
47d0596
Show explicit local connectivity status
clementetb Aug 2, 2023
37d2835
Merge branch 'ct/presence-detection-sample' of ssh://github.com/realm…
clementetb Aug 2, 2023
1a7dd79
Apply suggestions from code review
clementetb Aug 3, 2023
9dcc65d
Show loading
clementetb Aug 3, 2023
bf9c4c4
Enable property encryption app even if online
clementetb Aug 3, 2023
19573fa
Merge branch 'main' into ct/presence-detection-sample
clementetb Aug 3, 2023
1ccf1af
Merge branch 'ct/presence-detection-sample' into ct/error-handling-sa…
clementetb Aug 3, 2023
c869f1d
Merge branch 'main' into ct/error-handling-sample
clementetb Aug 3, 2023
22de647
Merge branch 'ct/error-handling-sample' into ct/offline-mode
clementetb Aug 3, 2023
d12c7c2
Remove non required samples
clementetb Aug 3, 2023
d1a3145
Merge branch 'main' into ct/offline-mode
clementetb Aug 4, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions AppServicesUsageSamples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,19 @@ Reference app that show cases different design patterns and examples of using th

## Samples

### [Property level encryption](apps/property-encryption/README.md)
### [Property level encryption and offline mode](apps/property-encryption/README.md)

This demo shows the process of protecting users' sensitive data by employing end-to-end encryption techniques while guaranteeing access from any user's device.

Additionally, this demo supports offline mode. Users would have always access to the local data after logging in.

### [Presence detection](apps/presence-detection/README.md)

This sample demonstrates user presence detection with App Services.

### [Client reset and error handling](apps/error-handling/README.md)

This demo shows the process of protecting users' sensitive data by employing end-to-end encryption techniques while guaranteeing access from any user's device.
A showcase for the different client reset resolution strategies with an sync error handling example.

## Demo app structure

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,4 @@ package io.realm.appservicesusagesamples
// It is not mandatory to have them all replaced, only the samples to evaluate.
const val PROPERTY_ENCRYPTION_APP_ID = "<insert-app-id>"
const val USER_PRESENCE_APP_ID = "<insert-app-id>"
const val OFFLINE_LOGIN_APP_ID = "<insert-app-id>"
const val ERROR_HANDLING_APP_ID = "<insert-app-id>"
const val BUSINESS_LOGIC_APP_ID = "<insert-app-id>"
const val PURCHASE_VERIFICATION_APP_ID = "<insert-app-id>"
Original file line number Diff line number Diff line change
Expand Up @@ -49,30 +49,9 @@ enum class Demos(
PresenceDetectionActivity::class.java,
)
),
OFFLINE_LOGIN(
appId = OFFLINE_LOGIN_APP_ID,
addView = buttonSelector(
"Offline login",
SampleSelectorActivity::class.java,
)
),
ERROR_HANDLING(
appId = ERROR_HANDLING_APP_ID,
addView = errorHandlingSelector,
),
BUSINESS_LOGIC(
appId = BUSINESS_LOGIC_APP_ID,
addView = buttonSelector(
"Business logic",
SampleSelectorActivity::class.java,
)
),
PURCHASE_VERIFICATION(
appId = PURCHASE_VERIFICATION_APP_ID,
addView = buttonSelector(
"Purchase verification",
SampleSelectorActivity::class.java,
)
);

val qualifier = named(appId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package io.realm.appservicesusagesamples.ui
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import io.realm.appservicesusagesamples.Demos
import io.realm.kotlin.mongodb.App
import io.realm.kotlin.mongodb.exceptions.ConnectionException
import io.realm.kotlin.mongodb.exceptions.ServiceException
Expand Down Expand Up @@ -53,8 +54,15 @@ class SampleSelectorScreenViewModel(private val apps: List<io.realm.appservicesu
}

private suspend fun getDemoEntriesWithStatus() =
apps.map { demoWithApp ->
DemoWithStatus(demoWithApp.first, demoWithApp.second.isAvailable())
apps.map { demoWithApp: Pair<Demos, App> ->
when (demoWithApp.first) {
Demos.PROPERTY_ENCRYPTION -> {
val isAvailable = demoWithApp.second.isAvailable()
val isLoggedIn = demoWithApp.second.currentUser != null
DemoWithStatus(demoWithApp.first, isAvailable || isLoggedIn)
}
else -> DemoWithStatus(demoWithApp.first, demoWithApp.second.isAvailable())
}
}

init {
Expand Down
Loading