Skip to content

Refuse to approve transaction data that no renderer can show - #2225

Draft
TheBlackBit wants to merge 1 commit into
openwallet-foundation:mainfrom
TheBlackBit:feat/transaction-renderer-requirement
Draft

TheBlackBit wants to merge 1 commit into
openwallet-foundation:mainfrom
TheBlackBit:feat/transaction-renderer-requirement

Conversation

@TheBlackBit

@TheBlackBit TheBlackBit commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Part of #2010

No-Issue: part of #2010, which #2196 closes

Why

The built-in consent screen shows transaction data only as a heading. For some types that is not enough: the person has to read the data to give informed consent, for example a spending permission with limits. With no renderer for such a type, the data would be approved without being shown.

This PR lets a type say that its data must be shown by a renderer, and makes the prompt refuse when it can't be. It is generic: no type sets it yet, and every existing type keeps the built-in screen. The first user is the AP2 type in #2178.

Split out of the same work as #2224, which has the SD-JWT hooks. The two don't depend on each other.

What changes

  • TransactionType.requiresRenderer, false by default. A type that sets it is never approved with the built-in screen.
  • requestConsent() throws TransactionDataRendererNotAvailableException, naming the type, before showing anything, when such a type has no renderer in the repository or no repository was passed.
  • The Compose and SwiftUI consent dialogs refuse the same way when the renderer found is made for the other toolkit. missingTransactionDataRenderer() holds the shared check and takes what the toolkit can draw.
  • The public Compose and SwiftUI Consent views, which ConsentModalBottomSheet and RequestAuthorizationView draw directly, refuse the same way: they draw nothing, log the type's identifier and call onCancel.
  • PresentmentData.allTransactionData lists every transaction data item, so a prompt knows which renderers it needs before it is shown.

The dialogs and Consent views are only affected when a type sets requiresRenderer. For every other request the check finds nothing and they behave as before.

Testing

  • ./gradlew :multipaz:jvmTest: 1885 tests, 0 failures, including the new TransactionDataRendererRequirementTest.

  • :multipaz-compose:testDebugUnitTest with the new ConsentRequiresRendererTest (Consent and requestConsent() refuse; both tests fail when their guard is removed, checked by removing it) and ConsentGoldenScreenshotTest. detektMetadataCommonMain passes.

  • :multipaz-compose:compileKotlinIosSimulatorArm64, :multipaz:compileTestKotlinIosSimulatorArm64 and :multipaz-compose:compileDebugKotlinAndroid pass.

  • xcodebuild -project samples/SwiftTestApp/SwiftTestApp.xcodeproj -scheme SwiftTestApp -sdk iphonesimulator build succeeds, compiling the SwiftUI guards.

  • Not verified: the guards on screen. No type sets requiresRenderer yet, so none draws a refusal.

  • Tests pass

  • Appropriate changes to README are included in PR (none needed)

The built-in consent rendering of transaction data shows only a heading.
For a type whose data the person must read to give informed consent, such
as a spending permission, that is not enough: it would be approved blind.
Let such a type say so, and refuse the prompt when it cannot be drawn.

- `TransactionType.requiresRenderer`, default `false`, says a type's data
  must be shown by a renderer made for the UI toolkit in use. Existing
  types are unchanged.
- `requestConsent()` throws `TransactionDataRendererNotAvailableException`,
  naming the type, before showing anything when the transaction data holds
  such a type and no renderer is registered for it or no repository was
  passed.
- The Compose and SwiftUI consent dialogs refuse the same way when the
  registered renderer is made for the other toolkit, which counts as no
  renderer. `missingTransactionDataRenderer()` holds the shared check and
  takes what the toolkit can draw.
- The public Compose and SwiftUI `Consent` views, which
  `RequestAuthorizationView` and `ConsentModalBottomSheet` draw directly,
  refuse the same way: they draw nothing, log the type's identifier and
  call `onCancel`.
- `PresentmentData.allTransactionData` lists every item of every match, so
  a prompt can find out which renderers it needs before it is shown.

Test: ./gradlew :multipaz:jvmTest (1885 tests, 0 failures), including the
new TransactionDataRendererRequirementTest; ./gradlew
:multipaz-compose:testDebugUnitTest --tests
org.multipaz.compose.presentment.ConsentRequiresRendererTest (refusal by
`Consent` and `requestConsent()`, which fail when those guards are
removed) and --tests
org.multipaz.compose.presentment.ConsentGoldenScreenshotTest;
./gradlew :multipaz-compose:compileKotlinIosSimulatorArm64
:multipaz:compileTestKotlinIosSimulatorArm64
:multipaz-compose:compileDebugKotlinAndroid detektMetadataCommonMain;
xcodebuild -project samples/SwiftTestApp/SwiftTestApp.xcodeproj -scheme
SwiftTestApp -sdk iphonesimulator build succeeds, compiling the SwiftUI
guards. The SwiftUI guards are not exercised, as no type sets
requiresRenderer yet.

Signed-off-by: Ever Morales <ever.morales@koombea.com>
@TheBlackBit
TheBlackBit force-pushed the feat/transaction-renderer-requirement branch from 7bc6133 to 98128ac Compare November 21, 2026 01:06

This branch has not been deployed

No deployments
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.

1 participant