Require explicit data element requests for ISO 18013-5 transactions. - #1982
Merged
Conversation
Transactions in ISO/IEC 18013-5 are requested via data elements under the "org.iso.transactiondata" namespace. Previously, builder helpers automatically populated this namespace for any transaction payload provided in `DocRequestInfo.transactionData`, and `DocRequest` parsed all transaction payloads irrespective of whether they were requested. Additionally, `TransactionData` and `TransactionType.parseCbor()` carried an unnecessary `intentToRetain` property, which belongs strictly to requested claims rather than the transaction payload itself. Refactor ISO 18013-5 transaction handling: - Require explicit requests for transaction data elements in `DocRequest` namespaces or alternative data elements, removing auto-population in `DeviceRequest.Builder.addDocRequest()`. - Update `DocRequest.getTransactionData()` to only parse transactions requested by data elements. - In `DeviceRequest.findBestMatchingClaims()`, resolve transaction claims and alternative options by checking `isApplicable()`, and populate `DocRequestMatch.transactionData` for the selected permutation. - In `DeviceResponse.verify()`, filter expected transactions to those actually returned by the device when alternative data elements are used. - For DCQL conversions: omit transaction data elements in `DeviceRequest.toDcql()`, and in `buildDeviceRequestFromDcql()` automatically request all transactions with a configurable `defaultIntentToRetain` defaulting to false. - Remove `intentToRetain` from `TransactionData` and `TransactionType.parseCbor()`. - Support `keyAuthorizedDataElements` in `DocumentStoreTestHarness`. - Add test scenarios in `Iso18013TestTransactionData` and DCQL conversion tests in `DeviceRequestDcqlConversionsTest`. Fixes #1980. Test: Ran ./gradlew :multipaz:jvmTest Test: Ran ./gradlew :multipaz:assemble Test: Ran ./gradlew detekt Signed-off-by: David Zeuthen <zeuthen@gmail.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Transactions in ISO/IEC 18013-5 are requested via data elements under the "org.iso.transactiondata" namespace. Previously, builder helpers automatically populated this namespace for any transaction payload provided in
DocRequestInfo.transactionData, andDocRequestparsed all transaction payloads irrespective of whether they were requested. Additionally,TransactionDataandTransactionType.parseCbor()carried an unnecessaryintentToRetainproperty, which belongs strictly to requested claims rather than the transaction payload itself.Refactor ISO 18013-5 transaction handling:
DocRequestnamespaces or alternative data elements, removing auto-population inDeviceRequest.Builder.addDocRequest().DocRequest.getTransactionData()to only parse transactions requested by data elements.DeviceRequest.findBestMatchingClaims(), resolve transaction claims and alternative options by checkingisApplicable(), and populateDocRequestMatch.transactionDatafor the selected permutation.DeviceResponse.verify(), filter expected transactions to those actually returned by the device when alternative data elements are used.DeviceRequest.toDcql(), and inbuildDeviceRequestFromDcql()automatically request all transactions with a configurabledefaultIntentToRetaindefaulting to false.intentToRetainfromTransactionDataandTransactionType.parseCbor().keyAuthorizedDataElementsinDocumentStoreTestHarness.Iso18013TestTransactionDataand DCQL conversion tests inDeviceRequestDcqlConversionsTest.Fixes #1980.
Test: Ran ./gradlew :multipaz:jvmTest
Test: Ran ./gradlew :multipaz:assemble
Test: Ran ./gradlew detekt