Repository navigation
Conversation
MISP's EventDelegation model declares $belongsTo with the aliases 'Org' and 'RequesterOrg' (app/Model/EventDelegation.php:21-30, pinned 843b6744), so the API response nests the related organisation objects under the capitalized keys "Org" and "RequesterOrg". MispEventDelegation was deserializing the lowercase "org"/"requester_org" keys, which never match, so both fields silently deserialized to None on every real MISP response. Added #[serde(rename = "Org")] and #[serde(rename = "RequesterOrg")] to the org and requester_org fields, and added a deserialization test covering the capitalized keys. 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:05
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 —
MispEventDelegationlacked serde renames, soOrgandRequesterOrgdeserialized toNone.EventDelegation.php$belongsToaliases the organisations asOrgandRequesterOrg, but theorg/requester_orgfields insrc/models/event_delegation.rsmatched only lowercase keys and silently deserialized toNone.#[serde(rename = "Org")]and#[serde(rename = "RequesterOrg")]to the two fields, plus a deserialization test asserting both populate from capitalized MISP-shaped JSON.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
org/requester_org lack rename to Org/RequesterOrg
MISP EventDelegation.php $belongsTo uses 'Org' and 'RequesterOrg'; both fields silently deserialize to None.
Change
MISP's EventDelegation.php $belongsTo declares aliases 'Org' and 'RequesterOrg', so API responses nest organisation details under capitalized keys. MispEventDelegation's org/requester_org fields lacked serde renames and matched only lowercase keys, so they silently deserialized to None. Added #[serde(rename = "Org")] and #[serde(rename = "RequesterOrg")] to the two fields, and added a new deserialization test asserting both fields populate correctly from capitalized MISP-shaped JSON.
Upstream evidence
MISP core app/Model/EventDelegation.php:21-30 — public $belongsTo = array('Event', 'Org' => array('className' => 'Organisation'), 'RequesterOrg' => array('className' => 'Organisation'), 'SharingGroup');
Verified against MISP core
843b6744and PyMISPe7debb4f.Tests
event_delegation_deserialize_org_fieldsCaveats
Minimal, self-contained field-level serde fix; no dependency on other findings.
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