Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

export interface from root to JS #46

Merged
merged 2 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
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
Loading