strapi-plugin-website-builder
strapi-plugin-website-builder copied to clipboard
Support Signature in header
Either we add something like this in config:
config: {
...
secret: {
headerKey: "X-Hub-Signature",
hash: "sha1",
secret: "SomeSecret",
},
...
}
and add something like this
function createHmacSignature(req, hash, secretKey) {
return require("crypto")
.createHmac(hash, secretKey)
.update(JSON.stringify(req.body))
.digest("hex");
}
or have headers object accept functions
config: {
...
headers: {
"X-Hub-Signature": (req) => "someValue",
},
...
}
I will try something
Hello @YassineElbouchaibi,
I am okay with the first method. Thank you very much for the PR!
I have left some comments regarding some required changes, let me know if any further clarification is needed.