From 57526badc0913195fa7996e49da9cd4e54b6c1ca Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 4 Oct 2018 17:21:15 +0300 Subject: log outgoing Acitivities --- juick-server/src/main/java/com/juick/server/SignatureManager.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'juick-server/src/main/java/com/juick/server/SignatureManager.java') diff --git a/juick-server/src/main/java/com/juick/server/SignatureManager.java b/juick-server/src/main/java/com/juick/server/SignatureManager.java index 98ccc24d..2361a65b 100644 --- a/juick-server/src/main/java/com/juick/server/SignatureManager.java +++ b/juick-server/src/main/java/com/juick/server/SignatureManager.java @@ -1,5 +1,6 @@ package com.juick.server; +import com.fasterxml.jackson.databind.ObjectMapper; import com.juick.server.api.activity.model.Context; import com.juick.server.api.activity.model.Person; import org.slf4j.Logger; @@ -33,6 +34,8 @@ public class SignatureManager { private static final Logger logger = LoggerFactory.getLogger(ActivityPubManager.class); @Inject private KeystoreManager keystoreManager; + @Inject + private ObjectMapper jsonMapper; public void post(Person from, Person to, Context data) throws IOException { UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.fromUriString(to.getInbox()); @@ -53,6 +56,7 @@ public class SignatureManager { HttpEntity request = new HttpEntity<>(Context.build(data), requestHeaders); //boolean valid = verifySignature(Signature.fromString(requestHeaders.getFirst("Signature")), // keystoreManager.getPublicKey(), "POST", inbox.getPath(), headers); + logger.info("Sending context: {}", jsonMapper.writeValueAsString(data)); ResponseEntity response = new RestTemplate().postForEntity(inbox, request, Void.class); logger.info("accepted follower: {}", response.getStatusCodeValue()); } -- cgit v1.2.3