diff --git a/index.js b/index.js index 4822a7e..9016b03 100644 --- a/index.js +++ b/index.js @@ -72,6 +72,8 @@ client.connect({ useNewUrlParser: true }) return pub.actor.createLocalActor('dummy', 'Person') }) .then(dummy => { + // shortcut to be able to sign GETs, will be factored out via activitypub-express + global.guppeSystemUser = dummy return store.setup(DOMAIN, dummy) }) .then(() => { diff --git a/pub/federation.js b/pub/federation.js index 4fe2d34..4e139ec 100644 --- a/pub/federation.js +++ b/pub/federation.js @@ -13,7 +13,12 @@ function requestObject (id) { return request({ url: id, headers: { Accept: 'application/activity+json' }, - json: true + httpSignature: { + key: global.guppeSystemUser._meta.privateKey, + keyId: global.guppeSystemUser.id, + headers: ['(request-target)', 'host', 'date'], + authorizationHeaderName: 'Signature' + } }) }