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

type safe execution of route functions #54

Open
JulianFP opened this issue Nov 4, 2024 · 0 comments
Open

type safe execution of route functions #54

JulianFP opened this issue Nov 4, 2024 · 0 comments
Labels
FR enhancement New feature or request regarding a functional reqirement medium priority well be done at some point

Comments

@JulianFP
Copy link
Owner

JulianFP commented Nov 4, 2024

Many routes process user provided data in the form of query strings, json form data or similar. These routes require the presence of certain variables of the correct datatype in this data. While we often make sure to check if for example certain keys exist in the json object, we do this a bit inconsistently and also don't really check the data types. The runtime errors that come from this (e.g. pythons KeyError) are often captured by flask which then just returns a generic server error to the client, but this is not always the case.

To make the backend more reliably and to make it impossible for users to trivially DOS the backend by just sending invalid requests we should check if all properties that routes expect requests to have are met before even executing any route-specific code. This would also make it a lot easier to write/maintain this code since it would no longer be necessary to implement these imperative checks for each route again and again.

@JulianFP JulianFP added FR enhancement New feature or request regarding a functional reqirement medium priority well be done at some point labels Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FR enhancement New feature or request regarding a functional reqirement medium priority well be done at some point
Projects
None yet
Development

No branches or pull requests

1 participant