modify attachLdSignature
This commit is contained in:
parent
c00b61e90b
commit
29d9bbf05b
packages/backend/src/core
|
@ -125,7 +125,7 @@ export class RelayService {
|
|||
const copy = deepClone(activity);
|
||||
if (!copy.to) copy.to = ['https://www.w3.org/ns/activitystreams#Public'];
|
||||
privateKey = privateKey ?? await this.userKeypairService.getLocalUserPrivateKeyPem(user.id);
|
||||
const signed = await this.apRendererService.attachLdSignature(copy, user, privateKey);
|
||||
const signed = await this.apRendererService.attachLdSignature(copy, privateKey);
|
||||
|
||||
this.queueService.deliverMany(user, signed, new Map(relays.map(({ inbox }) => [inbox, false])), privateKey);
|
||||
}
|
||||
|
|
|
@ -625,9 +625,7 @@ export class ApRendererService {
|
|||
}
|
||||
|
||||
@bindThis
|
||||
public async attachLdSignature(activity: any, user: { id: MiUser['id']; host: null; }, key: PrivateKeyWithPem): Promise<IActivity> {
|
||||
const keypair = await this.userKeypairService.getUserKeypair(user.id);
|
||||
|
||||
public async attachLdSignature(activity: any, key: PrivateKeyWithPem): Promise<IActivity> {
|
||||
const jsonLd = this.jsonLdService.use();
|
||||
jsonLd.debug = false;
|
||||
activity = await jsonLd.signRsaSignature2017(activity, key.privateKeyPem, key.keyId);
|
||||
|
|
Loading…
Reference in New Issue