From 96402acf1cd4c1a6fd69b852edc0a4ece138965c Mon Sep 17 00:00:00 2001 From: usbharu Date: Sun, 3 Dec 2023 16:15:55 +0900 Subject: [PATCH] Apply suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .../hideout/activitypub/service/inbox/InboxJobProcessor.kt | 1 - .../dev/usbharu/hideout/application/config/SecurityConfig.kt | 2 -- .../core/infrastructure/httpsignature/HttpRequestMixIn.kt | 5 ----- 3 files changed, 8 deletions(-) diff --git a/src/main/kotlin/dev/usbharu/hideout/activitypub/service/inbox/InboxJobProcessor.kt b/src/main/kotlin/dev/usbharu/hideout/activitypub/service/inbox/InboxJobProcessor.kt index 91c3f4ed..b707e5e6 100644 --- a/src/main/kotlin/dev/usbharu/hideout/activitypub/service/inbox/InboxJobProcessor.kt +++ b/src/main/kotlin/dev/usbharu/hideout/activitypub/service/inbox/InboxJobProcessor.kt @@ -81,7 +81,6 @@ class InboxJobProcessor( } override suspend fun process(param: InboxJobParam) { - val jsonNode = objectMapper.readTree(param.json) logger.info("START Process inbox. type: {}", param.type) diff --git a/src/main/kotlin/dev/usbharu/hideout/application/config/SecurityConfig.kt b/src/main/kotlin/dev/usbharu/hideout/application/config/SecurityConfig.kt index aa60fa16..c0f0bbff 100644 --- a/src/main/kotlin/dev/usbharu/hideout/application/config/SecurityConfig.kt +++ b/src/main/kotlin/dev/usbharu/hideout/application/config/SecurityConfig.kt @@ -63,7 +63,6 @@ import java.security.interfaces.RSAPrivateKey import java.security.interfaces.RSAPublicKey import java.util.* - @EnableWebSecurity(debug = false) @Configuration @Suppress("FunctionMaxLength", "TooManyFunctions") @@ -285,7 +284,6 @@ data class JwkConfig( val privateKey: String ) - @Configuration class PostSecurityConfig( val auth: AuthenticationManagerBuilder, diff --git a/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/httpsignature/HttpRequestMixIn.kt b/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/httpsignature/HttpRequestMixIn.kt index 3686d3c9..4f998d91 100644 --- a/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/httpsignature/HttpRequestMixIn.kt +++ b/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/httpsignature/HttpRequestMixIn.kt @@ -11,23 +11,18 @@ import dev.usbharu.httpsignature.common.HttpMethod import dev.usbharu.httpsignature.common.HttpRequest import java.net.URL - @JsonDeserialize(using = HttpRequestDeserializer::class) @JsonSubTypes abstract class HttpRequestMixIn class HttpRequestDeserializer : JsonDeserializer() { override fun deserialize(p: JsonParser, ctxt: DeserializationContext?): HttpRequest { - val readTree: JsonNode = p.codec.readTree(p) - - return HttpRequest( URL(readTree["url"].textValue()), HttpHeaders(emptyMap()), HttpMethod.valueOf(readTree["method"].textValue()) ) } - }