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

services: add id to query parser #114

Closed

Conversation

jrcastro2
Copy link
Contributor

@@ -47,7 +47,7 @@ class UserSearchOptions(SearchOptions, SearchOptionsMixin):
query_parser_cls = QueryParser.factory(
tree_transformer_cls=SearchFieldTransformer,
fields=["username^2", "email^2", "profile.full_name^3", "profile.affiliations"],
allow_list=["username", "email"], # mapped fields are added on the query parser
allow_list=["username", "email", "id"], # mapped fields are added on the query parser
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have some doubts if we should allow to search by ID, I think it enables it for everyone, not only admins

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested and it's independent of the visibility set in the profile, if visibility is set to hidden, then no one can find users by id. If is set to Public, users can be found by email, username and now ID as well

@jrcastro2
Copy link
Contributor Author

After discussion we decided to not expose the ID as anyone could query the DB since the ID is a incremental integer.

@jrcastro2 jrcastro2 closed this Oct 6, 2023
@zzacharo zzacharo mentioned this pull request Oct 18, 2023
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants