feat(federation): Log signed string to debug as well

This commit is contained in:
Jesse Wierzbinski 2024-05-23 19:46:22 -10:00
parent fd59d9ebae
commit 75043bae15
No known key found for this signature in database
2 changed files with 8 additions and 1 deletions

BIN
bun.lockb

Binary file not shown.

View file

@ -44,7 +44,7 @@ export const objectToInboxRequest = async (
body: JSON.stringify(object), body: JSON.stringify(object),
}); });
const signed = await ctor.sign(request); const { request: signed, signedString } = await ctor.sign(request);
if (config.debug.federation) { if (config.debug.federation) {
// Debug request // Debug request
@ -56,6 +56,13 @@ export const objectToInboxRequest = async (
"Inbox.Signature", "Inbox.Signature",
`Sender public key: ${author.getUser().publicKey}`, `Sender public key: ${author.getUser().publicKey}`,
); );
// Log signed string
new LogManager(Bun.stdout).log(
LogLevel.DEBUG,
"Inbox.Signature",
`Signed string:\n${signedString}`,
);
} }
return signed; return signed;