Action handler - Do we do JWT auth in there? #6317
Replies: 1 comment
-
If 4. raises an interesting question. I guess your application code has to decide what is the appropriate behavior. If your backend is making a request "on behalf" of the client, this usually means the client is not allowed to perform this request themselves. An example I can give you is for example changing a field that needs to be validated by a computation. We would not want a user to bypass the validation. If you end up having to forward the clients token to the hasura request you are making from the server, that probably means the client could make the request themselves. The hasura permission engine is quite powerful, so it's a good idea to use it whenever possible. So far, I am using actions when I cannot leverage it. |
Beta Was this translation helpful? Give feedback.
-
Hi there
I may be incurring in an anti-pattern if so I would like to pick it up early.
The way I am validating data at the moment with actions is as follows:
req.body.input
parameters and thex-hasura-user-id
from the headers, another grapqhl mutation (after successful validation) towards my main project's /graphql endpoint with the x-hasura-admin-secret header too.My main questions are:
X-Hasura-Admin-Secret
where
clause?Thanks!
Beta Was this translation helpful? Give feedback.
All reactions