Skip to content

Commit f873132

Browse files
committed
fix ktlint errors
1 parent 4035b6e commit f873132

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

fido-android-provider-service/src/main/java/com/yubico/yubikit/fido/android/providerservice/RelatedOriginRequestsUtils.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ import javax.net.ssl.HttpsURLConnection
2626

2727
@Serializable
2828
data class WebAuthnWellKnownResponse(
29-
val origins: List<String>? = null
29+
val origins: List<String>? = null,
3030
)
3131

32-
val _logger = LoggerFactory.getLogger("RelatedOriginRequestsUtils")
32+
private val logger = LoggerFactory.getLogger("RelatedOriginRequestsUtils")
3333

3434
internal suspend fun fetchWebauthnWellKnown(rpId: String): String =
3535
withContext(Dispatchers.IO) {
3636
val url = URL("https://$rpId/.well-known/webauthn")
37-
_logger.debug("Reading {}", url)
37+
logger.debug("Reading {}", url)
3838
val conn = url.openConnection() as HttpsURLConnection
3939

4040
conn.requestMethod = "GET"
@@ -52,7 +52,7 @@ internal suspend fun fetchWebauthnWellKnown(rpId: String): String =
5252
}
5353
conn.inputStream.bufferedReader().use { it.readText() }
5454
} catch (e: Throwable) {
55-
_logger.debug("Failed read {}", url, e)
55+
logger.debug("Failed read {}", url, e)
5656
throw e
5757
} finally {
5858
conn.disconnect()
@@ -62,17 +62,17 @@ internal suspend fun fetchWebauthnWellKnown(rpId: String): String =
6262
// Main validation function
6363
suspend fun validateOrigin(
6464
callerOrigin: String,
65-
rpId: String
65+
rpId: String,
6666
): String {
6767
runCatching {
6868
val body = fetchWebauthnWellKnown(rpId)
6969

7070
val parsed: WebAuthnWellKnownResponse =
7171
Json.decodeFromString(WebAuthnWellKnownResponse.serializer(), body)
7272
parsed.origins?.let {
73-
_logger.debug("There are {} related origins: {}", it.size, it)
73+
logger.debug("There are {} related origins: {}", it.size, it)
7474
if (it.contains(callerOrigin)) {
75-
_logger.debug("Found caller origin in related origins")
75+
logger.debug("Found caller origin in related origins")
7676
return "https://$rpId"
7777
}
7878
}

0 commit comments

Comments
 (0)