mirror of
https://github.com/versia-pub/server.git
synced 2026-04-27 20:59:15 +02:00
fix(federation): 🚑 Don't always try to use instance key when an instance is not the request signer
This commit is contained in:
parent
34370a082a
commit
005a3a2721
3 changed files with 28 additions and 16 deletions
13
worker.ts
13
worker.ts
|
|
@ -177,10 +177,21 @@ export const inboxWorker = new Worker<InboxJobData, Response, InboxJobType>(
|
|||
remoteInstance.data.baseUrl,
|
||||
)}`;
|
||||
|
||||
if (!remoteInstance.data.publicKey?.key) {
|
||||
throw new Error(
|
||||
`Instance ${remoteInstance.data.baseUrl} has no public key stored in database`,
|
||||
);
|
||||
}
|
||||
|
||||
const processor = new InboxProcessor(
|
||||
request,
|
||||
data,
|
||||
remoteInstance,
|
||||
{
|
||||
instance: remoteInstance,
|
||||
key:
|
||||
sender?.data.publicKey ??
|
||||
remoteInstance.data.publicKey.key,
|
||||
},
|
||||
{
|
||||
signature,
|
||||
nonce,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue