Skip to content

fix(gmp): protect report-scoped result filtering - #872

Open
hive-bumblebee wants to merge 2 commits into
mainfrom
b02/protected-report-filter
Open

hive-bumblebee wants to merge 2 commits into
mainfrom
b02/protected-report-filter

Conversation

@hive-bumblebee

Copy link
Copy Markdown
Contributor

Summary

Closes #871; provides the upstream typed filtering prerequisite for greenbone/rust-gvm-api#741.

  • Add compose_report_results_filter(&EntityId, Option<&str>, Option<&str>, Pagination) -> Result<String, ReportResultsFilterError>: accepts resolved saved and inline filter text, protects report isolation using gvmd's independent report restriction, and owns pagination.
  • Quote-aware rejection of caller scope/pagination controls and unsupported inclusive/compound comparators, with actionable new error type; preserve existing request/facade shapes and raw filter escape hatches.
  • Extend the bounded stateful result mock with source-supported default OR / explicit OR / explicit AND and independent report restriction before filtering counts/pagination.
  • Document immutable gvmd source evidence and explicit mock limits; this is not live gvmd qualification.

Verification

Using /workspace/866-test-env and isolated CARGO_TARGET_DIR=/workspace/.cache/upstream-filter-target:

  • GMP filtering unit tests: 23 passed.
  • GMP canonical results request tests: 7 passed; strict filter composition/encoding tests: 4 passed.
  • Stateful result conformance: 6 passed; typed client result integration: 6 passed.
  • cargo fmt --all -- --check passed.
  • Strict focused Clippy (-D warnings) passed for touched GMP/mock/client libraries and test targets.

A broader --all-targets Clippy attempt encounters the existing missing-crate-documentation warning in crates/gvm-gmp/tests/agent_schedule_serde_test.rs; unrelated tests were not modified. Existing Cargo manifest unused-workspace-dependency warnings remain.

Originally based on the full #868 stack at b6f33da; rebased the single incremental change onto main after #868 was merged (squashed stack, equivalent baseline tree). Saved-filter arguments are resolved term text; callers must leave request filter_id unset so gvmd does not replace the composed inline filter.

Agent: b02-agent-035

@hive-bumblebee
hive-bumblebee requested review from a team as code owners November 19, 2026 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(filter): typed protected report-result scope and strict comparator validation

1 participant