[MS-1346] Identification response now contains scanned external credential data#1591
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request adds scannedCredential information to identification responses, enabling calling applications to receive data about external credentials (such as NHIS cards) that were scanned during the identification workflow. The change extends the identification response to include the credential type and value.
Changes:
- Added
scannedCredentialfield to identification response data models (AppIdentifyResponse and ActionResponse.IdentifyActionResponse) - Implemented credential extraction and mapping logic in CreateIdentifyResponseUseCase
- Updated response mappers to serialize scannedCredential to JSON in client API responses
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| infra/orchestrator-data/src/main/java/com/simprints/infra/orchestration/data/responses/AppIdentifyResponse.kt | Added nullable scannedCredential field to AppIdentifyResponse data class |
| infra/orchestrator-data/src/main/java/com/simprints/infra/orchestration/data/ActionResponse.kt | Added nullable scannedCredential field to IdentifyActionResponse data class |
| feature/orchestrator/src/main/java/com/simprints/feature/orchestrator/usecases/response/CreateIdentifyResponseUseCase.kt | Implemented logic to extract ExternalCredentialSearchResult and map scannedCredential to AppExternalCredential |
| feature/orchestrator/src/main/java/com/simprints/feature/orchestrator/usecases/MapRefusalOrErrorResultUseCase.kt | Updated error response creation to include null scannedCredential |
| feature/client-api/src/main/java/com/simprints/feature/clientapi/mappers/response/LibSimprintsResponseMapper.kt | Added conditional serialization of scannedCredential (only when multi-factor ID is enabled) |
| feature/client-api/src/main/java/com/simprints/feature/clientapi/ClientApiViewModel.kt | Updated to pass scannedCredential from identifyResponse to ActionResponse |
|
| ) | ||
| } | ||
| } | ||
| }.appendExternalCredential(response.scannedCredential.takeIf { response.isMultiFactorIdEnabled }) |
There was a problem hiding this comment.
Isn't the takeIf kinda redundant here?
There was a problem hiding this comment.
I thought about it as well, but this approach seems less error-prone if we ever want to change the logic of the returned credential
…ntial data (#1591) * [MS-1346] Identificaiton response now contains scanned external credential data * [MS-1346] Renaming variables to be more consistent * [MS-1346] Fixing tests * [MS-1346] Fixing tests, removing unnecessary variables * [MS-1346] Fixing tests * [MS-1346] Fixing tests * [MS-1346] Adding test coverage for credential response in Identification response (cherry picked from commit b12990e) # Conflicts: # feature/orchestrator/src/main/java/com/simprints/feature/orchestrator/usecases/response/CreateIdentifyResponseUseCase.kt
…ntial data (#1591) * [MS-1346] Identificaiton response now contains scanned external credential data * [MS-1346] Renaming variables to be more consistent * [MS-1346] Fixing tests * [MS-1346] Fixing tests, removing unnecessary variables * [MS-1346] Fixing tests * [MS-1346] Fixing tests * [MS-1346] Adding test coverage for credential response in Identification response (cherry picked from commit b12990e)



JIRA ticket
Will be released in: 2025.4.1
Notable changes
Identification responses now include a
scannedCredentialobject that contains information on the credential scanned during the ID workflow: value and type.Response example:
Testing guidance
Custom Intentpage in the Intent Launcher appscannedCredentialfield is present in the responseAdditional work checklist