Skip to content

Commit

Permalink
feat: implement resolve trust chain
Browse files Browse the repository at this point in the history
  • Loading branch information
jcmelati committed Oct 8, 2024
1 parent 1c90e8d commit 371223f
Show file tree
Hide file tree
Showing 22 changed files with 276 additions and 1,929 deletions.
13 changes: 1 addition & 12 deletions modules/local-kms/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackConfig
import kotlin.apply

plugins {
kotlin("multiplatform") version "2.0.0"
id("app.cash.sqldelight") version "2.0.2"
Expand Down Expand Up @@ -52,18 +49,10 @@ kotlin {
}
}

// jsMain {
// dependencies {
// implementation(npm("typescript", "5.5.3"))
// implementation(npm("jose", "5.6.3"))
// implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.1")
// }
// }

jvmTest {
dependencies {
implementation(kotlin("test-junit"))
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,5 @@ class Constants {
const val LOCAL_KMS_DATASOURCE_USER = "LOCAL_KMS_DATASOURCE_USER"
const val LOCAL_KMS_DATASOURCE_PASSWORD = "LOCAL_KMS_DATASOURCE_PASSWORD"
const val SQLITE_IS_NOT_SUPPORTED_IN_JVM = "SQLite is not supported in JVM"
const val SQLITE_IS_NOT_SUPPORTED_IN_JS = "SQLite is not supported in JS"
const val POSTGRESQL_IS_NOT_SUPPORTED_IN_JS = "PostgreSQL is not supported in JS"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class LocalKms {

val jwkObject: Jwk = Json.decodeFromString(aesEncryption.decrypt(jwk.key))

val mHeader = header.copy(alg = jwkObject.alg, kid = jwkObject.kid)
val mHeader = header.copy(alg = jwkObject.alg, kid = jwkObject.kid!!)

return sign(header = mHeader, payload = payload, key = jwkObject)
}
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -1829,6 +1829,8 @@ components:
type: object
x-tags:
- federation
required:
- kid
properties:
alg:
type: string
Expand Down
112 changes: 1 addition & 111 deletions modules/openid-federation-client/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ 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"
}

Expand Down Expand Up @@ -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 {
Expand All @@ -67,112 +53,16 @@ kotlin {
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.7.1")
implementation(libs.kermit.logging)
implementation(libs.kotlinx.datetime)
implementation(project(":modules:openid-federation-common"))
}
}
val commonTest by getting {
dependencies {
implementation(libs.kotlin.test)
implementation(kotlin("test-common"))
implementation(kotlin("test-annotations-common"))
implementation("io.ktor:ktor-client-mock:$ktorVersion")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.9.0-RC")
}
}
val jvmMain by getting {
dependencies {
implementation("io.ktor:ktor-client-core-jvm:$ktorVersion")
runtimeOnly("io.ktor:ktor-client-cio-jvm:$ktorVersion")
implementation(project(":modules:openid-federation-common"))
}
}
val jvmTest by getting {
dependencies {
implementation(kotlin("test-junit"))
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 {
runtimeOnly("io.ktor:ktor-client-core-js:$ktorVersion")
runtimeOnly("io.ktor:ktor-client-js:$ktorVersion")
implementation(npm("typescript", "5.5.3"))
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.1")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.9.0-RC")
implementation(project(":modules:openid-federation-common"))
}
}

val jsTest by getting {
dependencies {
implementation(kotlin("test-js"))
implementation(npm("jose", "5.6.3"))
implementation(kotlin("test-annotations-common"))
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()
// }
//}

Loading

0 comments on commit 371223f

Please sign in to comment.