Skip to content

Commit

Permalink
fix: add debug-level logging at integrity check
Browse files Browse the repository at this point in the history
  • Loading branch information
domwebber committed Dec 4, 2023
1 parent 1513cdd commit b649fe4
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/CloudAPI/CloudAPIWebhook/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,15 @@ export default class CloudAPIWebhook extends AbstractAPI {
const generatedSignature = createHmac("sha256", appSecret)
.update(bodyString)
.digest("hex");
return xHubSignature === generatedSignature;

const isAuthentic = xHubSignature === generatedSignature;
this._logger?.debug(
`Comparing signatures for integrity check: ${xHubSignature} === ${generatedSignature} (${
isAuthentic ? "true" : "false"
})`,
);

return isAuthentic;
};

return {
Expand Down

0 comments on commit b649fe4

Please sign in to comment.