Skip to content

Conversation

@hu-ahmed
Copy link
Contributor

@hu-ahmed hu-ahmed commented Dec 6, 2025

Resolves: #96

@hu-ahmed hu-ahmed force-pushed the support-emitting-partial-access-events-01 branch 2 times, most recently from fc69fda to 56242a3 Compare December 7, 2025 02:48
@thjaeckle thjaeckle requested a review from Copilot December 11, 2025 07:40
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements partial read access event emission functionality, allowing subjects with restricted READ permissions to receive filtered change notifications. The implementation introduces an indexed format for tracking accessible paths per subject, reducing header size when multiple subjects share the same paths.

Key Changes

  • Added new header PARTIAL_ACCESS_PATHS to track which JSON paths each subject with partial permissions can access
  • Refactored PreDefinedExtraFieldsEnricher into ThingEventEnricher to handle both predefined fields and partial access path enrichment
  • Implemented filtering logic in Gateway (SSE, WebSocket) and Connectivity services to restrict event payloads based on subscriber permissions

Reviewed changes

Copilot reviewed 40 out of 40 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
DittoHeaderDefinition.java Added PARTIAL_ACCESS_PATHS header definition for tracking partial access paths
ThingEventEnricher.java New enricher that combines predefined fields and partial access path functionality
PartialAccessPathCalculator.java Core logic for calculating accessible paths for subjects with partial permissions
ReadGrantCollector.java, ReadGrantIndexer.java, ReadGrant.java, IndexedReadGrant.java Utility classes for collecting and indexing read grants
Enforcer.java Added getAccessiblePaths method to query accessible paths for authorization contexts
TrieBasedPolicyEnforcer.java, TreeBasedPolicyEnforcer.java, PolicyTrie.java Implemented getAccessiblePaths in policy enforcers
JsonPartialAccessFilter.java, PartialAccessPathResolver.java, AdaptablePartialAccessFilter.java Filtering utilities for JSON objects and Adaptables based on partial access paths
ThingsSseRouteBuilder.java, WebSocketRoute.java Integrated partial access filtering in Gateway streaming endpoints
OutboundMappingProcessor.java Integrated partial access filtering in Connectivity service for external connections
ThingCommandEnforcement.java Updated to include partial subjects in read granted subjects
Test files Added comprehensive test coverage for partial access path functionality
Comments suppressed due to low confidence (1)

things/service/src/test/java/org/eclipse/ditto/things/service/persistence/actors/enrichment/ThingEventEnricherTest.java:1

  • Debug statement using System.err should be removed. This appears to be leftover debug code that should not be committed.
/*

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@thjaeckle thjaeckle added this to the 3.9.0 milestone Dec 11, 2025
@hu-ahmed hu-ahmed marked this pull request as ready for review December 12, 2025 12:04
@hu-ahmed hu-ahmed force-pushed the support-emitting-partial-access-events-01 branch from a0b6de0 to 83a97c9 Compare December 18, 2025 16:40
@hu-ahmed hu-ahmed force-pushed the support-emitting-partial-access-events-01 branch from a0271ce to d59683b Compare December 22, 2025 16:03
@hu-ahmed hu-ahmed force-pushed the support-emitting-partial-access-events-01 branch from d59683b to 0b42e5e Compare December 22, 2025 16:03
@thjaeckle thjaeckle requested a review from Copilot January 8, 2026 12:20
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 47 out of 47 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

Support emitting partial change notifications based on Policy READ permission

2 participants