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

Use CoreUser schemas instead of CoreUser models in modules #514

Open
armanddidierjean opened this issue Aug 7, 2024 · 0 comments
Open
Labels
core enhancement New feature or request

Comments

@armanddidierjean
Copy link
Member

Subject of the issue

Currently, all modules get CoreUser models from the db, using dependencies like is_user_a_member. These modules don't need to manipulate CoreUser models, as they won't modify them.
Usually, they just use data about the user, like its name.

The model CoreUser contains sensitive information, like the password hash. Some module could accidentally leak them by logging or returning them in the http response.

Proposed solution

Dependencies (like is_user_a_member) could return a CoreUser schema.
If some modules use cruds from cruds_user, we could replace them by utils returning CoreUser schemas.

@armanddidierjean armanddidierjean added enhancement New feature or request good first issue Good for newcomers core labels Aug 7, 2024
@armanddidierjean armanddidierjean changed the title Use User schemas instead of models in modules Use CoreUser schemas instead of CoreUser models in modules Aug 7, 2024
@Marc-Andrieu Marc-Andrieu removed the good first issue Good for newcomers label Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants