diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bbdaf68a..2756cab4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,7 @@ jobs: DATASOURCE_URL: ${{ secrets.LOCAL_KMS_DATASOURCE_URL }} - name: Setup Gradle - uses: gradle/gradle-build-action@v3 + uses: gradle/actions/setup-gradle@v4 - name: Grant execute permission for Gradlew (Linux/Mac) if: runner.os != 'Windows' diff --git a/modules/openid-federation-client/src/commonMain/kotlin/com/sphereon/oid/fed/client/Client.kt b/modules/openid-federation-client/src/commonMain/kotlin/com/sphereon/oid/fed/client/Client.kt index 2e808a1a..3044763f 100644 --- a/modules/openid-federation-client/src/commonMain/kotlin/com/sphereon/oid/fed/client/Client.kt +++ b/modules/openid-federation-client/src/commonMain/kotlin/com/sphereon/oid/fed/client/Client.kt @@ -1,13 +1,37 @@ -package com.sphereon.oid.fed.client - import com.sphereon.oid.fed.client.crypto.ICryptoService import com.sphereon.oid.fed.client.crypto.cryptoService import com.sphereon.oid.fed.client.fetch.IFetchService import com.sphereon.oid.fed.client.fetch.fetchService import com.sphereon.oid.fed.client.trustchain.TrustChain -import com.sphereon.oid.fed.client.trustchain.TrustChainResolveResponse import kotlin.js.JsExport +import kotlin.js.JsName + +/** + * Response object for the resolve operation. + */ +@JsExport +@JsName("TrustChainResolveResponse") +data class TrustChainResolveResponse( + /** + * A list of strings representing the resolved trust chain. + * Each string contains a JWT. + */ + val trustChain: List? = null, + + /** + * Indicates whether the resolve operation was successful. + */ + val error: Boolean = false, + + /** + * Error message in case of a failure, if any. + */ + val errorMessage: String? = null +) +/** + * Interface for the FederationClient. + */ @JsExport.Ignore interface IFederationClient { val fetchServiceCallback: IFetchService? diff --git a/modules/openid-federation-client/src/commonMain/kotlin/com/sphereon/oid/fed/client/trustchain/TrustChain.kt b/modules/openid-federation-client/src/commonMain/kotlin/com/sphereon/oid/fed/client/trustchain/TrustChain.kt index 627236c3..56da9c0a 100644 --- a/modules/openid-federation-client/src/commonMain/kotlin/com/sphereon/oid/fed/client/trustchain/TrustChain.kt +++ b/modules/openid-federation-client/src/commonMain/kotlin/com/sphereon/oid/fed/client/trustchain/TrustChain.kt @@ -1,5 +1,6 @@ package com.sphereon.oid.fed.client.trustchain +import TrustChainResolveResponse import com.sphereon.oid.fed.client.crypto.ICryptoService import com.sphereon.oid.fed.client.fetch.IFetchService import com.sphereon.oid.fed.client.helpers.checkKidInJwks @@ -15,31 +16,6 @@ import kotlinx.serialization.json.jsonArray import kotlinx.serialization.json.jsonObject import kotlinx.serialization.json.jsonPrimitive import kotlin.collections.set -import kotlin.js.JsExport -import kotlin.js.JsName - -/** - * Response object for the resolve operation. - */ -@JsExport -@JsName("TrustChainResolveResponse") -data class TrustChainResolveResponse( - /** - * A list of strings representing the resolved trust chain. - * Each string contains a JWT. - */ - val trustChain: List? = null, - - /** - * Indicates whether the resolve operation was successful. - */ - val error: Boolean = false, - - /** - * Error message in case of a failure, if any. - */ - val errorMessage: String? = null -) /* * TrustChain is a class that implements the logic to resolve and validate a trust chain. diff --git a/modules/openid-federation-client/src/commonTest/kotlin/com/sphereon/oid/fed/client/trustchain/TrustChainTest.kt b/modules/openid-federation-client/src/commonTest/kotlin/com/sphereon/oid/fed/client/trustchain/TrustChainTest.kt index 82a29acd..39fdb314 100644 --- a/modules/openid-federation-client/src/commonTest/kotlin/com/sphereon/oid/fed/client/trustchain/TrustChainTest.kt +++ b/modules/openid-federation-client/src/commonTest/kotlin/com/sphereon/oid/fed/client/trustchain/TrustChainTest.kt @@ -1,6 +1,6 @@ package com.sphereon.oid.fed.client.trustchain -import com.sphereon.oid.fed.client.FederationClient +import FederationClient import com.sphereon.oid.fed.client.crypto.ICryptoService import com.sphereon.oid.fed.client.fetch.IFetchService import com.sphereon.oid.fed.openapi.models.Jwk diff --git a/modules/openid-federation-client/src/jsMain/kotlin/com/sphereon/oid/fed/client/Client.js.kt b/modules/openid-federation-client/src/jsMain/kotlin/com/sphereon/oid/fed/client/Client.js.kt index 32862d77..a14ba3cf 100644 --- a/modules/openid-federation-client/src/jsMain/kotlin/com/sphereon/oid/fed/client/Client.js.kt +++ b/modules/openid-federation-client/src/jsMain/kotlin/com/sphereon/oid/fed/client/Client.js.kt @@ -5,7 +5,6 @@ import com.sphereon.oid.fed.client.fetch.FetchServiceAdapter import com.sphereon.oid.fed.client.fetch.IFetchService import com.sphereon.oid.fed.client.fetch.fetchService import com.sphereon.oid.fed.client.trustchain.TrustChain -import com.sphereon.oid.fed.client.trustchain.TrustChainResolveResponse import com.sphereon.oid.fed.openapi.models.Jwk import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers