upstash / qstash-js

Message queue for serverless
https://docs.upstash.com/qstash
MIT License
133 stars 11 forks source link

Workflow: verify requests in workflow #119

Closed CahidArda closed 2 days ago

CahidArda commented 2 days ago

Add request verificaton to workflow. Basically every request except the first one are validated to make sure that they are coming from QStash. The first request will be coming from the user so it's not validated.

Note that the functions and their parameters are internal. We will offer a simpler API to the user like

const options: {
  receiver?: Receiver
} = {
  // ...
};

client.serve(async (context) => {
  //  workflow steps...
}, options);

passing options will be optional, if receiver is not passed, it will be created from the env variables, if the env variables are not set, we will print a warning message Warning: QStash Workflow wasn't passed a receiver to verify the requests. as in this PR.

linear[bot] commented 2 days ago

DX-999 QStash workflow - feedback / sdk design

CahidArda commented 2 days ago

on our discussion today, we decided to not have verification. Therefore, closing this PR.