Skip to content

feat: Multiplatform OFREP provider #6

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

Open
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

bencehornak
Copy link
Contributor

@bencehornak bencehornak commented Jun 23, 2025

This PR

Implements an OFREP provider for Kotlin Multiplatform. The implementation was initially based on @thomaspoignant's OFREP implementation, then I made a bunch of changes to make it compatible with multiple platforms:

  • Replaced Java APIs with Kotlin APIs
  • Replaced jUnit with kotlin-test
  • Replaced OkHttp with Ktor
  • Replaced GSON with kotlinx-serialization
  • Replaced the Java Timer with Kotlin Coroutines
  • ...

Now the project is compatible with multiple platforms, and can be easily extended to other ones by changing the targets in the build.gradle.kts:

Supported Platform Supported versions
Android
JVM JDK 11+
Native Linux x64
Native Other native targets
Javascript (Node.js)
Javascript (Browser)
Wasm

Notes

I have based these changes on the unmerged open-feature/kotlin-sdk#148, which brings in multiplatform support for the SDK.

Prerequisites

How to test

  1. Check out my PR in the Kotlin SDK repo: feat!: Kotlin Multiplatform support kotlin-sdk#148
  2. Publish the SDK locally as 0.5.0 - I have made the following changes to be able to do so:
diff --git a/build.gradle.kts b/build.gradle.kts
index dbeedff..122dbf0 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -11,7 +11,7 @@ plugins {
 allprojects {
     extra["groupId"] = "dev.openfeature"
 // x-release-please-start-version
-    ext["version"] = "0.4.1"
+    ext["version"] = "0.5.0"
 // x-release-please-end
 }
 group = project.extra["groupId"].toString()
diff --git a/kotlin-sdk/build.gradle.kts b/kotlin-sdk/build.gradle.kts
index 6cc9db9..437d2b6 100644
--- a/kotlin-sdk/build.gradle.kts
+++ b/kotlin-sdk/build.gradle.kts
@@ -3,7 +3,7 @@ plugins {
     id("com.android.library")
     id("org.jetbrains.kotlin.multiplatform")
     id("maven-publish")
-    id("signing")
+//    id("signing")
     id("org.jlleitschuh.gradle.ktlint")
     id("org.jetbrains.kotlinx.binary-compatibility-validator")
 }
@@ -129,7 +129,6 @@ publishing {
         }
     }
 }
-
-signing {
-    sign(publishing.publications["release"])
-}
\ No newline at end of file
+//signing {
+//    sign(publishing.publications["release"])
+//}
  1. Run the tests on all platforms with ./gradlew -p providers/ofrep allTests
  2. You might need to meet some prerequisites to have the tests pass for all platforms

Signed-off-by: Bence Hornák <bence.hornak@gmail.com>
Signed-off-by: Bence Hornák <bence.hornak@gmail.com>
Signed-off-by: Bence Hornák <bence.hornak@gmail.com>
Signed-off-by: Bence Hornák <bence.hornak@gmail.com>
Signed-off-by: Bence Hornák <bence.hornak@gmail.com>
Signed-off-by: Bence Hornák <bence.hornak@gmail.com>
Signed-off-by: Bence Hornák <bence.hornak@gmail.com>
Signed-off-by: Bence Hornák <bence.hornak@gmail.com>
Signed-off-by: Bence Hornák <bence.hornak@gmail.com>
Signed-off-by: Bence Hornák <bence.hornak@gmail.com>
Signed-off-by: Bence Hornák <bence.hornak@gmail.com>
Signed-off-by: Bence Hornák <bence.hornak@gmail.com>
Signed-off-by: Bence Hornák <bence.hornak@gmail.com>
Signed-off-by: Bence Hornák <bence.hornak@gmail.com>
Signed-off-by: Bence Hornák <bence.hornak@gmail.com>
Signed-off-by: Bence Hornák <bence.hornak@gmail.com>
Signed-off-by: Bence Hornák <bence.hornak@gmail.com>
Signed-off-by: Bence Hornák <bence.hornak@gmail.com>
Signed-off-by: Bence Hornák <bence.hornak@gmail.com>
Signed-off-by: Bence Hornák <bence.hornak@gmail.com>
Signed-off-by: Bence Hornák <bence.hornak@gmail.com>
@bencehornak bencehornak changed the title Multiplatform OFREP provider feat: Multiplatform OFREP provider Jun 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant