diff --git a/.docker/admin-server/Dockerfile b/.docker/admin-server/Dockerfile index 87be1628..3c05959f 100644 --- a/.docker/admin-server/Dockerfile +++ b/.docker/admin-server/Dockerfile @@ -13,6 +13,6 @@ FROM openjdk:21-jdk as runner WORKDIR /app -COPY --from=builder /app/modules/admin-server/build/libs/admin-server-0.0.1.jar ./admin-server-0.0.1.jar +COPY --from=builder /app/modules/admin-server/build/libs/admin-server-0.1.0-SNAPSHOT.jar ./admin-server-0.0.1.jar ENTRYPOINT ["java", "-jar", "admin-server-0.0.1.jar"] diff --git a/.docker/federation-server/Dockerfile b/.docker/federation-server/Dockerfile index 2a95313b..df2bd10d 100644 --- a/.docker/federation-server/Dockerfile +++ b/.docker/federation-server/Dockerfile @@ -13,6 +13,6 @@ FROM openjdk:21-jdk as runner WORKDIR /app -COPY --from=builder /app/modules/federation-server/build/libs/federation-server-0.0.1.jar ./federation-server-0.0.1.jar +COPY --from=builder /app/modules/federation-server/build/libs/federation-server-0.1.0-SNAPSHOT.jar ./federation-server-0.0.1.jar ENTRYPOINT ["java", "-jar", "federation-server-0.0.1.jar"] diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..7336269b --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ + +* text=auto eol=lf diff --git a/modules/openid-federation-client/src/commonMain/kotlin/com/sphereon/oid/fed/client/helpers/Helpers.kt b/modules/openid-federation-client/src/commonMain/kotlin/com/sphereon/oid/fed/client/helpers/Helpers.kt index e82daf80..f2121e8b 100644 --- a/modules/openid-federation-client/src/commonMain/kotlin/com/sphereon/oid/fed/client/helpers/Helpers.kt +++ b/modules/openid-federation-client/src/commonMain/kotlin/com/sphereon/oid/fed/client/helpers/Helpers.kt @@ -4,6 +4,6 @@ fun getEntityConfigurationEndpoint(iss: String): String { return "${if (iss.endsWith("/")) iss.dropLast(1) else iss}/.well-known/openid-federation" } -fun getSubordinateStatementEndpoint(fetchEndpoint: String, sub: String): String { - return "${fetchEndpoint}?sub=$sub" +fun getSubordinateStatementEndpoint(fetchEndpoint: String, sub: String, iss: String): String { + return "${fetchEndpoint}?sub=$sub&iss=$iss" } 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 b10386c0..05fec6f0 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 @@ -25,14 +25,14 @@ expect interface ITrustChainCallbackMarkerType interface ITrustChainMarkerType @JsExport.Ignore -interface ITrustChainCallbackService: ITrustChainMarkerType { +interface ITrustChainCallbackService : ITrustChainMarkerType { suspend fun resolve( entityIdentifier: String, trustAnchors: Array, maxDepth: Int = 5 ): MutableList? } @JsExport.Ignore -interface ITrustChainService: ITrustChainMarkerType { +interface ITrustChainService : ITrustChainMarkerType { suspend fun resolve( entityIdentifier: String, trustAnchors: Array, maxDepth: Int = 5 ): MutableList? @@ -40,7 +40,8 @@ interface ITrustChainService: ITrustChainMarkerType { expect fun trustChainService(platformCallback: ITrustChainCallbackMarkerType = DefaultCallbacks.trustChainService()): ITrustChainService -abstract class AbstractTrustChainService(open val platformCallback: CallbackServiceType): ICallbackService { +abstract class AbstractTrustChainService(open val platformCallback: CallbackServiceType) : + ICallbackService { private var disabled = false override fun isEnabled(): Boolean { @@ -66,7 +67,8 @@ abstract class AbstractTrustChainService(open val platformC } } -class TrustChainService(override val platformCallback: ITrustChainCallbackService = DefaultCallbacks.trustChainService()): AbstractTrustChainService(platformCallback), ITrustChainService { +class TrustChainService(override val platformCallback: ITrustChainCallbackService = DefaultCallbacks.trustChainService()) : + AbstractTrustChainService(platformCallback), ITrustChainService { override fun platform(): ITrustChainCallbackService { return this.platformCallback @@ -92,7 +94,10 @@ class SimpleCache { } } -class DefaultTrustChainImpl(private val fetchService: IFetchCallbackMarkerType?, private val cryptoService: ICryptoCallbackMarkerType?): ITrustChainCallbackService, ITrustChainCallbackMarkerType { +class DefaultTrustChainImpl( + private val fetchService: IFetchCallbackMarkerType?, + private val cryptoService: ICryptoCallbackMarkerType? +) : ITrustChainCallbackService, ITrustChainCallbackMarkerType { override suspend fun resolve( entityIdentifier: String, trustAnchors: Array, maxDepth: Int ): MutableList? { @@ -114,9 +119,11 @@ class DefaultTrustChainImpl(private val fetchService: IFetchCallbackMarkerType?, depth: Int, maxDepth: Int ): MutableList? { - if(depth == maxDepth) return null + if (depth == maxDepth) return null - val entityConfigurationJwt = fetchService(fetchService ?: DefaultCallbacks.fetchService()).fetchStatement(getEntityConfigurationEndpoint(entityIdentifier)) + val entityConfigurationJwt = fetchService(fetchService ?: DefaultCallbacks.fetchService()).fetchStatement( + getEntityConfigurationEndpoint(entityIdentifier) + ) val decodedEntityConfiguration = decodeJWTComponents(entityConfigurationJwt) val key = findKeyInJwks( @@ -180,7 +187,10 @@ class DefaultTrustChainImpl(private val fetchService: IFetchCallbackMarkerType?, // Avoid processing the same entity twice if (cache.get(authorityConfigurationEndpoint) != null) return null - val authorityEntityConfigurationJwt = fetchService(this.fetchService ?: DefaultCallbacks.fetchService()).fetchStatement(authorityConfigurationEndpoint) + val authorityEntityConfigurationJwt = + fetchService(this.fetchService ?: DefaultCallbacks.fetchService()).fetchStatement( + authorityConfigurationEndpoint + ) cache.put(authorityConfigurationEndpoint, authorityEntityConfigurationJwt) val decodedJwt = decodeJWTComponents(authorityEntityConfigurationJwt) @@ -212,9 +222,12 @@ class DefaultTrustChainImpl(private val fetchService: IFetchCallbackMarkerType?, federationEntityMetadata["federation_fetch_endpoint"]?.jsonPrimitive?.content ?: return null val subordinateStatementEndpoint = - getSubordinateStatementEndpoint(authorityEntityFetchEndpoint, entityIdentifier) + getSubordinateStatementEndpoint(authorityEntityFetchEndpoint, entityIdentifier, authority) - val subordinateStatementJwt = fetchService(this.fetchService ?: DefaultCallbacks.fetchService()).fetchStatement(subordinateStatementEndpoint) + val subordinateStatementJwt = + fetchService(this.fetchService ?: DefaultCallbacks.fetchService()).fetchStatement( + subordinateStatementEndpoint + ) val decodedSubordinateStatement = decodeJWTComponents(subordinateStatementJwt) @@ -226,7 +239,11 @@ class DefaultTrustChainImpl(private val fetchService: IFetchCallbackMarkerType?, if (subordinateStatementKey == null) return null - if (!cryptoService(this.cryptoService ?: DefaultCallbacks.jwtService()).verify(subordinateStatementJwt, subordinateStatementKey)) { + if (!cryptoService(this.cryptoService ?: DefaultCallbacks.jwtService()).verify( + subordinateStatementJwt, + subordinateStatementKey + ) + ) { return null } diff --git a/modules/openid-federation-client/src/commonTest/kotlin/com/sphereon/oid/fed/client/trustchain/MockResponses.kt b/modules/openid-federation-client/src/commonTest/kotlin/com/sphereon/oid/fed/client/trustchain/MockResponses.kt index a1bae9d2..050fc3a7 100644 --- a/modules/openid-federation-client/src/commonTest/kotlin/com/sphereon/oid/fed/client/trustchain/MockResponses.kt +++ b/modules/openid-federation-client/src/commonTest/kotlin/com/sphereon/oid/fed/client/trustchain/MockResponses.kt @@ -14,7 +14,7 @@ val mockResponses = arrayOf( "eyJraWQiOiJFOTVjTkxUU3RJUHZzbU1kYTZuR0hwdjVKVDg1Q3R6WmxQbGlqejY5Y1JrIiwidHlwIjoiZW50aXR5LXN0YXRlbWVudCtqd3QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJodHRwczovL3NwaWQud2Jzcy5pdC9TcGlkL29pZGMvcnAvaXBhc3ZfbHQiLCJtZXRhZGF0YSI6eyJmZWRlcmF0aW9uX2VudGl0eSI6eyJob21lcGFnZV91cmkiOiJodHRwczovL3d3dy5vcGlsYXRpbmEuaXQiLCJsb2dvX3VyaSI6Imh0dHBzOi8vd3d3Lm9waWxhdGluYS5pdCIsIm9yZ2FuaXphdGlvbl9uYW1lIjoiT3JkaW5lIGRlbGxlIFByb2Zlc3Npb25pIEluZmVybWllcmlzdGljaGUgZGkgTGF0aW5h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QsQxzQu1z6aEJVcblDu6KUt9QAr0qq4LMps7Ql6h1_1WI1XxsleX8qjtvnzZqG-gvRY1iH1opOmMR0oVzP-WfY16DCMIriiJeqB47AA3OcTs4VJ8choJBK1BlciYRyatmdrASwMMtePE8cQdnAvDeN0r5RLDqlFGjy0Mmyh8FDs_VWpQ11oVIrkNg_RMOR8BGsYGYeelqDmyc6hs6RLfNXQj2nU48obw7n9EVOcOvX7GyABAY9_taPMIHdfwgg" ), arrayOf( - "https://oidc.registry.servizicie.interno.gov.it/fetch?sub=https://spid.wbss.it/Spid/oidc/sa", + "https://oidc.registry.servizicie.interno.gov.it/fetch?sub=https://spid.wbss.it/Spid/oidc/sa&iss=https://oidc.registry.servizicie.interno.gov.it", "eyJraWQiOiJkZWZhdWx0UlNBU2lnbiIsInR5cCI6ImVudGl0eS1zdGF0ZW1lbnQrand0IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJodHRwczovL3NwaWQud2Jzcy5pdC9TcGlkL29pZGMvc2EiLCJqd2tzIjp7ImtleXMiOlt7Imt0eSI6IlJTQSIsImUiOiJBUUFCIiwidXNlIjoic2lnIiwia2lkIjoiTVhhb01Lb3FiMjBNUDBNVmJEVGRsSGJpRTBPSWpDcmJoR055MVlZc3lyTSIsImFsZyI6IlJTMjU2IiwibiI6IjBCVFA0QUNnLUtUNmVOZEFocjEtcGE3Nmx1alhWM1dpWGwwdzROX215ajRxMHpnYVpPRDFjNUk3MjQtZzBfTkhpMjJxQmoxSXUtTUdKUVZrbGZELWVzSzFGWjJybmRSaWFiNVRkTXA0YzF5eS10a2lRTTdhZkp3elc3MERpb1YxaVNtZk9RNEhIMDlBLWRhbElaX0lBOFBxZXE4VHliZHBnUXN0TkFwM0ZOMGNNb0hILVdhZ0ZRR2lWMkEySDNzVWh2UVYyT19FQ0VaWENvTExHNkVzVVJzaEtweU93WDkwN05NSzdROVI5VU9CeldhQkpxUGstY21tbTlpWlRnVDg2QV9CY1MwdVpZeTdFT1lCM0VrY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KbJvR1CcdCVFVBQ1GFumTe1DOhkARbFg3rT_w8RjH_PhuRmUDUQyTBQwDHdFydb_TZpgzvSmHUjjvB2qJT109DGV4s-aFwj5bUn9YRazWlNDo78PFS0lJk16bLGEP5YRrXL_lGSxSEUta-BQEoJ2CR9QsBCW8L1HJoRywx61nWSC1wsCAxJlR4eg" ) ) diff --git a/modules/openid-federation-client/src/jsMain/kotlin/com/sphereon/oid/fed/client/trustchain/TrustChain.js.kt b/modules/openid-federation-client/src/jsMain/kotlin/com/sphereon/oid/fed/client/trustchain/TrustChain.js.kt index 7da9617d..1c92c561 100644 --- a/modules/openid-federation-client/src/jsMain/kotlin/com/sphereon/oid/fed/client/trustchain/TrustChain.js.kt +++ b/modules/openid-federation-client/src/jsMain/kotlin/com/sphereon/oid/fed/client/trustchain/TrustChain.js.kt @@ -214,7 +214,7 @@ class DefaultTrustChainJSImpl( federationEntityMetadata["federation_fetch_endpoint"]?.jsonPrimitive?.content ?: return@async null val subordinateStatementEndpoint = - getSubordinateStatementEndpoint(authorityEntityFetchEndpoint, entityIdentifier) + getSubordinateStatementEndpoint(authorityEntityFetchEndpoint, entityIdentifier, authority) val subordinateStatementJwt = fetchService(fetchService ?: DefaultCallbacks.fetchService()).fetchStatement( diff --git a/modules/openid-federation-client/src/jsTest/kotlin/com/sphereon/oid/fed/client/trustchain/TrustChainTest.js.kt b/modules/openid-federation-client/src/jsTest/kotlin/com/sphereon/oid/fed/client/trustchain/TrustChainTest.js.kt index f6dcd45b..47a161cd 100644 --- a/modules/openid-federation-client/src/jsTest/kotlin/com/sphereon/oid/fed/client/trustchain/TrustChainTest.js.kt +++ b/modules/openid-federation-client/src/jsTest/kotlin/com/sphereon/oid/fed/client/trustchain/TrustChainTest.js.kt @@ -7,6 +7,7 @@ import com.sphereon.oid.fed.client.service.DefaultCallbacks import com.sphereon.oid.fed.openapi.models.Jwk import io.ktor.client.* import io.ktor.client.call.body +import io.ktor.client.call.* import io.ktor.client.engine.mock.* import io.ktor.client.request.get import io.ktor.http.* @@ -42,11 +43,11 @@ actual class PlatformCallback : IFetchCallbackServiceJS { override fun fetchStatement(endpoint: String): Promise { return CoroutineScope(context = CoroutineName(FETCH_SERVICE_JS_SCOPE)).async { - return@async getHttpClient().await().get(endpoint) { - headers { - append(HttpHeaders.Accept, "application/entity-statement+jwt") - } - }.body() as String + return@async getHttpClient().await().get(endpoint) { + headers { + append(HttpHeaders.Accept, "application/entity-statement+jwt") + } + }.body() as String }.asPromise() } } @@ -86,13 +87,13 @@ actual class TrustChainTest { assertEquals( trustChain[1], - mockResponses.find { it[0] == "https://spid.wbss.it/Spid/oidc/sa/fetch?sub=https://spid.wbss.it/Spid/oidc/rp/ipasv_lt" } + mockResponses.find { it[0] == "https://spid.wbss.it/Spid/oidc/sa/fetch?sub=https://spid.wbss.it/Spid/oidc/rp/ipasv_lt&iss=https://spid.wbss.it/Spid/oidc/sa" } ?.get(1) ) assertEquals( trustChain[2], - mockResponses.find { it[0] == "https://oidc.registry.servizicie.interno.gov.it/fetch?sub=https://spid.wbss.it/Spid/oidc/sa" } + mockResponses.find { it[0] == "https://oidc.registry.servizicie.interno.gov.it/fetch?sub=https://spid.wbss.it/Spid/oidc/sa&iss=https://oidc.registry.servizicie.interno.gov.it" } ?.get(1) ) @@ -116,7 +117,7 @@ actual class TrustChainTest { assertEquals( trustChain2[1], - mockResponses.find { it[0] == "https://oidc.registry.servizicie.interno.gov.it/fetch?sub=https://spid.wbss.it/Spid/oidc/sa" } + mockResponses.find { it[0] == "https://oidc.registry.servizicie.interno.gov.it/fetch?sub=https://spid.wbss.it/Spid/oidc/sa&iss=https://oidc.registry.servizicie.interno.gov.it" } ?.get(1) ) diff --git a/modules/openid-federation-client/src/jvmTest/kotlin/com/sphereon/oid/fed/client/trustchain/TrustChainTest.jvm.kt b/modules/openid-federation-client/src/jvmTest/kotlin/com/sphereon/oid/fed/client/trustchain/TrustChainTest.jvm.kt index 686d5a86..32b673e2 100644 --- a/modules/openid-federation-client/src/jvmTest/kotlin/com/sphereon/oid/fed/client/trustchain/TrustChainTest.jvm.kt +++ b/modules/openid-federation-client/src/jvmTest/kotlin/com/sphereon/oid/fed/client/trustchain/TrustChainTest.jvm.kt @@ -5,16 +5,11 @@ import com.sphereon.oid.fed.client.crypto.ICryptoCallbackService import com.sphereon.oid.fed.client.fetch.IFetchCallbackService import com.sphereon.oid.fed.client.service.DefaultCallbacks import com.sphereon.oid.fed.openapi.models.Jwk -import io.ktor.client.HttpClient -import io.ktor.client.call.body -import io.ktor.client.engine.mock.MockEngine -import io.ktor.client.engine.mock.MockEngine.Companion.invoke -import io.ktor.client.engine.mock.respond +import io.ktor.client.* +import io.ktor.client.call.* +import io.ktor.client.engine.mock.* import io.ktor.client.request.get -import io.ktor.http.HttpHeaders -import io.ktor.http.HttpStatusCode -import io.ktor.http.headers -import io.ktor.http.headersOf +import io.ktor.http.* import kotlinx.coroutines.test.runTest import kotlin.test.Test import kotlin.test.assertEquals @@ -79,13 +74,13 @@ actual class TrustChainTest { assertEquals( trustChain[1], - mockResponses.find { it[0] == "https://spid.wbss.it/Spid/oidc/sa/fetch?sub=https://spid.wbss.it/Spid/oidc/rp/ipasv_lt" } + mockResponses.find { it[0] == "https://spid.wbss.it/Spid/oidc/sa/fetch?sub=https://spid.wbss.it/Spid/oidc/rp/ipasv_lt&iss=https://spid.wbss.it/Spid/oidc/sa" } ?.get(1) ) assertEquals( trustChain[2], - mockResponses.find { it[0] == "https://oidc.registry.servizicie.interno.gov.it/fetch?sub=https://spid.wbss.it/Spid/oidc/sa" } + mockResponses.find { it[0] == "https://oidc.registry.servizicie.interno.gov.it/fetch?sub=https://spid.wbss.it/Spid/oidc/sa&iss=https://oidc.registry.servizicie.interno.gov.it" } ?.get(1) ) @@ -101,7 +96,7 @@ actual class TrustChainTest { ) assertNotNull(trustChain2) - assertEquals(trustChain2.size, 3) + assertEquals(3, trustChain2.size) assertEquals( trustChain2[0], mockResponses.find { it[0] == "https://spid.wbss.it/Spid/oidc/sa/.well-known/openid-federation" }?.get(1) @@ -109,7 +104,7 @@ actual class TrustChainTest { assertEquals( trustChain2[1], - mockResponses.find { it[0] == "https://oidc.registry.servizicie.interno.gov.it/fetch?sub=https://spid.wbss.it/Spid/oidc/sa" } + mockResponses.find { it[0] == "https://oidc.registry.servizicie.interno.gov.it/fetch?sub=https://spid.wbss.it/Spid/oidc/sa&iss=https://oidc.registry.servizicie.interno.gov.it" } ?.get(1) )