From 0d7dfc6d270a2c1038d824f38afcd33e89a74be6 Mon Sep 17 00:00:00 2001 From: usbharu <64310155+usbharu@users.noreply.github.com> Date: Thu, 21 Dec 2023 12:06:51 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=E3=83=87=E3=83=90=E3=83=83=E3=82=B0?= =?UTF-8?q?=E7=94=A8=E3=81=AE=E3=83=88=E3=83=AC=E3=83=BC=E3=82=B9=E3=82=92?= =?UTF-8?q?=E3=82=AA=E3=83=B3=E3=83=BB=E3=82=AA=E3=83=95=E3=81=A7=E3=81=8D?= =?UTF-8?q?=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../activitypub/service/inbox/InboxJobProcessor.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 bfaf72f1..44906dc7 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 @@ -21,6 +21,7 @@ import dev.usbharu.httpsignature.verify.HttpSignatureVerifier import dev.usbharu.httpsignature.verify.Signature import dev.usbharu.httpsignature.verify.SignatureHeaderParser import org.slf4j.LoggerFactory +import org.springframework.beans.factory.annotation.Value import org.springframework.stereotype.Service @Service @@ -34,6 +35,9 @@ class InboxJobProcessor( private val transaction: Transaction ) : JobProcessor { + @Value("\${hideout.debug.trace-inbox:false}") + private var traceJson: Boolean = false + private suspend fun verifyHttpSignature( httpRequest: HttpRequest, signature: Signature, @@ -85,7 +89,10 @@ class InboxJobProcessor( val jsonNode = objectMapper.readTree(param.json) logger.info("START Process inbox. type: {}", param.type) - logger.trace("type: {}\njson: \n{}", param.type, jsonNode.toPrettyString()) + if (traceJson) { + logger.trace("type: {}\njson: \n{}", param.type, jsonNode.toPrettyString()) + } + val map = objectMapper.readValue>>(param.headers)