秘密鍵の変更は、フラグではなく鍵を引き回すようにする

This commit is contained in:
tamaina 2024-03-05 11:57:43 +00:00
parent 6e4357c378
commit 430f0b7911
9 changed files with 82 additions and 53 deletions

View file

@ -76,16 +76,14 @@ export class DeliverProcessorService {
await this.fetchInstanceMetadataService.fetchInstanceMetadata(_server).then(() => {});
const server = await this.federatedInstanceService.fetch(host);
/**
* RSAキーを強制するかでレベルを変える
*/
const level = job.data.forceMainKey ?
server.httpMessageSignaturesImplementationLevel === '11' ?
'10' :
'00'
: server.httpMessageSignaturesImplementationLevel;
await this.apRequestService.signedPost(job.data.user, job.data.to, job.data.content, level, job.data.digest);
await this.apRequestService.signedPost(
job.data.user,
job.data.to,
job.data.content,
server.httpMessageSignaturesImplementationLevel,
job.data.digest,
job.data.privateKey,
);
// Update stats
if (server.isNotResponding) {

View file

@ -8,7 +8,7 @@ import type { MiDriveFile } from '@/models/DriveFile.js';
import type { MiNote } from '@/models/Note.js';
import type { MiUser } from '@/models/User.js';
import type { MiWebhook } from '@/models/Webhook.js';
import type { IActivity } from '@/core/activitypub/type.js';
import type { IActivity, PrivateKey } from '@/core/activitypub/type.js';
import type { ParsedSignature } from '@misskey-dev/node-http-message-signatures';
/**
@ -39,7 +39,7 @@ export type DeliverJobData = {
/** whether it is sharedInbox */
isSharedInbox: boolean;
/** force to use main (rsa) key */
forceMainKey?: boolean;
privateKey?: PrivateKey;
};
export type InboxJobData = {