You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am running cloudconvert from within Cloudflare. I'm basically just pulling out all the types from it as the Axios client does work in the environment properly. Looking forward to the fetch implementation. All that aside, I wanted to share a code snippet for consideration of inclusion into the client.
The crypto library is not implemented in cloudflare and so I whipped together this implementation.
"@types/jsrsasign": "^10.5.13",
import{KJUR}from"jsrsasign";exportfunctionverifyWebhookSignature(payloadString: string,signature: string,signingSecret: string): boolean{// Create the HMAC object with SHA256consthmacObj=newKJUR.crypto.Mac({alg: "HmacSHA256",pass: {utf8: signingSecret}});// Update the HMAC with the payloadhmacObj.updateString(payloadString);// Get the HMAC in hexadecimal formatconstsigned=hmacObj.doFinal();// Compare the computed HMAC to the provided signaturereturnsignature===signed;}
The text was updated successfully, but these errors were encountered:
I am running cloudconvert from within Cloudflare. I'm basically just pulling out all the types from it as the Axios client does work in the environment properly. Looking forward to the fetch implementation. All that aside, I wanted to share a code snippet for consideration of inclusion into the client.
The crypto library is not implemented in cloudflare and so I whipped together this implementation.
"@types/jsrsasign": "^10.5.13",
The text was updated successfully, but these errors were encountered: