JoelvanIngen / JoelvanIngen/Competitive-Green-Coding
Specific password, username, and email constraints
- Dominant language
- Python
- Stars
- 3
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Description
For now the username and email constraints are fairly simple:
For the email constraints the following regex is used (which should be fairly general)
`[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,7}`
courtesy of https://www.geeksforgeeks.org/python/check-if-email-address-valid-or-not-in-python/
For the username this one is now used:
`[A-Za-z0-9]{2,32}`
(the username should be alphanumeric and between 2 and 32 characters long)
However, for the password we do not have such a regex/specific constraints it should comply with.
This issue is to tweak these existing regexes (if they need tweaking) and create constraints and the corresponding regex for the password and implement this in `db/src/db/auth/login_input_checker.py`, and write some unit tests for this function in `db/tests/unit/auth/test_login_input_checker.py` (and update the other ones if necessary).
Maybe @jaalten has some ideas of which constraints are necessary. If the errors given back from the server-api should be more specific, please add these to the OpenAPI document.
Contributor guide
Assessment
This issue has not been assessed yet.