-
Notifications
You must be signed in to change notification settings - Fork 2
[CORE-3421] Multi-Factor ID Sync implementation #1306
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
Merged
alexandr-simprints
merged 20 commits into
CORE-3404-search-verify
from
CORE-3421-search-verify-sync-android-implementation
Aug 26, 2025
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
84a0044
WIP [CORE-3421] first steps of adding the external credentials supportˆ
alexandr-simprints 9504059
[WIP] Adding external credentials to the Realm DBˆ
alexandr-simprints f279637
[CORE-3421] Adding external credential support on Domain, DB (Realm, …
alexandr-simprints d61fb62
[CORE-3421] Fixing testsˆ
alexandr-simprints 0660608
[CORE-3421] Fixing testsˆ
alexandr-simprints 5317e06
[CORE-3421] Fixing testsˆ
alexandr-simprints 54f7ddf
[CORE-3421] Fixing testsˆ
alexandr-simprints d806959
[CORE-3421] Fixing testsˆˆ
alexandr-simprints 6aedb12
[CORE-3421] Fixing tests
alexandr-simprints 23a6c01
[CORE-3421] Adding 1->2 Room migrationˆ
alexandr-simprints 7c2c5ff
[CORE-3421] Moving Room DB version to a static field so that it can b…
alexandr-simprints 3036a3a
[CORE-3421] Updating tests
alexandr-simprints f0d359c
[CORE-3421] Removing unused classes
alexandr-simprints e445a48
[CORE-3421] External credentials are now stored as list on the Enrolm…
alexandr-simprints b372abe
[CORE-3421] Moving external credential Realm mapper to its separate file
alexandr-simprints b715b1b
[CORE-3421] EnrolmentRecordMoveEvent now contains external credentialˆ
alexandr-simprints 16e166a
[CORE-3421] Reverting addition of the external credentials in Subject…
alexandr-simprints a3ed7f6
[CORE-3421] Addition of the external credentials back in SubjectBiome…
alexandr-simprints 37d8cb4
[CORE-3421] Fixing tests
alexandr-simprints 05d2a00
[CORE-3421] Adding test coverage for ExternalCredentialType
alexandr-simprints File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
18 changes: 18 additions & 0 deletions
18
...ore/src/main/java/com/simprints/infra/config/store/local/models/ExternalCredentialType.kt
This file contains hidden or 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,18 @@ | ||
| package com.simprints.infra.config.store.local.models | ||
|
|
||
| import com.simprints.core.domain.externalcredential.ExternalCredentialType | ||
| import com.simprints.infra.config.store.exceptions.InvalidProtobufEnumException | ||
|
|
||
| internal fun ExternalCredentialType.toProto(): ProtoExternalCredentialType = when(this){ | ||
| ExternalCredentialType.NHISCard -> ProtoExternalCredentialType.NHIS_CARD | ||
| ExternalCredentialType.GhanaIdCard -> ProtoExternalCredentialType.GHANA_ID_CARD | ||
| ExternalCredentialType.QRCode -> ProtoExternalCredentialType.QR_CODE | ||
| } | ||
|
|
||
| internal fun ProtoExternalCredentialType.toDomain(): ExternalCredentialType = when(this){ | ||
| ProtoExternalCredentialType.UNRECOGNIZED, | ||
| ProtoExternalCredentialType.EXTERNAL_CREDENTIAL_TYPE_UNSPECIFIED -> throw InvalidProtobufEnumException("invalid External credential $name") | ||
| ProtoExternalCredentialType.NHIS_CARD -> ExternalCredentialType.NHISCard | ||
| ProtoExternalCredentialType.GHANA_ID_CARD -> ExternalCredentialType.GhanaIdCard | ||
| ProtoExternalCredentialType.QR_CODE -> ExternalCredentialType.QRCode | ||
| } |
12 changes: 12 additions & 0 deletions
12
...src/main/java/com/simprints/infra/config/store/local/models/MutliFactorIdConfiguration.kt
This file contains hidden or 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,12 @@ | ||
| package com.simprints.infra.config.store.local.models | ||
|
|
||
| import com.simprints.infra.config.store.models.MultiFactorIdConfiguration | ||
|
|
||
| internal fun MultiFactorIdConfiguration.toProto(): ProtoMultiFactorIdConfiguration = ProtoMultiFactorIdConfiguration | ||
| .newBuilder() | ||
| .addAllAllowedExternalCredentials(allowedExternalCredentials.map { it.toProto() }) | ||
| .build() | ||
|
|
||
| internal fun ProtoMultiFactorIdConfiguration.toDomain(): MultiFactorIdConfiguration = MultiFactorIdConfiguration( | ||
| allowedExternalCredentials = allowedExternalCredentialsList.map { it.toDomain() } | ||
| ) |
This file contains hidden or 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
7 changes: 7 additions & 0 deletions
7
...store/src/main/java/com/simprints/infra/config/store/models/MultiFactorIdConfiguration.kt
This file contains hidden or 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,7 @@ | ||
| package com.simprints.infra.config.store.models | ||
|
|
||
| import com.simprints.core.domain.externalcredential.ExternalCredentialType | ||
|
|
||
| data class MultiFactorIdConfiguration( | ||
| val allowedExternalCredentials: List<ExternalCredentialType> | ||
| ) |
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -14,5 +14,6 @@ data class Project( | |
| enum class TokenKeyType { | ||
| AttendantId, | ||
| ModuleId, | ||
| ExternalCredential, | ||
| Unknown, | ||
| } | ||
This file contains hidden or 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
25 changes: 25 additions & 0 deletions
25
...main/java/com/simprints/infra/config/store/remote/models/ApiMultiFactorIdConfiguration.kt
This file contains hidden or 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,25 @@ | ||
| package com.simprints.infra.config.store.remote.models | ||
|
|
||
| import androidx.annotation.Keep | ||
| import com.simprints.core.domain.externalcredential.ExternalCredentialType | ||
| import com.simprints.infra.config.store.models.MultiFactorIdConfiguration | ||
|
|
||
| @Keep | ||
| internal data class ApiMultiFactorIdConfiguration( | ||
| val allowedExternalCredentials: List<ApiExternalCredentialType> | ||
| ) { | ||
| fun toDomain(): MultiFactorIdConfiguration = MultiFactorIdConfiguration( | ||
| allowedExternalCredentials = allowedExternalCredentials.map { it.toDomain() } | ||
| ) | ||
| } | ||
|
|
||
| @Keep | ||
| enum class ApiExternalCredentialType { | ||
| NHISCard, GhanaIdCard, QRCode; | ||
|
|
||
| fun toDomain(): ExternalCredentialType = when (this) { | ||
| NHISCard -> ExternalCredentialType.NHISCard | ||
| GhanaIdCard -> ExternalCredentialType.GhanaIdCard | ||
| QRCode -> ExternalCredentialType.QRCode | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.