Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

return 400 status code on bad arguments instead of 403 status code #57

Open
samuelstroschein opened this issue Jan 20, 2023 · 3 comments
Labels
enhancement ✨ New feature or request

Comments

@samuelstroschein
Copy link

2. Telefunc aborts function calls with bad arguments with status code 403 instead of 400

Telefunc generates shield functions for arguments automatically. But, passing bad arguments to an API call is not a 403 (forbidden) but a 400 (bad request) status code. The 403 status code lead to an hour-long wandering path that the problem was related to auth.

Originally posted by @samuelstroschein in #56 (comment)

Proposal

Auto-generated shield functions that protect function arguments should return / throw a 400 (bad request) status code instead of a 403 (permission denied) status code.

@samuelstroschein samuelstroschein changed the title return 400 status code on bad arguments return 400 status code on bad arguments instead of 403 status code Jan 20, 2023
@samuelstroschein
Copy link
Author

The current 403 implementation is a footgun. TypeScript does not lint "redundant" arguments but telefunc throws a 403 on redundant arguments.

@brillout
Copy link
Owner

I agree these kind of situations should be easy to debug.

I've a couple of ideas to improve the situation.

@brillout
Copy link
Owner

I've a couple of ideas to improve the situation.

I'll implement them after I finish VPS's V1 design.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ✨ New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants