Repository navigation
Conversation
…print endpoints getAttendeeBadge replaced the summit received as parameter with the summit of the order right before comparing them, so the check compared the order's summit with itself and never failed. The print and can-print badge endpoints answered for a ticket that belongs to a summit other than the one in the URL, and printing marked the badge as printed. Remove the reassignment so the order's summit is compared with the summit in the URL and a mismatch answers 404 Ticket not found.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
|
📘 OpenAPI / Swagger preview ➡️ https://OpenStackweb.github.io/summit-api/openapi/pr-683/ This page is automatically updated on each push to this PR. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ref: https://app.clickup.com/t/9014802374/1k5eh578t66
Summary
SummitOrderService::getAttendeeBadgereplaced the summit received as parameter with the summit of the order right before comparing them:The check never failed, so these endpoints answered for a ticket that belongs to a summit other than
{id}, and printing marked the badge as printed:PUT /api/v1/summits/{id}/tickets/{ticket_id}/badge/current/printPUT /api/v1/summits/{id}/tickets/{ticket_id}/badge/current/{view_type}/printGET /api/v1/summits/{id}/tickets/{ticket_id}/badge/current/printGET /api/v1/summits/{id}/tickets/{ticket_id}/badge/current/{view_type}/printThe fix removes the reassignment, so a ticket of another summit answers
404 Ticket not found. The view type is still resolved on the summit of the URL.Tests
New tests in
OAuth2SummitTicketsApiTest(10 cases):The fixture also allows the other summit's view type in the badge type (worst case), so on
mainthe printing rules alone do not stop the call. The 8 other-summit cases fail onmain(print answers 201, can-print answers 200) and pass with the change. The wholeOAuth2SummitTicketsApiTestclass passes (51 tests).Notes
OAuth2SummitTicketApiController::getAttendeeBadgeusesis_int($ticket_id)on a route parameter, which is always a string. To be handled separately if confirmed.