chore(federation): Add sender public key to federation debugging

This commit is contained in:
Jesse Wierzbinski 2024-05-23 19:04:05 -10:00
parent f5605e6814
commit fc98c95892
No known key found for this signature in database
3 changed files with 18 additions and 3 deletions

View file

@ -5,6 +5,7 @@ import {
} from "@lysand-org/federation";
import { config } from "config-manager";
import type { User } from "~packages/database-interface/user";
import { LogLevel, LogManager } from "~packages/log-manager";
export const localObjectURI = (id: string) =>
new URL(`/objects/${id}`, config.http.base_url).toString();
@ -48,6 +49,13 @@ export const objectToInboxRequest = async (
if (config.debug.federation) {
// Debug request
await debugRequest(signed);
// Log public key
new LogManager(Bun.stdout).log(
LogLevel.DEBUG,
"Inbox.Signature",
`Sender public key: ${author.getUser().publicKey}`,
);
}
return signed;