Skip to content

Commit

Permalink
export interface from root to JS
Browse files Browse the repository at this point in the history
  • Loading branch information
jcmelati committed Nov 14, 2024
1 parent 952c5f0 commit d5e0634
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 30 deletions.
Original file line number Diff line number Diff line change
@@ -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<String>? = 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?
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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<String>? = 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d5e0634

Please sign in to comment.