0.5.1-SNAPSHOT: crypto2 upgraded

This commit is contained in:
Sergey Chernov 2024-11-26 18:57:59 +07:00
parent 9545ca28cf
commit 04ffde421d
4 changed files with 36 additions and 32 deletions

2
.idea/misc.xml generated
View File

@ -3,7 +3,7 @@
<component name="FrameworkDetectionExcludesConfiguration"> <component name="FrameworkDetectionExcludesConfiguration">
<file type="web" url="file://$PROJECT_DIR$" /> <file type="web" url="file://$PROJECT_DIR$" />
</component> </component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="17 (5)" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="corretto-17" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" /> <output url="file://$PROJECT_DIR$/out" />
</component> </component>
</project> </project>

View File

@ -19,6 +19,8 @@ provides the following transports:
### Note on version compatibility ### Note on version compatibility
Version 0.5.1 could be backward incompatible due to upgrade of the crypto2.
Protocols >= 0.3.0 are not binary compatible with previous version due to more compact binary Protocols >= 0.3.0 are not binary compatible with previous version due to more compact binary
format. The format from 0.3.0 onwards is supposed to keep compatible. format. The format from 0.3.0 onwards is supposed to keep compatible.

View File

@ -8,7 +8,7 @@ plugins {
} }
group = "net.sergeych" group = "net.sergeych"
version = "0.4.6-SNAPSHOT" version = "0.5.1-SNAPSHOT"
repositories { repositories {
mavenCentral() mavenCentral()
@ -28,13 +28,15 @@ kotlin {
} }
nodejs() nodejs()
} }
macosArm64() // macosArm64()
iosX64() // iosX64()
iosArm64() // iosArm64()
iosSimulatorArm64() // iosSimulatorArm64()
linuxX64() linuxX64()
linuxArm64() linuxArm64()
macosX64() // macosX64()
// macosX64()
mingwX64()
val ktor_version = "2.3.12" val ktor_version = "2.3.12"
@ -50,7 +52,7 @@ kotlin {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1") implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.2") implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.2")
api("io.ktor:ktor-client-core:$ktor_version") api("io.ktor:ktor-client-core:$ktor_version")
api("net.sergeych:crypto2:0.5.7") api("net.sergeych:crypto2:0.7.1+")
} }
} }
val ktorSocketMain by creating { val ktorSocketMain by creating {
@ -89,27 +91,27 @@ kotlin {
} }
} }
val jsTest by getting val jsTest by getting
val macosArm64Main by getting { // val macosArm64Main by getting {
dependsOn(ktorSocketMain) // dependsOn(ktorSocketMain)
} // }
val macosArm64Test by getting { // val macosArm64Test by getting {
dependsOn(ktorSocketTest) // dependsOn(ktorSocketTest)
} // }
val macosX64Main by getting { // val macosX64Main by getting {
dependsOn(ktorSocketMain) // dependsOn(ktorSocketMain)
} // }
val iosX64Main by getting { // val iosX64Main by getting {
dependsOn(ktorSocketMain) // dependsOn(ktorSocketMain)
} // }
val iosX64Test by getting { // val iosX64Test by getting {
dependsOn(ktorSocketTest) // dependsOn(ktorSocketTest)
} // }
val iosArm64Main by getting { // val iosArm64Main by getting {
dependsOn(ktorSocketMain) // dependsOn(ktorSocketMain)
} // }
val iosArm64Test by getting { // val iosArm64Test by getting {
dependsOn(ktorSocketTest) // dependsOn(ktorSocketTest)
} // }
val linuxArm64Main by getting { val linuxArm64Main by getting {
dependsOn(ktorSocketMain) dependsOn(ktorSocketMain)
} }

View File

@ -22,7 +22,7 @@ import net.sergeych.tools.AtomicCounter
private val counter = AtomicCounter() private val counter = AtomicCounter()
/** /**
* Shortcut to create websocket client. Use [webSocketTransportDevice] with [KiloClient] * Shortcut to create websocket client. Use [websocketTransportDevice] with [KiloClient]
* for fine-grained control. * for fine-grained control.
*/ */
fun <S> websocketClient( fun <S> websocketClient(
@ -35,7 +35,7 @@ fun <S> websocketClient(
}, },
): KiloClient<S> { ): KiloClient<S> {
return KiloClient(clientInterface, secretKey) { return KiloClient(clientInterface, secretKey) {
KiloConnectionData(webSocketTransportDevice(path), sessionMaker()) KiloConnectionData(websocketTransportDevice(path), sessionMaker())
} }
} }
@ -44,7 +44,7 @@ fun <S> websocketClient(
* @param path websocket path (must start with ws:// or wss:// and contain a path part) * @param path websocket path (must start with ws:// or wss:// and contain a path part)
* @client use default [HttpClient], it installs [WebSockets] plugin * @client use default [HttpClient], it installs [WebSockets] plugin
*/ */
fun webSocketTransportDevice( fun websocketTransportDevice(
path: String, path: String,
client: HttpClient = HttpClient { install(WebSockets) }, client: HttpClient = HttpClient { install(WebSockets) },
): Transport.Device { ): Transport.Device {