Repository navigation
FIX: reject a half provided branch spec when creating an attack - #4004
Open
Manohar Paturi (ManoharPaturi) wants to merge 1 commit into
Open
Manohar Paturi (ManoharPaturi) wants to merge 1 commit into
Manohar Paturi (ManoharPaturi) wants to merge 1 commit into
Conversation
A request with exactly one of source_conversation_id and cutoff_index fell through to the plain new conversation branch, silently dropping the branch the caller asked for, while the conversation endpoint rejects the same shape. The pair is validated up front and the route answers 400 like its sibling. Signed-off-by: Manohar Paturi <186662190+ManoharPaturi@users.noreply.github.com>
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.
Description
Fixes #4003
CreateAttackRequesttakessource_conversation_idandcutoff_indexas two independent optional fields, andcreate_attack_asynconly copied history when both were set. A request carrying exactly one of the two fell through to the plain new conversation branch, so the attack was created with an empty conversation, the supplied field was silently dropped, and a client bug stayed invisible. The conversation endpoint on the same resource validates the same pair and rejects a half provided spec, so the two entry points disagreed on identical input.The pair is now validated up front in
create_attack_asyncwith the same message the conversation path uses, and the create route maps that rejection to 400 like its sibling, while target lookups keep answering 404 as before.Tests and Documentation
Added a service regression rejecting both half shapes and confirming the both and neither shapes still work, plus a route regression asserting the half pair answers 400 with the validation detail. Both fail without the change, and the pinned target-not-found 404 test still passes. The attack service suite passes at 201 tests and the create_attack route tests at 7, ruff clean.
No documentation change needed, so I did not run JupyText.