Repository navigation
Conversation
…butes/
MispClient::freetext() posted to attributes/freeTextImport/{event_id}, but
AttributesController has no such action. The freeTextImport action lives on
EventsController and is routed at events/freeTextImport/{id}
(misp/app/Controller/EventsController.php:6105 `public function
freeTextImport($id, $adhereToWarninglists = false, $returnMetaAttributes =
false)`, referenced again at line 6559 as
`$this->baseurl . '/events/freeTextImport/' . $id`). PyMISP posts to the
same path (pymisp/pymisp/api.py:3578
`f'events/freeTextImport/{event_id}'`).
The request body shape (value/adhereToWarninglists/distribution) already
matched the controller and PyMISP's query dict, so only the path needed
correcting.
Added a wiremock test (freetext_posts_to_events_endpoint) asserting both
the corrected path and the request body, since no prior test covered this
method.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JoSButbVaWEtGMXwTx73BZ
elhoim
marked this pull request as draft
September 3, 2026 05:04
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.
BLUF — Freetext import posted to the wrong controller; it now targets
events/freeTextImport/{id}.MispClient::freetext()insrc/client.rsPOSTed toattributes/freeTextImport/{event_id}, butfreeTextImportis anEventsControlleraction andAttributesControllerhas no such route.events/freeTextImport/{event_id}, matching MISP core and PyMISP; the body shape was already correct. Adds a wiremock test asserting the path and exact body.ubuntu-22.04runner with no php8.3mod_php, plus a publish-worker race intest_event_crud_lifecycle), fixed in PR fix: [ci] Run integration tests on ubuntu-24.04 to match php8.3 #53 and unrelated to this PR.Finding
freetext posts to attributes/freeTextImport/{id}; action is on EventsController
AttributesController has no freeTextImport. MISP has EventsController::freeTextImport($id,...); PyMISP uses events/freeTextImport.
Change
MispClient::freetext() in src/client.rs was POSTing to
attributes/freeTextImport/{event_id}, but freeTextImport is an EventsController action, not AttributesController. Changed the path toevents/freeTextImport/{event_id}, matching MISP core and PyMISP. The request body shape (value/adhereToWarninglists/distribution) was already correct, so no body change was needed.Upstream evidence
MISP core app/Controller/EventsController.php:6105
public function freeTextImport($id, $adhereToWarninglists = false, $returnMetaAttributes = false)(on EventsController, not AttributesController), and line 6559'url' => $this->baseurl . '/events/freeTextImport/' . $idconfirming the route. PyMISP pymisp/api.py:3578r = self._prepare_request('POST', f'events/freeTextImport/{event_id}', data=query, **kwargs).Verified against MISP core
843b6744and PyMISPe7debb4f.Tests
client::tests::freetext_posts_to_events_endpoint (new wiremock test in src/client.rs asserting POST path /events/freeTextImport/42 and exact request body {value, adhereToWarninglists, distribution}; fails against the pre-fix path attributes/freeTextImport/42 since wiremock returns 404 for an unmatched path/body combo)Verified locally:
cargo fmt --check,cargo clippy --all-targets --all-features -- -D warnings,cargo test --all-features --lib,--test integration_tests --no-run, andcargo check --examples, each in an isolated target directory.🤖 Generated with Claude Code