Skip to content

Require explicit data element requests for ISO 18013-5 transactions. - #1982

Merged
davidz25 merged 1 commit into
mainfrom
transaction-require-de
Sep 5, 2026
Merged

Require explicit data element requests for ISO 18013-5 transactions.#1982
davidz25 merged 1 commit into
mainfrom
transaction-require-de

Conversation

@davidz25

@davidz25 davidz25 commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

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

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>
@davidz25
davidz25 merged commit 6196823 into main Sep 5, 2026
4 checks passed
@davidz25
davidz25 deleted the transaction-require-de branch September 5, 2026 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rework transaction data architecture across protocols and formats.

1 participant