mirror of https://github.com/usbharu/Hideout.git
feat: デバッグ用のトレースをオン・オフできるように
This commit is contained in:
parent
a36d937239
commit
0d7dfc6d27
|
@ -21,6 +21,7 @@ import dev.usbharu.httpsignature.verify.HttpSignatureVerifier
|
||||||
import dev.usbharu.httpsignature.verify.Signature
|
import dev.usbharu.httpsignature.verify.Signature
|
||||||
import dev.usbharu.httpsignature.verify.SignatureHeaderParser
|
import dev.usbharu.httpsignature.verify.SignatureHeaderParser
|
||||||
import org.slf4j.LoggerFactory
|
import org.slf4j.LoggerFactory
|
||||||
|
import org.springframework.beans.factory.annotation.Value
|
||||||
import org.springframework.stereotype.Service
|
import org.springframework.stereotype.Service
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
|
@ -34,6 +35,9 @@ class InboxJobProcessor(
|
||||||
private val transaction: Transaction
|
private val transaction: Transaction
|
||||||
) : JobProcessor<InboxJobParam, InboxJob> {
|
) : JobProcessor<InboxJobParam, InboxJob> {
|
||||||
|
|
||||||
|
@Value("\${hideout.debug.trace-inbox:false}")
|
||||||
|
private var traceJson: Boolean = false
|
||||||
|
|
||||||
private suspend fun verifyHttpSignature(
|
private suspend fun verifyHttpSignature(
|
||||||
httpRequest: HttpRequest,
|
httpRequest: HttpRequest,
|
||||||
signature: Signature,
|
signature: Signature,
|
||||||
|
@ -85,7 +89,10 @@ class InboxJobProcessor(
|
||||||
val jsonNode = objectMapper.readTree(param.json)
|
val jsonNode = objectMapper.readTree(param.json)
|
||||||
|
|
||||||
logger.info("START Process inbox. type: {}", param.type)
|
logger.info("START Process inbox. type: {}", param.type)
|
||||||
|
if (traceJson) {
|
||||||
logger.trace("type: {}\njson: \n{}", param.type, jsonNode.toPrettyString())
|
logger.trace("type: {}\njson: \n{}", param.type, jsonNode.toPrettyString())
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
val map = objectMapper.readValue<Map<String, List<String>>>(param.headers)
|
val map = objectMapper.readValue<Map<String, List<String>>>(param.headers)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue