How can I ensure that my external adapter is only accessible by a specific contract? Does the Post express middleware in the external adapter have a header key indicating the calling smart contract? I've considered embedding a key in the contract, but given the public nature of blockchain data, it seems impractical. Any suggestions?
Here is my javascript external adapter code:
app.post("/", (req, res) => {
if (process.env.DEBUG === true) console.log("POST Data: ", req.body);
// does the "req" object has some header or something to distinguish the smart contract caller ?
createRequest(req.body, (status, result) => {
if (process.env.DEBUG === true) console.log("Result: ", result);
res.status(status).json(result);
});
});