aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/java/com/juick/server/SignatureManager.java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-10-04 17:21:15 +0300
committerGravatar Vitaly Takmazov2018-10-04 17:21:15 +0300
commit57526badc0913195fa7996e49da9cd4e54b6c1ca (patch)
treeaaa1707d760e015c4883ee4d9157a0f296a63933 /juick-server/src/main/java/com/juick/server/SignatureManager.java
parent9fd4ce97047f8c4ffd2bd3374b0288b53580f34b (diff)
log outgoing Acitivities
Diffstat (limited to 'juick-server/src/main/java/com/juick/server/SignatureManager.java')
-rw-r--r--juick-server/src/main/java/com/juick/server/SignatureManager.java4
1 files changed, 4 insertions, 0 deletions
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<Context> 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<Void> response = new RestTemplate().postForEntity(inbox, request, Void.class);
logger.info("accepted follower: {}", response.getStatusCodeValue());
}