feat: Swift and Kotlin credential storage tests#271
Conversation
kotlin/walletkit/src/main/kotlin/org/world/walletkit/storage/AndroidAtomicBlobStore.kt
Show resolved
Hide resolved
kotlin/walletkit/src/main/kotlin/org/world/walletkit/storage/AndroidAtomicBlobStore.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| using: key, | ||
| authenticating: associatedData | ||
| ) | ||
| } |
There was a problem hiding this comment.
Swift keystore methods don't wrap CryptoKit errors
High Severity
IOSDeviceKeystore.seal and openSealed let CryptoKit errors propagate unwrapped, unlike the Kotlin AndroidDeviceKeystore which catches all exceptions and wraps them in StorageException.Keystore. The Rust DeviceKeystore trait returns StorageResult, so UniFFI converts unrecognized Swift errors into StorageError::UnexpectedUniFFICallbackError instead of StorageError::Keystore. Rust code that pattern-matches on the Keystore variant (e.g., in keys.rs) will fail to handle these errors correctly.


Note
High Risk
Adds new persistent storage and device-keystore implementations (AndroidKeyStore/Keychain + atomic file writes) that are security- and data-integrity-sensitive and may be used by production callers.
Overview
Adds mobile storage primitives for WalletKit:
AndroidDeviceKeystore(AndroidKeyStore AES-GCM),AndroidAtomicBlobStore(atomic file writes), andAndroidStorageProvider/WalletKitStorage.defaultProvider, plus Swift equivalentsIOSDeviceKeystore(Keychain-stored AES-GCM key with entitlement fallback),IOSAtomicBlobStore, andIOSStorageProvider/WalletKitStorage.makeDefaultProvider.Adds new Swift and Kotlin test suites validating
CredentialStoreinitialization requirements, credential persistence + Merkle cache TTL behavior across reopen, andDeviceKeystoreseal/open behavior; also renamesSimpleTesttoLoggingTestsand increases log-bridge wait time. Updatesswift/test_swift.shto clear staged Swift sources and copy new local support files into the test package before running.Written by Cursor Bugbot for commit 089d20b. This will update automatically on new commits. Configure here.