Skip to content

Conversation

@JeroenDeDauw
Copy link
Member

@JeroenDeDauw JeroenDeDauw commented Jan 31, 2026

For #484. Still need to actually us this new service as a second layer check.

Results from a back-and-forth session with claude. Reviewed fully by me.

Summary

  • Extract a CypherQueryValidator interface in the Application layer with queryIsAllowed(string $cypher): bool
  • Rename CypherQueryFilterKeywordCypherQueryValidator and move to Persistence/Neo4j/
  • Rename ExplainBasedQueryValidatorExplainCypherQueryValidator
  • Add missing read-only operators (Unwind, NodeCountFromCountStore, RelationshipCountFromCountStore) to the EXPLAIN-based validator
  • Add comprehensive integration tests for the EXPLAIN-based validator

Test plan

  • KeywordCypherQueryValidator tests pass (83 tests)
  • ExplainCypherQueryValidator integration tests pass (22 tests)
  • CypherRawParserFunctionTest passes (6 tests)
  • phpcs clean
  • phpstan clean

🤖 Generated with Claude Code

Introduce a CypherQueryValidator interface in the Application layer
with two implementations: KeywordCypherQueryValidator (keyword-based
filtering, formerly CypherQueryFilter) and ExplainCypherQueryValidator
(EXPLAIN plan-based validation, formerly ExplainBasedQueryValidator).

Add missing read-only operators (Unwind, NodeCountFromCountStore,
RelationshipCountFromCountStore) to the EXPLAIN-based validator's
allowlist, and add comprehensive integration tests for it.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@JeroenDeDauw JeroenDeDauw changed the title Extract CypherQueryValidator interface and rename implementations Add ExplainCypherQueryValidator Jan 31, 2026
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.

2 participants