-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
API: add project name/slug filters #9843
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
Conversation
I am trying to use the project API for some search and dropdown filters, and while I can filter the local results, it's much nicer to use the API filter for this. This adds an icontains filter field for project name and slug, and hopefully some accurate tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is fine as long as we use this filter only over the projects the user is owner/maintainer. Otherwise, it will kill our servers.
This is a great point, I hadn't thought of that. The intention is to only use this param to filter owner/user projects. However, if we are still allowing public project listing search, someone could abuse this query. If you have any thoughts on how to secure this more, this might be a good place for you to jump in on this. Seems we could probably truncate the queryset or validate the request somehow, if we're concerned about querying all projects with this. |
Dev docs failure isn't related to this change. |
I think we are fine: readthedocs.org/readthedocs/api/v3/permissions.py Lines 25 to 26 in d8f5282
We allow details on all the objects and listing only over the objects the user has access to. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, perhaps when the print statement is removed, this can go in?
Co-authored-by: Benjamin Balder Bach <[email protected]>
This is ready to merge 💯 |
I am trying to use the project API for some search and dropdown filters,
and while I can filter the local results, it's much nicer to use the API
filter for this.
This adds an icontains filter field for project name and slug, and
hopefully some accurate tests.
📚 Documentation previews 📚
docs
): https://docs--9843.org.readthedocs.build/en/9843/dev
): https://dev--9843.org.readthedocs.build/en/9843/