use string subject IDs in PRE_DEFINED_EXTRA_FIELDS_READ_GRANT_OBJECT …#2384
Merged
thjaeckle merged 1 commit intoeclipse-ditto:masterfrom Apr 1, 2026
Merged
Conversation
a3a0118 to
de213fd
Compare
thjaeckle
requested changes
Apr 1, 2026
things/service/src/test/java/org/eclipse/ditto/things/service/utils/ReadGrantCollectorTest.java
Outdated
Show resolved
Hide resolved
de213fd to
5036e30
Compare
thjaeckle
approved these changes
Apr 1, 2026
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.
Summary
ThingEventEnrichernow producesPRE_DEFINED_EXTRA_FIELDS_READ_GRANT_OBJECTheader with string subject IDs instead of integer indices, matching the format
expected by
DittoCachingSignalEnrichmentFacadeReadGrant.toJson()to serialize grants as{"/path": ["subject1", "subject2"]}IndexedReadGrantandReadGrantIndexer(no remaining usages)ReadGrantCollectorTestand
ThingEventEnricherTestRoot cause
ReadGrantIndexer.index()convertedReadGrantto an indexed format wheresubject IDs are replaced by integer indices to reduce header size:
{"/attributes": [0]}Where
0maps to a subject ID string. ButDittoCachingSignalEnrichmentFacade.filterAskedForFieldSelectorToGrantedFields()compares the array values directly against the requesting connection's authorization
subject ID strings.
JsonValue(integer)never equalsJsonValue(string),so the filter returned an empty field selector, causing all pre-defined extra fields
to be silently dropped from enriched events.
Impact
All connections relying on pre-defined extra fields enrichment (e.g.
extraFields=attributes) received events with emptyextra, causingdownstream consumers to fail when attempting to read expected fields.