Skip to content

Commit b74e6e0

Browse files
committed
fix(WAL-995): support proofs without nonce endpoint
1 parent 6e76e32 commit b74e6e0

12 files changed

Lines changed: 134 additions & 22 deletions

File tree

waltid-applications/waltid-wallet-demo-ios/iosApp/iosAppEnterpriseTests/EnterpriseMobileWalletIntegrationTests.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ final class EnterpriseMobileWalletIntegrationTests: XCTestCase {
7272
bearerToken: $0.bearerToken,
7373
hostHeader: $0.hostHeader
7474
)
75-
}
75+
},
76+
allowInsecureHttpForTests: true
7677
)
7778
)
7879
}

waltid-libraries/protocols/waltid-openid4vc-wallet-mobile/api/waltid-openid4vc-wallet-mobile.klib.api

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,10 @@ sealed interface id.walt.wallet2.mobile/MobileWalletDatabaseKey { // id.walt.wal
160160
}
161161

162162
final class id.walt.wallet2.mobile.swiftinterop/WalletBridgeConfiguration { // id.walt.wallet2.mobile.swiftinterop/WalletBridgeConfiguration|null[0]
163-
constructor <init>(kotlin/String = ..., id.walt.wallet2.mobile/MobileWalletKeyType = ..., id.walt.wallet2.mobile.swiftinterop/WalletBridgePersistence = ..., id.walt.wallet2.mobile.swiftinterop/WalletBridgeDatabaseEncryptionKeyProvider? = ..., id.walt.wallet2.mobile/WalletAttestationConfig? = ..., kotlin.collections/List<id.walt.wallet2.mobile/MobileWalletTransactionDataProfile> = ...) // id.walt.wallet2.mobile.swiftinterop/WalletBridgeConfiguration.<init>|<init>(kotlin.String;id.walt.wallet2.mobile.MobileWalletKeyType;id.walt.wallet2.mobile.swiftinterop.WalletBridgePersistence;id.walt.wallet2.mobile.swiftinterop.WalletBridgeDatabaseEncryptionKeyProvider?;id.walt.wallet2.mobile.WalletAttestationConfig?;kotlin.collections.List<id.walt.wallet2.mobile.MobileWalletTransactionDataProfile>){}[0]
163+
constructor <init>(kotlin/String = ..., id.walt.wallet2.mobile/MobileWalletKeyType = ..., id.walt.wallet2.mobile.swiftinterop/WalletBridgePersistence = ..., id.walt.wallet2.mobile.swiftinterop/WalletBridgeDatabaseEncryptionKeyProvider? = ..., id.walt.wallet2.mobile/WalletAttestationConfig? = ..., kotlin.collections/List<id.walt.wallet2.mobile/MobileWalletTransactionDataProfile> = ..., kotlin/Boolean = ...) // id.walt.wallet2.mobile.swiftinterop/WalletBridgeConfiguration.<init>|<init>(kotlin.String;id.walt.wallet2.mobile.MobileWalletKeyType;id.walt.wallet2.mobile.swiftinterop.WalletBridgePersistence;id.walt.wallet2.mobile.swiftinterop.WalletBridgeDatabaseEncryptionKeyProvider?;id.walt.wallet2.mobile.WalletAttestationConfig?;kotlin.collections.List<id.walt.wallet2.mobile.MobileWalletTransactionDataProfile>;kotlin.Boolean){}[0]
164164

165+
final val allowInsecureHttpForTests // id.walt.wallet2.mobile.swiftinterop/WalletBridgeConfiguration.allowInsecureHttpForTests|{}allowInsecureHttpForTests[0]
166+
final fun <get-allowInsecureHttpForTests>(): kotlin/Boolean // id.walt.wallet2.mobile.swiftinterop/WalletBridgeConfiguration.allowInsecureHttpForTests.<get-allowInsecureHttpForTests>|<get-allowInsecureHttpForTests>(){}[0]
165167
final val attestation // id.walt.wallet2.mobile.swiftinterop/WalletBridgeConfiguration.attestation|{}attestation[0]
166168
final fun <get-attestation>(): id.walt.wallet2.mobile/WalletAttestationConfig? // id.walt.wallet2.mobile.swiftinterop/WalletBridgeConfiguration.attestation.<get-attestation>|<get-attestation>(){}[0]
167169
final val databaseKeyProvider // id.walt.wallet2.mobile.swiftinterop/WalletBridgeConfiguration.databaseKeyProvider|{}databaseKeyProvider[0]
@@ -181,7 +183,8 @@ final class id.walt.wallet2.mobile.swiftinterop/WalletBridgeConfiguration { // i
181183
final fun component4(): id.walt.wallet2.mobile.swiftinterop/WalletBridgeDatabaseEncryptionKeyProvider? // id.walt.wallet2.mobile.swiftinterop/WalletBridgeConfiguration.component4|component4(){}[0]
182184
final fun component5(): id.walt.wallet2.mobile/WalletAttestationConfig? // id.walt.wallet2.mobile.swiftinterop/WalletBridgeConfiguration.component5|component5(){}[0]
183185
final fun component6(): kotlin.collections/List<id.walt.wallet2.mobile/MobileWalletTransactionDataProfile> // id.walt.wallet2.mobile.swiftinterop/WalletBridgeConfiguration.component6|component6(){}[0]
184-
final fun copy(kotlin/String = ..., id.walt.wallet2.mobile/MobileWalletKeyType = ..., id.walt.wallet2.mobile.swiftinterop/WalletBridgePersistence = ..., id.walt.wallet2.mobile.swiftinterop/WalletBridgeDatabaseEncryptionKeyProvider? = ..., id.walt.wallet2.mobile/WalletAttestationConfig? = ..., kotlin.collections/List<id.walt.wallet2.mobile/MobileWalletTransactionDataProfile> = ...): id.walt.wallet2.mobile.swiftinterop/WalletBridgeConfiguration // id.walt.wallet2.mobile.swiftinterop/WalletBridgeConfiguration.copy|copy(kotlin.String;id.walt.wallet2.mobile.MobileWalletKeyType;id.walt.wallet2.mobile.swiftinterop.WalletBridgePersistence;id.walt.wallet2.mobile.swiftinterop.WalletBridgeDatabaseEncryptionKeyProvider?;id.walt.wallet2.mobile.WalletAttestationConfig?;kotlin.collections.List<id.walt.wallet2.mobile.MobileWalletTransactionDataProfile>){}[0]
186+
final fun component7(): kotlin/Boolean // id.walt.wallet2.mobile.swiftinterop/WalletBridgeConfiguration.component7|component7(){}[0]
187+
final fun copy(kotlin/String = ..., id.walt.wallet2.mobile/MobileWalletKeyType = ..., id.walt.wallet2.mobile.swiftinterop/WalletBridgePersistence = ..., id.walt.wallet2.mobile.swiftinterop/WalletBridgeDatabaseEncryptionKeyProvider? = ..., id.walt.wallet2.mobile/WalletAttestationConfig? = ..., kotlin.collections/List<id.walt.wallet2.mobile/MobileWalletTransactionDataProfile> = ..., kotlin/Boolean = ...): id.walt.wallet2.mobile.swiftinterop/WalletBridgeConfiguration // id.walt.wallet2.mobile.swiftinterop/WalletBridgeConfiguration.copy|copy(kotlin.String;id.walt.wallet2.mobile.MobileWalletKeyType;id.walt.wallet2.mobile.swiftinterop.WalletBridgePersistence;id.walt.wallet2.mobile.swiftinterop.WalletBridgeDatabaseEncryptionKeyProvider?;id.walt.wallet2.mobile.WalletAttestationConfig?;kotlin.collections.List<id.walt.wallet2.mobile.MobileWalletTransactionDataProfile>;kotlin.Boolean){}[0]
185188
final fun equals(kotlin/Any?): kotlin/Boolean // id.walt.wallet2.mobile.swiftinterop/WalletBridgeConfiguration.equals|equals(kotlin.Any?){}[0]
186189
final fun hashCode(): kotlin/Int // id.walt.wallet2.mobile.swiftinterop/WalletBridgeConfiguration.hashCode|hashCode(){}[0]
187190
final fun toString(): kotlin/String // id.walt.wallet2.mobile.swiftinterop/WalletBridgeConfiguration.toString|toString(){}[0]
@@ -427,8 +430,10 @@ final class id.walt.wallet2.mobile/MobileWalletBootstrapResult { // id.walt.wall
427430
}
428431

429432
final class id.walt.wallet2.mobile/MobileWalletConfig { // id.walt.wallet2.mobile/MobileWalletConfig|null[0]
430-
constructor <init>(kotlin/String = ..., id.walt.wallet2.mobile/MobileWalletKeyType = ..., id.walt.wallet2.mobile/WalletAttestationConfig? = ..., id.walt.wallet2.mobile/MobileWalletPersistence = ..., kotlin.coroutines/SuspendFunction1<id.walt.wallet2.mobile/MobileWalletEvent, kotlin/Unit> = ..., kotlin.collections/List<id.walt.wallet2.mobile/MobileWalletTransactionDataProfile> = ...) // id.walt.wallet2.mobile/MobileWalletConfig.<init>|<init>(kotlin.String;id.walt.wallet2.mobile.MobileWalletKeyType;id.walt.wallet2.mobile.WalletAttestationConfig?;id.walt.wallet2.mobile.MobileWalletPersistence;kotlin.coroutines.SuspendFunction1<id.walt.wallet2.mobile.MobileWalletEvent,kotlin.Unit>;kotlin.collections.List<id.walt.wallet2.mobile.MobileWalletTransactionDataProfile>){}[0]
433+
constructor <init>(kotlin/String = ..., id.walt.wallet2.mobile/MobileWalletKeyType = ..., id.walt.wallet2.mobile/WalletAttestationConfig? = ..., id.walt.wallet2.mobile/MobileWalletPersistence = ..., kotlin.coroutines/SuspendFunction1<id.walt.wallet2.mobile/MobileWalletEvent, kotlin/Unit> = ..., kotlin.collections/List<id.walt.wallet2.mobile/MobileWalletTransactionDataProfile> = ..., kotlin/Boolean = ...) // id.walt.wallet2.mobile/MobileWalletConfig.<init>|<init>(kotlin.String;id.walt.wallet2.mobile.MobileWalletKeyType;id.walt.wallet2.mobile.WalletAttestationConfig?;id.walt.wallet2.mobile.MobileWalletPersistence;kotlin.coroutines.SuspendFunction1<id.walt.wallet2.mobile.MobileWalletEvent,kotlin.Unit>;kotlin.collections.List<id.walt.wallet2.mobile.MobileWalletTransactionDataProfile>;kotlin.Boolean){}[0]
431434

435+
final val allowInsecureHttpForTests // id.walt.wallet2.mobile/MobileWalletConfig.allowInsecureHttpForTests|{}allowInsecureHttpForTests[0]
436+
final fun <get-allowInsecureHttpForTests>(): kotlin/Boolean // id.walt.wallet2.mobile/MobileWalletConfig.allowInsecureHttpForTests.<get-allowInsecureHttpForTests>|<get-allowInsecureHttpForTests>(){}[0]
432437
final val attestationConfig // id.walt.wallet2.mobile/MobileWalletConfig.attestationConfig|{}attestationConfig[0]
433438
final fun <get-attestationConfig>(): id.walt.wallet2.mobile/WalletAttestationConfig? // id.walt.wallet2.mobile/MobileWalletConfig.attestationConfig.<get-attestationConfig>|<get-attestationConfig>(){}[0]
434439
final val defaultKeyType // id.walt.wallet2.mobile/MobileWalletConfig.defaultKeyType|{}defaultKeyType[0]
@@ -448,7 +453,8 @@ final class id.walt.wallet2.mobile/MobileWalletConfig { // id.walt.wallet2.mobil
448453
final fun component4(): id.walt.wallet2.mobile/MobileWalletPersistence // id.walt.wallet2.mobile/MobileWalletConfig.component4|component4(){}[0]
449454
final fun component5(): kotlin.coroutines/SuspendFunction1<id.walt.wallet2.mobile/MobileWalletEvent, kotlin/Unit> // id.walt.wallet2.mobile/MobileWalletConfig.component5|component5(){}[0]
450455
final fun component6(): kotlin.collections/List<id.walt.wallet2.mobile/MobileWalletTransactionDataProfile> // id.walt.wallet2.mobile/MobileWalletConfig.component6|component6(){}[0]
451-
final fun copy(kotlin/String = ..., id.walt.wallet2.mobile/MobileWalletKeyType = ..., id.walt.wallet2.mobile/WalletAttestationConfig? = ..., id.walt.wallet2.mobile/MobileWalletPersistence = ..., kotlin.coroutines/SuspendFunction1<id.walt.wallet2.mobile/MobileWalletEvent, kotlin/Unit> = ..., kotlin.collections/List<id.walt.wallet2.mobile/MobileWalletTransactionDataProfile> = ...): id.walt.wallet2.mobile/MobileWalletConfig // id.walt.wallet2.mobile/MobileWalletConfig.copy|copy(kotlin.String;id.walt.wallet2.mobile.MobileWalletKeyType;id.walt.wallet2.mobile.WalletAttestationConfig?;id.walt.wallet2.mobile.MobileWalletPersistence;kotlin.coroutines.SuspendFunction1<id.walt.wallet2.mobile.MobileWalletEvent,kotlin.Unit>;kotlin.collections.List<id.walt.wallet2.mobile.MobileWalletTransactionDataProfile>){}[0]
456+
final fun component7(): kotlin/Boolean // id.walt.wallet2.mobile/MobileWalletConfig.component7|component7(){}[0]
457+
final fun copy(kotlin/String = ..., id.walt.wallet2.mobile/MobileWalletKeyType = ..., id.walt.wallet2.mobile/WalletAttestationConfig? = ..., id.walt.wallet2.mobile/MobileWalletPersistence = ..., kotlin.coroutines/SuspendFunction1<id.walt.wallet2.mobile/MobileWalletEvent, kotlin/Unit> = ..., kotlin.collections/List<id.walt.wallet2.mobile/MobileWalletTransactionDataProfile> = ..., kotlin/Boolean = ...): id.walt.wallet2.mobile/MobileWalletConfig // id.walt.wallet2.mobile/MobileWalletConfig.copy|copy(kotlin.String;id.walt.wallet2.mobile.MobileWalletKeyType;id.walt.wallet2.mobile.WalletAttestationConfig?;id.walt.wallet2.mobile.MobileWalletPersistence;kotlin.coroutines.SuspendFunction1<id.walt.wallet2.mobile.MobileWalletEvent,kotlin.Unit>;kotlin.collections.List<id.walt.wallet2.mobile.MobileWalletTransactionDataProfile>;kotlin.Boolean){}[0]
452458
final fun equals(kotlin/Any?): kotlin/Boolean // id.walt.wallet2.mobile/MobileWalletConfig.equals|equals(kotlin.Any?){}[0]
453459
final fun hashCode(): kotlin/Int // id.walt.wallet2.mobile/MobileWalletConfig.hashCode|hashCode(){}[0]
454460
final fun toString(): kotlin/String // id.walt.wallet2.mobile/MobileWalletConfig.toString|toString(){}[0]

waltid-libraries/protocols/waltid-openid4vc-wallet-mobile/src/androidDeviceTest/kotlin/id/walt/wallet2/mobile/test/EnterpriseMobileWalletIntegrationTest.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ class EnterpriseMobileWalletIntegrationTest {
153153
config = MobileWalletConfig(
154154
walletId = walletId,
155155
attestationConfig = attestation?.toWalletAttestationConfig(),
156+
allowInsecureHttpForTests = true,
156157
onEvent = { event -> println("WALLET EVENT: $event") },
157158
),
158159
httpClient = enterpriseHttpClient(),

waltid-libraries/protocols/waltid-openid4vc-wallet-mobile/src/commonMain/kotlin/id/walt/wallet2/mobile/MobileWallet.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ public class MobileWallet internal constructor(
139139
attestationConfig: WalletAttestationConfig? = null,
140140
private val httpClient: HttpClient? = null,
141141
private val transactionDataProfiles: List<MobileWalletTransactionDataProfile> = emptyList(),
142+
private val allowInsecureHttpForTests: Boolean = false,
142143
private val onEvent: suspend (MobileWalletEvent) -> Unit = {},
143144
private val deleteLocalPersistence: suspend () -> Unit = {},
144145
) {
@@ -180,6 +181,7 @@ public class MobileWallet internal constructor(
180181
wallet = wallet,
181182
attestationAssembler = attestationAssembler,
182183
onEvent = ::emitSessionEvent,
184+
allowInsecureHttpForTests = allowInsecureHttpForTests,
183185
)
184186

185187
/**

waltid-libraries/protocols/waltid-openid4vc-wallet-mobile/src/commonMain/kotlin/id/walt/wallet2/mobile/MobileWalletFactory.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import io.ktor.client.HttpClient
2525
* @property persistence Persistence mode used for wallet-local state.
2626
* @property onEvent Optional callback for observing wallet issuance and presentation session events.
2727
* @property transactionDataProfiles Transaction data profiles this mobile wallet accepts in OpenID4VP requests.
28+
* @property allowInsecureHttpForTests Test/dev-only opt-in for local issuer nonce endpoints that cannot use HTTPS.
2829
*/
2930
public data class MobileWalletConfig(
3031
public val walletId: String = "default",
@@ -33,6 +34,7 @@ public data class MobileWalletConfig(
3334
public val persistence: MobileWalletPersistence = MobileWalletPersistence(),
3435
public val onEvent: suspend (MobileWalletEvent) -> Unit = {},
3536
public val transactionDataProfiles: List<MobileWalletTransactionDataProfile> = emptyList(),
37+
public val allowInsecureHttpForTests: Boolean = false,
3638
)
3739

3840
/**
@@ -191,6 +193,7 @@ private fun createSqlDelightMobileWallet(
191193
attestationConfig = config.attestationConfig,
192194
httpClient = httpClient,
193195
transactionDataProfiles = config.transactionDataProfiles,
196+
allowInsecureHttpForTests = config.allowInsecureHttpForTests,
194197
onEvent = config.onEvent,
195198
deleteLocalPersistence = deleteLocalPersistence,
196199
)

waltid-libraries/protocols/waltid-openid4vc-wallet-mobile/src/commonTest/kotlin/id/walt/wallet2/mobile/MobileWalletTest.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ class MobileWalletTest {
4646
assertEquals(null, config.attestationConfig)
4747
assertEquals(MobileWalletPersistence(), config.persistence)
4848
assertEquals(emptyList(), config.transactionDataProfiles)
49+
assertFalse(config.allowInsecureHttpForTests)
4950
assertIs<MobileWalletDatabaseKey.Managed>(config.persistence.databaseKey)
5051
assertEquals(MobileWalletStores(), config.persistence.stores)
5152
}

waltid-libraries/protocols/waltid-openid4vc-wallet-mobile/src/iosMain/kotlin/id/walt/wallet2/mobile/swiftinterop/WalletSdkBridgeModels.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ import kotlin.time.Instant
4343
* [WalletBridgeDatabaseKeyConfiguration.Provided].
4444
* @property attestation Optional client-attestation configuration for issuers that require it.
4545
* @property transactionDataProfiles Transaction data profiles this wallet accepts.
46+
* @property allowInsecureHttpForTests Test/dev-only opt-in for local issuer nonce endpoints that cannot use HTTPS.
4647
*/
4748
public data class WalletBridgeConfiguration(
4849
public val walletId: String = "default",
@@ -51,6 +52,7 @@ public data class WalletBridgeConfiguration(
5152
public val databaseKeyProvider: WalletBridgeDatabaseEncryptionKeyProvider? = null,
5253
public val attestation: WalletAttestationConfig? = null,
5354
public val transactionDataProfiles: List<MobileWalletTransactionDataProfile> = emptyList(),
55+
public val allowInsecureHttpForTests: Boolean = false,
5456
)
5557

5658
internal fun WalletBridgeConfiguration.toMobileWalletConfig() = MobileWalletConfig(
@@ -59,6 +61,7 @@ internal fun WalletBridgeConfiguration.toMobileWalletConfig() = MobileWalletConf
5961
attestationConfig = attestation,
6062
persistence = persistence.toMobileWalletPersistence(databaseKeyProvider),
6163
transactionDataProfiles = transactionDataProfiles,
64+
allowInsecureHttpForTests = allowInsecureHttpForTests,
6265
)
6366

6467
/**

waltid-libraries/protocols/waltid-openid4vc-wallet-mobile/src/iosTest/kotlin/id/walt/wallet2/mobile/swiftinterop/WalletSdkBridgeTest.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@ class WalletSdkBridgeTest {
271271
fields = listOf("amount"),
272272
)
273273
),
274+
allowInsecureHttpForTests = true,
274275
)
275276
)
276277

@@ -285,6 +286,7 @@ class WalletSdkBridgeTest {
285286
assertEquals("/wallet-attestation", capturedConfig?.attestationConfig?.attesterPath)
286287
assertEquals("token", capturedConfig?.attestationConfig?.bearerToken)
287288
assertEquals("attestation.example", capturedConfig?.attestationConfig?.hostHeader)
289+
assertEquals(true, capturedConfig?.allowInsecureHttpForTests)
288290
assertEquals(
289291
listOf(
290292
MobileWalletTransactionDataProfile(
@@ -524,6 +526,7 @@ class WalletSdkBridgeTest {
524526
assertEquals(null, config.attestationConfig)
525527
assertEquals(MobileWalletPersistence(), config.persistence)
526528
assertEquals(emptyList(), config.transactionDataProfiles)
529+
assertEquals(false, config.allowInsecureHttpForTests)
527530
}
528531

529532
@Test

0 commit comments

Comments
 (0)