Skip to content

Commit

Permalink
modify attachLdSignature
Browse files Browse the repository at this point in the history
  • Loading branch information
tamaina committed Jul 17, 2024
1 parent c00b61e commit 29d9bbf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/backend/src/core/RelayService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
4 changes: 1 addition & 3 deletions packages/backend/src/core/activitypub/ApRendererService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 29d9bbf

Please sign in to comment.