Repository navigation
Conversation
Load the channel through get_object() so users who can't view it get the same 404 as a nonexistent channel. Signed-off-by: adibmbrk <adibmbrk@gmail.com>
|
👋 Hi @adibmbrk, thanks for contributing! For the review process to begin, please verify that the following is satisfied:
📢✨ Before we assign a reviewer:
Also check that issue requirements are satisfied & you ran Pull requests that don't follow the guidelines will be closed. Reviewer assignment can take up to 2 weeks. 📎 We couldn't find an issue linked to this pull request. Please edit the description and link one under References, for example |
|
📢✨ Before we assign a reviewer, we'll turn on |
🟡 Waiting for changesOutcome: reviewed Last updated: 2026-11-24 08:17 UTC |
rtibblesbot
left a comment
There was a problem hiding this comment.
PR #6428: Switching both actions to get_object() closes the leak and gives denied and missing channels the same 404.
CI failing: lint.
- blocking —
contentcuration/contentcuration/viewsets/channel.py:4:from typing import Dictis now unused. flake8 reports it as F401, which fails the lint job. Delete the import. - suggestion —
get_object()loads more than these actions need (inline). - nitpick — one redundant test (inline).
Next step: Needs a full code review by a human engineer.
- The author is outside the team: confirm this should be built at all.
Written by rtibblesbot, an LLM-based coding agent.
Signed-off-by: adibmbrk <adibmbrk@gmail.com>
rtibblesbot
left a comment
There was a problem hiding this comment.
PR #6428: both prior findings are resolved. No new findings. CI is still running.
Prior-finding status
RESOLVED — contentcuration/contentcuration/viewsets/channel.py — get_object() loads far more than these actions need
RESOLVED — contentcuration/contentcuration/tests/viewsets/test_channel.py — non-member test duplicates test_language_actions_nonexistent_channel_matches_non_member
Next step: Needs a full code review by a human engineer.
- The author is outside the team.
- Confirm 404 for non-members on
language_exists/languagesis the intended permission behaviour for these channel endpoints.
Written by rtibblesbot, an LLM-based coding agent.
Superseded by my review of 4a71345: no blocking findings remain.
Summary
The channel
language_existsandlanguagesactions queriedChannel.objectsdirectly, so any logged-in user could read a private channel's content languages by id, and tell whether the id exists.Both actions now load the channel with
get_object(), like the other detail actions. A user who can't view the channel gets the same 404 asGET /api/channel/<id>or a nonexistent id. Editors and viewers get the same responses as before. The now-unused_channel_existsand_get_channel_detailshelpers are removed.References
Fixes #6399
Reviewer guidance
ChannelLanguageTestCaseintest_channel.py; all 11 tests pass. I did not run the rest of the suite.AI usage
I used Claude Code to read the issue, make the change in
channel.py, and write the regression tests, following theget_object()pattern used by the other detail actions. I ran the language tests to confirm they pass.