hacky way to sign GETs fix #29

This commit is contained in:
Will Murphy 2020-10-24 20:33:45 -05:00
parent 5208b67df5
commit 18c024801c
2 changed files with 8 additions and 1 deletions

View file

@ -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(() => {

View file

@ -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'
}
})
}