mirror of
https://github.com/usbharu/Hideout.git
synced 2026-09-26 15:01:09 +00:00
feat: デバッグ用のトレースをオン・オフできるように
This commit is contained in:
@@ -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<InboxJobParam, InboxJob> {
|
||||
|
||||
@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<Map<String, List<String>>>(param.headers)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user