diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/auth/HttpBasicAuth.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/auth/HttpBasicAuth.kt.mustache index 0e3dba003ef0..c18b30352f05 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/auth/HttpBasicAuth.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/auth/HttpBasicAuth.kt.mustache @@ -1,6 +1,6 @@ package {{packageName}}.auth -import io.ktor.util.encodeBase64 +import kotlin.io.encoding.Base64 {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class HttpBasicAuth : Authentication { {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}var username: String? = null @@ -9,7 +9,7 @@ import io.ktor.util.encodeBase64 override fun apply(query: MutableMap>, headers: MutableMap) { if (username == null && password == null) return val str = (username ?: "") + ":" + (password ?: "") - val auth = str.encodeBase64() + val auth = Base64.encode(str.encodeToByteArray()) headers["Authorization"] = "Basic $auth" } } diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/auth/HttpBasicAuth.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/auth/HttpBasicAuth.kt.mustache index 0e3dba003ef0..c18b30352f05 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/auth/HttpBasicAuth.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/auth/HttpBasicAuth.kt.mustache @@ -1,6 +1,6 @@ package {{packageName}}.auth -import io.ktor.util.encodeBase64 +import kotlin.io.encoding.Base64 {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class HttpBasicAuth : Authentication { {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}var username: String? = null @@ -9,7 +9,7 @@ import io.ktor.util.encodeBase64 override fun apply(query: MutableMap>, headers: MutableMap) { if (username == null && password == null) return val str = (username ?: "") + ":" + (password ?: "") - val auth = str.encodeBase64() + val auth = Base64.encode(str.encodeToByteArray()) headers["Authorization"] = "Basic $auth" } } diff --git a/samples/client/petstore/kotlin-array-simple-string-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt b/samples/client/petstore/kotlin-array-simple-string-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt index 7c4761bbd6f7..b4aecdc99658 100644 --- a/samples/client/petstore/kotlin-array-simple-string-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt +++ b/samples/client/petstore/kotlin-array-simple-string-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt @@ -1,6 +1,6 @@ package org.openapitools.client.auth -import io.ktor.util.encodeBase64 +import kotlin.io.encoding.Base64 class HttpBasicAuth : Authentication { var username: String? = null @@ -9,7 +9,7 @@ class HttpBasicAuth : Authentication { override fun apply(query: MutableMap>, headers: MutableMap) { if (username == null && password == null) return val str = (username ?: "") + ":" + (password ?: "") - val auth = str.encodeBase64() + val auth = Base64.encode(str.encodeToByteArray()) headers["Authorization"] = "Basic $auth" } } diff --git a/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt index 7c4761bbd6f7..b4aecdc99658 100644 --- a/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt +++ b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt @@ -1,6 +1,6 @@ package org.openapitools.client.auth -import io.ktor.util.encodeBase64 +import kotlin.io.encoding.Base64 class HttpBasicAuth : Authentication { var username: String? = null @@ -9,7 +9,7 @@ class HttpBasicAuth : Authentication { override fun apply(query: MutableMap>, headers: MutableMap) { if (username == null && password == null) return val str = (username ?: "") + ":" + (password ?: "") - val auth = str.encodeBase64() + val auth = Base64.encode(str.encodeToByteArray()) headers["Authorization"] = "Basic $auth" } } diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt b/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt index 7c4761bbd6f7..b4aecdc99658 100644 --- a/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt +++ b/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt @@ -1,6 +1,6 @@ package org.openapitools.client.auth -import io.ktor.util.encodeBase64 +import kotlin.io.encoding.Base64 class HttpBasicAuth : Authentication { var username: String? = null @@ -9,7 +9,7 @@ class HttpBasicAuth : Authentication { override fun apply(query: MutableMap>, headers: MutableMap) { if (username == null && password == null) return val str = (username ?: "") + ":" + (password ?: "") - val auth = str.encodeBase64() + val auth = Base64.encode(str.encodeToByteArray()) headers["Authorization"] = "Basic $auth" } } diff --git a/samples/client/petstore/kotlin-enum-integers-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt b/samples/client/petstore/kotlin-enum-integers-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt index 7c4761bbd6f7..b4aecdc99658 100644 --- a/samples/client/petstore/kotlin-enum-integers-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt +++ b/samples/client/petstore/kotlin-enum-integers-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt @@ -1,6 +1,6 @@ package org.openapitools.client.auth -import io.ktor.util.encodeBase64 +import kotlin.io.encoding.Base64 class HttpBasicAuth : Authentication { var username: String? = null @@ -9,7 +9,7 @@ class HttpBasicAuth : Authentication { override fun apply(query: MutableMap>, headers: MutableMap) { if (username == null && password == null) return val str = (username ?: "") + ":" + (password ?: "") - val auth = str.encodeBase64() + val auth = Base64.encode(str.encodeToByteArray()) headers["Authorization"] = "Basic $auth" } } diff --git a/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt b/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt index 7c4761bbd6f7..b4aecdc99658 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt +++ b/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt @@ -1,6 +1,6 @@ package org.openapitools.client.auth -import io.ktor.util.encodeBase64 +import kotlin.io.encoding.Base64 class HttpBasicAuth : Authentication { var username: String? = null @@ -9,7 +9,7 @@ class HttpBasicAuth : Authentication { override fun apply(query: MutableMap>, headers: MutableMap) { if (username == null && password == null) return val str = (username ?: "") + ":" + (password ?: "") - val auth = str.encodeBase64() + val auth = Base64.encode(str.encodeToByteArray()) headers["Authorization"] = "Basic $auth" } } diff --git a/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt b/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt index 7c4761bbd6f7..b4aecdc99658 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt +++ b/samples/client/petstore/kotlin-jvm-ktor-jackson/src/main/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt @@ -1,6 +1,6 @@ package org.openapitools.client.auth -import io.ktor.util.encodeBase64 +import kotlin.io.encoding.Base64 class HttpBasicAuth : Authentication { var username: String? = null @@ -9,7 +9,7 @@ class HttpBasicAuth : Authentication { override fun apply(query: MutableMap>, headers: MutableMap) { if (username == null && password == null) return val str = (username ?: "") + ":" + (password ?: "") - val auth = str.encodeBase64() + val auth = Base64.encode(str.encodeToByteArray()) headers["Authorization"] = "Basic $auth" } } diff --git a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/src/main/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/src/main/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt index 7c4761bbd6f7..b4aecdc99658 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/src/main/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt +++ b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/src/main/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt @@ -1,6 +1,6 @@ package org.openapitools.client.auth -import io.ktor.util.encodeBase64 +import kotlin.io.encoding.Base64 class HttpBasicAuth : Authentication { var username: String? = null @@ -9,7 +9,7 @@ class HttpBasicAuth : Authentication { override fun apply(query: MutableMap>, headers: MutableMap) { if (username == null && password == null) return val str = (username ?: "") + ":" + (password ?: "") - val auth = str.encodeBase64() + val auth = Base64.encode(str.encodeToByteArray()) headers["Authorization"] = "Basic $auth" } } diff --git a/samples/client/petstore/kotlin-multiplatform-allOf-discriminator/src/commonMain/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt b/samples/client/petstore/kotlin-multiplatform-allOf-discriminator/src/commonMain/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt index 7c4761bbd6f7..b4aecdc99658 100644 --- a/samples/client/petstore/kotlin-multiplatform-allOf-discriminator/src/commonMain/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt +++ b/samples/client/petstore/kotlin-multiplatform-allOf-discriminator/src/commonMain/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt @@ -1,6 +1,6 @@ package org.openapitools.client.auth -import io.ktor.util.encodeBase64 +import kotlin.io.encoding.Base64 class HttpBasicAuth : Authentication { var username: String? = null @@ -9,7 +9,7 @@ class HttpBasicAuth : Authentication { override fun apply(query: MutableMap>, headers: MutableMap) { if (username == null && password == null) return val str = (username ?: "") + ":" + (password ?: "") - val auth = str.encodeBase64() + val auth = Base64.encode(str.encodeToByteArray()) headers["Authorization"] = "Basic $auth" } } diff --git a/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/src/commonMain/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt b/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/src/commonMain/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt index 7c4761bbd6f7..b4aecdc99658 100644 --- a/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/src/commonMain/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt +++ b/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/src/commonMain/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt @@ -1,6 +1,6 @@ package org.openapitools.client.auth -import io.ktor.util.encodeBase64 +import kotlin.io.encoding.Base64 class HttpBasicAuth : Authentication { var username: String? = null @@ -9,7 +9,7 @@ class HttpBasicAuth : Authentication { override fun apply(query: MutableMap>, headers: MutableMap) { if (username == null && password == null) return val str = (username ?: "") + ":" + (password ?: "") - val auth = str.encodeBase64() + val auth = Base64.encode(str.encodeToByteArray()) headers["Authorization"] = "Basic $auth" } } diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt index 7c4761bbd6f7..b4aecdc99658 100644 --- a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt @@ -1,6 +1,6 @@ package org.openapitools.client.auth -import io.ktor.util.encodeBase64 +import kotlin.io.encoding.Base64 class HttpBasicAuth : Authentication { var username: String? = null @@ -9,7 +9,7 @@ class HttpBasicAuth : Authentication { override fun apply(query: MutableMap>, headers: MutableMap) { if (username == null && password == null) return val str = (username ?: "") + ":" + (password ?: "") - val auth = str.encodeBase64() + val auth = Base64.encode(str.encodeToByteArray()) headers["Authorization"] = "Basic $auth" } }