diff --git a/modules/openid-federation-client/build.gradle.kts b/modules/openid-federation-client/build.gradle.kts index 600eb450..cab103b5 100644 --- a/modules/openid-federation-client/build.gradle.kts +++ b/modules/openid-federation-client/build.gradle.kts @@ -2,11 +2,10 @@ import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackConfig plugins { alias(libs.plugins.kotlinMultiplatform) -// alias(libs.plugins.androidLibrary) kotlin("plugin.serialization") version "2.0.0" } -val ktorVersion = "3.0.0-beta-2" +val ktorVersion = "2.3.12" repositories { mavenCentral() @@ -34,19 +33,6 @@ kotlin { } } - // wasmJs is not available yet for ktor until v3.x is released which is still in alpha - -// androidTarget { -// @OptIn(ExperimentalKotlinGradlePluginApi::class) -// compilerOptions { -// jvmTarget.set(JvmTarget.JVM_11) -// } -// } - -// iosX64() -// iosArm64() -// iosSimulatorArm64() - sourceSets { all { @@ -91,50 +77,6 @@ kotlin { implementation("com.nimbusds:nimbus-jose-jwt:9.40") } } -// TODO Should be placed back at a later point in time: https://sphereon.atlassian.net/browse/OIDF-50 -// val androidMain by getting { -// dependencies { -// implementation("io.ktor:ktor-client-core-jvm:$ktorVersion") -// implementation("io.ktor:ktor-client-cio-jvm:$ktorVersion") -// } -// } -// val androidUnitTest by getting { -// dependencies { -// implementation(kotlin("test-junit")) -// } -// } - -// val iosMain by creating { -// dependsOn(commonMain) -// } -// val iosX64Main by getting { -// dependsOn(iosMain) -// dependencies { -// implementation("io.ktor:ktor-client-core-iosx64:$ktorVersion") -// implementation("io.ktor:ktor-client-cio-iosx64:$ktorVersion") -// } -// } -// val iosArm64Main by getting { -// dependsOn(iosMain) -// dependencies { -// implementation("io.ktor:ktor-client-core-iosarm64:$ktorVersion") -// implementation("io.ktor:ktor-client-cio-iosarm64:$ktorVersion") -// } -// } -// val iosSimulatorArm64Main by getting { -// dependsOn(iosMain) -// dependencies { -// implementation("io.ktor:ktor-client-core-iossimulatorarm64:$ktorVersion") -// implementation("io.ktor:ktor-client-cio-iossimulatorarm64:$ktorVersion") -// } -// } -// -// val iosTest by creating { -// dependsOn(commonTest) -// dependencies { -// implementation(kotlin("test")) -// } -// } val jsMain by getting { dependencies { @@ -152,27 +94,9 @@ kotlin { implementation(kotlin("test-js")) implementation(npm("jose", "5.6.3")) implementation(kotlin("test-annotations-common")) + implementation("io.ktor:ktor-client-mock-js:$ktorVersion") implementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.9.0-RC") } } } } - -//tasks.register("printSdkLocation") { -// doLast { -// println("Android SDK Location: ${android.sdkDirectory}") -// } -//} -// -//android { -// namespace = "com.sphereon.oid.fed.common" -// compileSdk = libs.versions.android.compileSdk.get().toInt() -// compileOptions { -// sourceCompatibility = JavaVersion.VERSION_11 -// targetCompatibility = JavaVersion.VERSION_11 -// } -// defaultConfig { -// minSdk = libs.versions.android.minSdk.get().toInt() -// } -//} - diff --git a/modules/openid-federation-client/src/jsMain/kotlin/com/sphereon/oid/fed/client/validation/TrustChainValidation.js.kt b/modules/openid-federation-client/src/jsMain/kotlin/com/sphereon/oid/fed/client/validation/TrustChainValidation.js.kt index 6fc6649d..f5bad782 100644 --- a/modules/openid-federation-client/src/jsMain/kotlin/com/sphereon/oid/fed/client/validation/TrustChainValidation.js.kt +++ b/modules/openid-federation-client/src/jsMain/kotlin/com/sphereon/oid/fed/client/validation/TrustChainValidation.js.kt @@ -1,8 +1,6 @@ package com.sphereon.oid.fed.client.validation import com.sphereon.oid.fed.common.jwt.JwtService -import com.sphereon.oid.fed.openapi.models.EntityConfigurationStatement -import io.ktor.client.engine.* import kotlinx.coroutines.CoroutineName import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.promise @@ -16,10 +14,10 @@ class TrustChainValidation(val jwtService: JwtService) { fun readAuthorityHints( partyBId: String, - engine: HttpClientEngine, - trustChains: MutableList> = mutableListOf(), - trustChain: MutableSet = mutableSetOf() - ): Promise>> = CoroutineScope(context = CoroutineName(NAME)).promise { + engine: dynamic, + trustChains: dynamic, + trustChain: dynamic + ): Promise = CoroutineScope(context = CoroutineName(NAME)).promise { TrustChainValidationCommon(jwtService) .readAuthorityHints( partyBId = partyBId, @@ -30,8 +28,8 @@ class TrustChainValidation(val jwtService: JwtService) { } fun fetchSubordinateStatements( - entityConfigurationStatementsList: List>, - engine: HttpClientEngine + entityConfigurationStatementsList: dynamic, + engine: dynamic ): Promise>> = CoroutineScope(context = CoroutineName(NAME)).promise { TrustChainValidationCommon(jwtService) .fetchSubordinateStatements( diff --git a/modules/openid-federation-client/src/jsTest/kotlin/com/sphereon/oid/fed/client/validation/TrustChainValidationTest.kt b/modules/openid-federation-client/src/jsTest/kotlin/com/sphereon/oid/fed/client/validation/TrustChainValidationTest.kt index 7be704be..da3db5b6 100644 --- a/modules/openid-federation-client/src/jsTest/kotlin/com/sphereon/oid/fed/client/validation/TrustChainValidationTest.kt +++ b/modules/openid-federation-client/src/jsTest/kotlin/com/sphereon/oid/fed/client/validation/TrustChainValidationTest.kt @@ -443,7 +443,9 @@ class TrustChainValidationTest { listOfEntityConfigurationStatementList, TrustChainValidation(jwtServiceImpl).readAuthorityHints( partyBId = "https://edugain.org/federation", - engine = mockEngine + engine = mockEngine, + trustChains = mutableListOf(mutableListOf()), + trustChain = mutableListOf(), ).await() ) }