Skip to content

Commit

Permalink
feat(federation): ✨ Log signed string to debug as well
Browse files Browse the repository at this point in the history
  • Loading branch information
CPlusPatch committed May 24, 2024
1 parent fd59d9e commit 75043ba
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Binary file modified bun.lockb
Binary file not shown.
9 changes: 8 additions & 1 deletion database/entities/Federation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const objectToInboxRequest = async (
body: JSON.stringify(object),
});

const signed = await ctor.sign(request);
const { request: signed, signedString } = await ctor.sign(request);

if (config.debug.federation) {
// Debug request
Expand All @@ -56,6 +56,13 @@ export const objectToInboxRequest = async (
"Inbox.Signature",
`Sender public key: ${author.getUser().publicKey}`,
);

// Log signed string
new LogManager(Bun.stdout).log(
LogLevel.DEBUG,
"Inbox.Signature",
`Signed string:\n${signedString}`,
);
}

return signed;
Expand Down

0 comments on commit 75043ba

Please sign in to comment.