Skip to content

Commit

Permalink
fix: protolib
Browse files Browse the repository at this point in the history
- Handled all kotlin linting issues
- Fixed file/class naming as we now have Java in our gradle
- Fixe protosLib gradle file
Signed-off-by: Ahmed Moussa <[email protected]>
  • Loading branch information
hamada147 committed May 13, 2024
1 parent e19d263 commit 957c563
Show file tree
Hide file tree
Showing 32 changed files with 78 additions and 60 deletions.
2 changes: 1 addition & 1 deletion authenticate-sdk/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,4 @@ tasks.withType<DokkaTask> {
// showStackTraces = true
// }
// }
// }
// }
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package io.iohk.atala.prism.authenticatesdk

actual fun authenticate(did: String, signature: String, originalText: String):String {
return "hola";
actual fun authenticate(did: String, signature: String, originalText: String): String {
return "hola"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package io.iohk.atala.prism.authenticatesdk

actual fun createChallenge(expiration: Int): String {
return "hola";
}
return "hola"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package io.iohk.atala.prism.authenticatesdk

expect fun authenticate(did: String, signature: String, originalText: String):String
expect fun authenticate(did: String, signature: String, originalText: String): String
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package io.iohk.atala.prism.authenticatesdk

expect fun createChallenge(expiration: Int): String
expect fun createChallenge(expiration: Int): String
2 changes: 1 addition & 1 deletion authenticate-sdk/src/jsMain/kotlin/JSExport.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ fun jsAuthenticate(did: String, signature: String, originalText: String): String
@JsName("createChallenge")
fun jsCreateChallenge(expiration: Int): String {
return createChallenge(expiration)
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package io.iohk.atala.prism.authenticatesdk

actual fun authenticate(did: String, signature: String, originalText: String):String {
return "hola";
actual fun authenticate(did: String, signature: String, originalText: String): String {
return "hola"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package io.iohk.atala.prism.authenticatesdk

actual fun createChallenge(expiration: Int): String {
return "hola";
}
return "hola"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package io.iohk.atala.prism.authenticatesdk

actual fun authenticate(did: String, signature: String, originalText: String):String {
return "hola";
actual fun authenticate(did: String, signature: String, originalText: String): String {
return "hola"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package io.iohk.atala.prism.authenticatesdk

actual fun createChallenge(expiration: Int): String {
return "hola";
}
return "hola"
}
2 changes: 1 addition & 1 deletion core-sdk/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -235,4 +235,4 @@ tasks.withType<DokkaTask> {
// showStackTraces = true
// }
// }
// }
// }
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ package io.iohk.atala.prism.walletcore
internal actual object Platform {
actual val OS: String
get() = "Android ${android.os.Build.VERSION.SDK_INT}"
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package io.iohk.atala.prism.walletcore

import io.ktor.client.*
import io.ktor.client.engine.okhttp.*
import io.ktor.client.HttpClient
import io.ktor.client.HttpClientConfig
import io.ktor.client.engine.okhttp.OkHttp

internal actual fun httpClient(config: HttpClientConfig<*>.() -> Unit) = HttpClient(OkHttp) {
config(this)
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
package io.iohk.atala.prism.walletcore

import io.ktor.client.*
import io.ktor.client.request.*
import io.ktor.client.statement.*
import io.ktor.http.*

internal expect fun httpClient(config: HttpClientConfig<*>.() -> Unit = {}): HttpClient
import io.ktor.client.HttpClient
import io.ktor.client.request.prepareRequest
import io.ktor.client.statement.HttpResponse
import io.ktor.client.statement.HttpStatement
import io.ktor.http.ContentType
import io.ktor.http.HttpHeaders
import io.ktor.http.HttpMethod
import io.ktor.http.URLProtocol
import io.ktor.http.path

class AtalaClient(
private val baseURL: String,
Expand All @@ -20,7 +23,7 @@ class AtalaClient(
httpHeaders: Map<String, String> = mapOf()
): HttpStatement {
return client.prepareRequest {
for(header in httpHeaders) {
for (header in httpHeaders) {
if (
httpMethod == HttpMethod.Get &&
header.key == HttpHeaders.ContentType &&
Expand Down Expand Up @@ -58,6 +61,7 @@ class AtalaClient(
*/
}

/*
fun AtalaClient.login() {
}
Expand All @@ -69,4 +73,5 @@ suspend fun x() {
""
)
request.execute()
}
}
*/
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ package io.iohk.atala.prism.walletcore

internal expect object Platform {
val OS: String
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package io.iohk.atala.prism.walletcore

import io.ktor.client.HttpClient
import io.ktor.client.HttpClientConfig


internal expect fun httpClient(config: HttpClientConfig<*>.() -> Unit = {}): HttpClient
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ import platform.UIKit.UIDevice
internal actual object Platform {
actual val OS: String
get() = "${UIDevice.currentDevice.systemName()}-${UIDevice.currentDevice.systemVersion}"
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package io.iohk.atala.prism.walletcore

import io.ktor.client.*
import io.ktor.client.engine.darwin.*
import io.ktor.client.HttpClient
import io.ktor.client.HttpClientConfig
import io.ktor.client.engine.darwin.Darwin

internal actual fun httpClient(config: HttpClientConfig<*>.() -> Unit) = HttpClient(Darwin) {
config(this)
Expand All @@ -10,4 +11,4 @@ internal actual fun httpClient(config: HttpClientConfig<*>.() -> Unit) = HttpCli
setAllowsCellularAccess(true)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ internal actual object Platform {
} else {
"JS"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package io.iohk.atala.prism.walletcore

import io.ktor.client.*
import io.ktor.client.engine.js.*
import io.ktor.client.HttpClient
import io.ktor.client.HttpClientConfig
import io.ktor.client.engine.js.Js

internal actual fun httpClient(config: HttpClientConfig<*>.() -> Unit) = HttpClient(Js) {
config(this)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ package io.iohk.atala.prism.walletcore
internal actual object Platform {
actual val OS: String
get() = "JVM - ${System.getProperty("java.version")}"
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package io.iohk.atala.prism.walletcore

import io.ktor.client.*
import io.ktor.client.engine.okhttp.*
import io.ktor.client.HttpClient
import io.ktor.client.HttpClientConfig
import io.ktor.client.engine.okhttp.OkHttp

internal actual fun httpClient(config: HttpClientConfig<*>.() -> Unit) = HttpClient(OkHttp) {
config(this)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ internal actual object Platform {
val processInfo = NSProcessInfo.processInfo()
return "${processInfo.operatingSystemName()}-${processInfo.operatingSystemVersionString()}"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package io.iohk.atala.prism.walletcore

import io.ktor.client.*
import io.ktor.client.engine.darwin.*
import io.ktor.client.HttpClient
import io.ktor.client.HttpClientConfig
import io.ktor.client.engine.darwin.Darwin

internal actual fun httpClient(config: HttpClientConfig<*>.() -> Unit) = HttpClient(Darwin) {
config(this)
Expand All @@ -10,4 +11,4 @@ internal actual fun httpClient(config: HttpClientConfig<*>.() -> Unit) = HttpCli
setAllowsCellularAccess(true)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ import platform.UIKit.UIDevice
internal actual object Platform {
actual val OS: String
get() = "${UIDevice.currentDevice.systemName()}-${UIDevice.currentDevice.systemVersion}"
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package io.iohk.atala.prism.walletcore

import io.ktor.client.*
import io.ktor.client.engine.darwin.*
import io.ktor.client.HttpClient
import io.ktor.client.HttpClientConfig
import io.ktor.client.engine.darwin.Darwin

internal actual fun httpClient(config: HttpClientConfig<*>.() -> Unit) = HttpClient(Darwin) {
config(this)
Expand All @@ -10,4 +11,4 @@ internal actual fun httpClient(config: HttpClientConfig<*>.() -> Unit) = HttpCli
setAllowsCellularAccess(true)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ internal actual object Platform {
val wkInterfaceDevice = WKInterfaceDevice.currentDevice()
return "${wkInterfaceDevice.systemName}-${wkInterfaceDevice.systemVersion}"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package io.iohk.atala.prism.walletcore

import io.ktor.client.*
import io.ktor.client.engine.darwin.*
import io.ktor.client.HttpClient
import io.ktor.client.HttpClientConfig
import io.ktor.client.engine.darwin.Darwin

internal actual fun httpClient(config: HttpClientConfig<*>.() -> Unit) = HttpClient(Darwin) {
config(this)
Expand All @@ -10,4 +11,4 @@ internal actual fun httpClient(config: HttpClientConfig<*>.() -> Unit) = HttpCli
setAllowsCellularAccess(true)
}
}
}
}
4 changes: 3 additions & 1 deletion protosLib/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import com.google.protobuf.gradle.id
import com.google.protobuf.gradle.proto
import com.google.protobuf.gradle.remove
import org.gradle.internal.os.OperatingSystem
import com.google.protobuf.gradle.*

val os: OperatingSystem = OperatingSystem.current()

Expand Down
1 change: 0 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ buildscript {
}
}


rootProject.name = "wallet-sdk"
include(":protosLib")
include(":wallet-sdk")
Expand Down
2 changes: 1 addition & 1 deletion wallet-sdk/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -205,4 +205,4 @@ tasks.withType<DokkaTask> {
// showStackTraces = true
// }
// }
// }
// }
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
package io.iohk.atala.prism.walletsdk

final class WalletSDK {

}
final class WalletSDK

0 comments on commit 957c563

Please sign in to comment.