From 9943809bfc05d50627adf560dd2ab1241fbaae7b Mon Sep 17 00:00:00 2001 From: usbharu <64310155+usbharu@users.noreply.github.com> Date: Mon, 23 Oct 2023 13:39:30 +0900 Subject: [PATCH] style: fix lint --- .../dev/usbharu/hideout/controller/NoteApControllerImpl.kt | 4 +++- .../usbharu/hideout/query/activitypub/NoteQueryServiceImpl.kt | 1 - .../usbharu/hideout/service/signature/HttpSignatureFilter.kt | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/dev/usbharu/hideout/controller/NoteApControllerImpl.kt b/src/main/kotlin/dev/usbharu/hideout/controller/NoteApControllerImpl.kt index 36e27859..0c330524 100644 --- a/src/main/kotlin/dev/usbharu/hideout/controller/NoteApControllerImpl.kt +++ b/src/main/kotlin/dev/usbharu/hideout/controller/NoteApControllerImpl.kt @@ -17,7 +17,9 @@ class NoteApControllerImpl(private val noteApApiService: NoteApApiService) : Not @CurrentSecurityContext context: SecurityContext ): ResponseEntity { val userId = - if (context.authentication is PreAuthenticatedAuthenticationToken && context.authentication.details is HttpSignatureUser) { + if (context.authentication is PreAuthenticatedAuthenticationToken && + context.authentication.details is HttpSignatureUser + ) { (context.authentication.details as HttpSignatureUser).id } else { null diff --git a/src/main/kotlin/dev/usbharu/hideout/query/activitypub/NoteQueryServiceImpl.kt b/src/main/kotlin/dev/usbharu/hideout/query/activitypub/NoteQueryServiceImpl.kt index 93992395..b6affcbb 100644 --- a/src/main/kotlin/dev/usbharu/hideout/query/activitypub/NoteQueryServiceImpl.kt +++ b/src/main/kotlin/dev/usbharu/hideout/query/activitypub/NoteQueryServiceImpl.kt @@ -21,7 +21,6 @@ class NoteQueryServiceImpl(private val postRepository: PostRepository) : NoteQue .leftJoin(Media) .select { Posts.id eq id } .let { it.toNote() to it.toPost().first() } - } private suspend fun ResultRow.toNote(mediaList: List): Note { diff --git a/src/main/kotlin/dev/usbharu/hideout/service/signature/HttpSignatureFilter.kt b/src/main/kotlin/dev/usbharu/hideout/service/signature/HttpSignatureFilter.kt index 07c2b7b1..6a2444b8 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/signature/HttpSignatureFilter.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/signature/HttpSignatureFilter.kt @@ -18,9 +18,9 @@ class HttpSignatureFilter(private val httpSignatureHeaderParser: SignatureHeader val signature = try { httpSignatureHeaderParser.parse(HttpHeaders(headers)) - } catch (e: IllegalArgumentException) { + } catch (_: IllegalArgumentException) { return null - } catch (e: RuntimeException) { + } catch (_: RuntimeException) { return "" } return signature.keyId