-
Notifications
You must be signed in to change notification settings - Fork 120
Add W3C DC API support for iOS. #1488
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
Conversation
3897ba9 to
022cbf1
Compare
| // DocumentProviderExtension | ||
| // | ||
| // Created by David Zeuthen on 10/8/25. | ||
| // Copyright © 2025 orgName. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Copyright © 2025 orgName" does not sound right ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
koukarine
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, with minor concerns noted.
multipaz/src/iosMain/kotlin/org/multipaz/mdoc/transport/request/Iso18013DocumentRequest.kt
Show resolved
Hide resolved
multipaz/src/iosMain/kotlin/org/multipaz/mdoc/transport/request/Iso18013DocumentRequestSet.kt
Show resolved
Hide resolved
multipaz/src/iosMain/kotlin/org/multipaz/mdoc/transport/request/Iso18013ElementInfo.kt
Show resolved
Hide resolved
multipaz/src/iosMain/kotlin/org/multipaz/mdoc/transport/request/Iso18013PresentmentRequest.kt
Show resolved
Hide resolved
multipaz/src/iosMain/kotlin/org/multipaz/mdoc/transport/request/Iso18013Request.kt
Show resolved
Hide resolved
samples/testapp/src/androidMain/kotlin/org/multipaz/testapp/TestAppConfiguration.android.kt
Show resolved
Hide resolved
samples/testapp/src/commonMain/kotlin/org/multipaz/testapp/ui/DocumentStoreScreen.kt
Show resolved
Hide resolved
samples/testapp/src/iosMain/kotlin/org/multipaz/testapp/TestAppConfiguration.ios.kt
Outdated
Show resolved
Hide resolved
samples/testapp/src/wasmJsMain/kotlin/org/multipaz/testapp/TestAppConfiguration.wasmJs.kt
Outdated
Show resolved
Hide resolved
| ) | ||
| } | ||
|
|
||
| override suspend fun getTable(spec: StorageTableSpec): StorageTable = sqliteStorage.getTable(spec) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not quite right, as for the table that is returned table.storage is not going to be this. Maybe just make SqliteStorage open?
May be a duplicate comment? Somehow I do not see my original one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch. Fixing.
This uses the W3C Digital Credentials API available in iOS 26.0 and later to implement the existing `DigitalCredentials` interface in Multipaz which is already implemented on Android. This also adds a new `multipaz-swift` library which contains Swift and SwiftUI code for using the bindings on iOS. This is equivalent to `multipaz-compose` and for example contains a `DocumentModel` object that works with native Swift and SwiftUI mechanisms and also a `Consent` view which for consent prompts entirely implemented using SwiftUI. Crucially, it also contains `RequestAuthorizationView` which can be used to implement [IdentityDocumentProvider](https://developer.apple.com/documentation/IdentityDocumentServices/Implenting-as-an-identity-document-provider) according to Apple's guidelines for making an application an identity document provider. Update Multipaz Test App to use all this new machinery. Since the Identity Document Provider runs as an extension, make Test App to use [app groups](https://developer.apple.com/documentation/Xcode/configuring-app-groups) for storage so the main app and the identity document provider extension can share data. This work includes introducing `IosStorage`. Update our verifier to use ReaderAuthAll and UseCases since iOS 26.0 depends on this. Also change the default protocol to be Annex C instead of OpenID4VP 1.0. Rename `Platform` to `TestAppConfiguration` in testapp since this is more succinct and also avoids name clash with the `Platform` expect/actual object in Multipaz. Rename `CredentialPresentmentModalBottomSheet` in multipaz-compose to `ConsentModalBottomSheet` and factor out the main functionality into a `Consent` composable. (This work stems from an unsuccesful attempt to use Compose Multiplatform in the document provider extension. This ended up not working because the extension is limited to 120 MB of RAM usage and Compose pushes it to that limit when using the `Consent` composable. We ended up just implementing the consent prompt in SwiftUI instead.) Update README.md to mention new libraries and fix existing text to match what's in the repo today. Some work is still needed in the SwiftUI consent prompt but it's good enough for now with simple requests. Fixes #1364. See https://www.youtube.com/watch?v=x5gWl-sqjfo for a demo. Test: Unit tests pass. Test: Manually tested Test App on iOS and Android. Signed-off-by: David Zeuthen <zeuthen@google.com>
022cbf1 to
9d2758e
Compare
This uses the W3C Digital Credentials API available in iOS 26.0 and later to implement the existing
DigitalCredentialsinterface in Multipaz which is already implemented on Android.This also adds a new
multipaz-swiftlibrary which contains Swift and SwiftUI code for using the bindings on iOS. This is equivalent tomultipaz-composeand for example contains aDocumentModelobject that works with native Swift and SwiftUI mechanisms and also aConsentview which for consent prompts entirely implemented using SwiftUI. Crucially, it also containsRequestAuthorizationViewwhich can be used to implement IdentityDocumentProvider according to Apple's guidelines for making an application an identity document provider.Update Multipaz Test App to use all this new machinery. Since the Identity Document Provider runs as an extension, make Test App to use app groups for storage so the main app and the identity document provider extension can share data. This work includes introducing
IosStorage.Update our verifier to use ReaderAuthAll and UseCases since iOS 26.0 depends on this. Also change the default protocol to be Annex C instead of OpenID4VP 1.0.
Rename
PlatformtoTestAppConfigurationin testapp since this is more succinct and also avoids name clash with thePlatformexpect/actual object in Multipaz.Rename
CredentialPresentmentModalBottomSheetin multipaz-compose toConsentModalBottomSheetand factor out the main functionality into aConsentcomposable. (This work stems from an unsuccesful attempt to use Compose Multiplatform in the document provider extension. This ended up not working because the extension is limited to 120 MB of RAM usage and Compose pushes it to that limit when using theConsentcomposable. We ended up just implementing the consent prompt in SwiftUI instead.)Update README.md to mention new libraries and fix existing text to match what's in the repo today.
Some work is still needed in the SwiftUI consent prompt but it's good enough for now with simple requests.
Fixes #1364.
See https://www.youtube.com/watch?v=x5gWl-sqjfo for a demo.
Test: Unit tests pass.
Test: Manually tested Test App on iOS and Android.