hacky way to sign GETs fix #29
This commit is contained in:
parent
5208b67df5
commit
18c024801c
2 changed files with 8 additions and 1 deletions
2
index.js
2
index.js
|
@ -72,6 +72,8 @@ client.connect({ useNewUrlParser: true })
|
||||||
return pub.actor.createLocalActor('dummy', 'Person')
|
return pub.actor.createLocalActor('dummy', 'Person')
|
||||||
})
|
})
|
||||||
.then(dummy => {
|
.then(dummy => {
|
||||||
|
// shortcut to be able to sign GETs, will be factored out via activitypub-express
|
||||||
|
global.guppeSystemUser = dummy
|
||||||
return store.setup(DOMAIN, dummy)
|
return store.setup(DOMAIN, dummy)
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
|
|
@ -13,7 +13,12 @@ function requestObject (id) {
|
||||||
return request({
|
return request({
|
||||||
url: id,
|
url: id,
|
||||||
headers: { Accept: 'application/activity+json' },
|
headers: { Accept: 'application/activity+json' },
|
||||||
json: true
|
httpSignature: {
|
||||||
|
key: global.guppeSystemUser._meta.privateKey,
|
||||||
|
keyId: global.guppeSystemUser.id,
|
||||||
|
headers: ['(request-target)', 'host', 'date'],
|
||||||
|
authorizationHeaderName: 'Signature'
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue