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)