aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src
diff options
context:
space:
mode:
Diffstat (limited to 'juick-server/src')
-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());
}