-
Notifications
You must be signed in to change notification settings - Fork 259
#96 implement partial read access events emitting #2287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
#96 implement partial read access events emitting #2287
Conversation
fc69fda to
56242a3
Compare
There was a problem hiding this 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_PATHSto track which JSON paths each subject with partial permissions can access - Refactored
PreDefinedExtraFieldsEnricherintoThingEventEnricherto 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.
...tocol/src/main/java/org/eclipse/ditto/internal/utils/protocol/PartialAccessPathResolver.java
Outdated
Show resolved
Hide resolved
...l/src/main/java/org/eclipse/ditto/policies/model/enforcers/tree/TreeBasedPolicyEnforcer.java
Outdated
Show resolved
Hide resolved
.../java/org/eclipse/ditto/things/service/persistence/actors/enrichment/ThingEventEnricher.java
Outdated
Show resolved
Hide resolved
.../java/org/eclipse/ditto/things/service/persistence/actors/enrichment/ThingEventEnricher.java
Outdated
Show resolved
Hide resolved
.../java/org/eclipse/ditto/things/service/persistence/actors/enrichment/ThingEventEnricher.java
Outdated
Show resolved
Hide resolved
.../java/org/eclipse/ditto/things/service/persistence/actors/enrichment/ThingEventEnricher.java
Show resolved
Hide resolved
.../java/org/eclipse/ditto/things/service/persistence/actors/enrichment/ThingEventEnricher.java
Outdated
Show resolved
Hide resolved
...ervice/src/main/java/org/eclipse/ditto/things/service/utils/PartialAccessPathCalculator.java
Outdated
Show resolved
Hide resolved
...ervice/src/main/java/org/eclipse/ditto/things/service/utils/PartialAccessPathCalculator.java
Outdated
Show resolved
Hide resolved
...ervice/src/main/java/org/eclipse/ditto/things/service/utils/PartialAccessPathCalculator.java
Outdated
Show resolved
Hide resolved
policies/model/src/main/java/org/eclipse/ditto/policies/model/enforcers/Enforcer.java
Show resolved
Hide resolved
things/service/src/main/java/org/eclipse/ditto/things/service/utils/ReadGrantCollector.java
Show resolved
Hide resolved
things/service/src/main/java/org/eclipse/ditto/things/service/utils/ReadGrantCollector.java
Outdated
Show resolved
Hide resolved
...ervice/src/main/java/org/eclipse/ditto/things/service/utils/PartialAccessPathCalculator.java
Outdated
Show resolved
Hide resolved
things/service/src/main/java/org/eclipse/ditto/things/service/utils/PointerUtils.java
Outdated
Show resolved
Hide resolved
a0b6de0 to
83a97c9
Compare
a0271ce to
d59683b
Compare
d59683b to
0b42e5e
Compare
There was a problem hiding this 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.
Resolves: #96