Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -9,7 +9,7 @@ import io.ktor.util.encodeBase64
override fun apply(query: MutableMap<String, List<String>>, headers: MutableMap<String, String>) {
if (username == null && password == null) return
val str = (username ?: "") + ":" + (password ?: "")
val auth = str.encodeBase64()
val auth = Base64.encode(str.encodeToByteArray())
headers["Authorization"] = "Basic $auth"
}
}
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -9,7 +9,7 @@ import io.ktor.util.encodeBase64
override fun apply(query: MutableMap<String, List<String>>, headers: MutableMap<String, String>) {
if (username == null && password == null) return
val str = (username ?: "") + ":" + (password ?: "")
val auth = str.encodeBase64()
val auth = Base64.encode(str.encodeToByteArray())
headers["Authorization"] = "Basic $auth"
}
}
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -9,7 +9,7 @@ class HttpBasicAuth : Authentication {
override fun apply(query: MutableMap<String, List<String>>, headers: MutableMap<String, String>) {
if (username == null && password == null) return
val str = (username ?: "") + ":" + (password ?: "")
val auth = str.encodeBase64()
val auth = Base64.encode(str.encodeToByteArray())
headers["Authorization"] = "Basic $auth"
}
}
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -9,7 +9,7 @@ class HttpBasicAuth : Authentication {
override fun apply(query: MutableMap<String, List<String>>, headers: MutableMap<String, String>) {
if (username == null && password == null) return
val str = (username ?: "") + ":" + (password ?: "")
val auth = str.encodeBase64()
val auth = Base64.encode(str.encodeToByteArray())
headers["Authorization"] = "Basic $auth"
}
}
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -9,7 +9,7 @@ class HttpBasicAuth : Authentication {
override fun apply(query: MutableMap<String, List<String>>, headers: MutableMap<String, String>) {
if (username == null && password == null) return
val str = (username ?: "") + ":" + (password ?: "")
val auth = str.encodeBase64()
val auth = Base64.encode(str.encodeToByteArray())
headers["Authorization"] = "Basic $auth"
}
}
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -9,7 +9,7 @@ class HttpBasicAuth : Authentication {
override fun apply(query: MutableMap<String, List<String>>, headers: MutableMap<String, String>) {
if (username == null && password == null) return
val str = (username ?: "") + ":" + (password ?: "")
val auth = str.encodeBase64()
val auth = Base64.encode(str.encodeToByteArray())
headers["Authorization"] = "Basic $auth"
}
}
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -9,7 +9,7 @@ class HttpBasicAuth : Authentication {
override fun apply(query: MutableMap<String, List<String>>, headers: MutableMap<String, String>) {
if (username == null && password == null) return
val str = (username ?: "") + ":" + (password ?: "")
val auth = str.encodeBase64()
val auth = Base64.encode(str.encodeToByteArray())
headers["Authorization"] = "Basic $auth"
}
}
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -9,7 +9,7 @@ class HttpBasicAuth : Authentication {
override fun apply(query: MutableMap<String, List<String>>, headers: MutableMap<String, String>) {
if (username == null && password == null) return
val str = (username ?: "") + ":" + (password ?: "")
val auth = str.encodeBase64()
val auth = Base64.encode(str.encodeToByteArray())
headers["Authorization"] = "Basic $auth"
}
}
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -9,7 +9,7 @@ class HttpBasicAuth : Authentication {
override fun apply(query: MutableMap<String, List<String>>, headers: MutableMap<String, String>) {
if (username == null && password == null) return
val str = (username ?: "") + ":" + (password ?: "")
val auth = str.encodeBase64()
val auth = Base64.encode(str.encodeToByteArray())
headers["Authorization"] = "Basic $auth"
}
}
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -9,7 +9,7 @@ class HttpBasicAuth : Authentication {
override fun apply(query: MutableMap<String, List<String>>, headers: MutableMap<String, String>) {
if (username == null && password == null) return
val str = (username ?: "") + ":" + (password ?: "")
val auth = str.encodeBase64()
val auth = Base64.encode(str.encodeToByteArray())
headers["Authorization"] = "Basic $auth"
}
}
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -9,7 +9,7 @@ class HttpBasicAuth : Authentication {
override fun apply(query: MutableMap<String, List<String>>, headers: MutableMap<String, String>) {
if (username == null && password == null) return
val str = (username ?: "") + ":" + (password ?: "")
val auth = str.encodeBase64()
val auth = Base64.encode(str.encodeToByteArray())
headers["Authorization"] = "Basic $auth"
}
}
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -9,7 +9,7 @@ class HttpBasicAuth : Authentication {
override fun apply(query: MutableMap<String, List<String>>, headers: MutableMap<String, String>) {
if (username == null && password == null) return
val str = (username ?: "") + ":" + (password ?: "")
val auth = str.encodeBase64()
val auth = Base64.encode(str.encodeToByteArray())
headers["Authorization"] = "Basic $auth"
}
}
Loading