Repository navigation
Hide queue connection details in competition details API - #2581
Conversation
|
Thanks for the quick fix. Nice that it's an unconditional field swap rather than a permission branch, this makes it more fail proof. Note that the full QueueSerializer is still left nested in CompetitionSerializer.queue and could re-expose the broker URL after an unrelated changes. This base class isn't returned by any current read action (the create/update subclasses set queue = None, and the viewset never returns the base directly), so it's not a live leak today. But it's a trap: any future GET route that returns CompetitionSerializer(...).data would leak broker_url again. You could make queue write-only here (or using QueuePublicSerializer for representation): the create/associate path only needs the queue id inbound, never the full object outbound.
|
The competition details API now returns only the queue's id and name, so queue connection details (broker URL, credentials and vhost) and the queue's owner and organizers are no longer included. Add tests confirming this for logged-out users, competition creators who don't own the queue, and competition creators who own the queue.
f4ca903 to
fc271d7
Compare
The automated tests added in this PR will ensure that these scenarios doesn't happen. The tests will fail, making us take a look to see what went wrong, giving us an opportunity to fix it before the changes are merged. |
Description
The competition details API now returns only the queue's id and name, so queue connection details (broker URL, credentials and vhost) and the queue's owner and organizers are no longer included.
Add tests confirming this for logged-out users, competition creators who don't own the queue, and competition creators who own the queue.
Issues this PR resolves
A checklist for hand testing
api/competitions/ID) do not return sensitive queu information in the response.Checklist