Skip to content

Comments

Integration tests for policy imports enhancements#22

Open
thjaeckle wants to merge 4 commits intoeclipse-ditto:mainfrom
beyonnex-io:feature/2221-policy-imports-enhancements
Open

Integration tests for policy imports enhancements#22
thjaeckle wants to merge 4 commits intoeclipse-ditto:mainfrom
beyonnex-io:feature/2221-policy-imports-enhancements

Conversation

@thjaeckle
Copy link
Member

Related to Ditto PR eclipse-ditto/ditto#2221

thjaeckle and others added 2 commits February 20, 2026 20:25
…esAdditions

- PolicyImportSubResourcesIT: tests GET/PUT /imports/{id}/entries,
  GET/PUT /imports/{id}/entriesAdditions, GET/PUT/DELETE
  /imports/{id}/entriesAdditions/{label} including thing access verification
- PolicyEntryImportableSubResourcesIT: tests GET/PUT
  /entries/{label}/importable and /entries/{label}/allowedImportAdditions
  including thing access verification
- PolicyImportEntriesAdditionsIT: tests entriesAdditions and
  allowedImportAdditions policy-level validation
- ThingsWithImportedPoliciesEntriesAdditionsIT: tests thing access
  granted/revoked via entriesAdditions subject additions
- PolicyImportEntriesAdditionsWsIT: WebSocket variant of access verification

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- fix templateRevokePreservedWhenResourceAdditionsOverlap: remove
  defaultSubject from template DEFAULT entry to avoid imported WRITE
  revoke blocking thing creation, and expect FORBIDDEN instead of
  NOT_FOUND since subject2 has READ but not WRITE
- fix WS test: add policyId to CreateThing and thing:/ permissions to
  importing policy's ADMIN entry
- add resourceAdditionGrantsWriteAccess: e2e test verifying resource
  additions actually grant thing WRITE access
- add additionsForMultipleImportedLabels: e2e test with subject
  additions targeting two imported labels (DEFAULT=READ, EXTRA=WRITE)
- add putPolicyImportWithMultipleResourceAdditionsAllowed: API test
  for multiple resources in a single EntryAddition
- add putPolicyImportWithAdditionsForMultipleLabels: API test for
  entriesAdditions targeting multiple labels
- add removingResourcesFromAllowedAdditionsRejectsNewResourceAdditions:
  test that narrowing allowedImportAdditions rejects resource additions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@thjaeckle thjaeckle self-assigned this Feb 23, 2026
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@thjaeckle
Copy link
Member Author

Add 7 tests covering cache invalidation, permission precedence,
multi-importer scenarios, and sub-path granularity for entriesAdditions:
- template revoke overrides resource addition grant
- template entry deletion revokes entriesAdditions access
- template policy deletion revokes imported access
- multiple importers from same template are independently affected
- subject retains access from own entry when entriesAdditions removed
- resource addition respects sub-path granularity (attributes vs features)
- resource addition without subject addition applies to template subjects

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@thjaeckle
Copy link
Member Author

Added additional integration tests to test cases where

  • allowedImportAdditions from the template policy are reduced, making sure they are no longer applied in the importing policy
  • a revoke defined in the "template policy" is enhanced with a grant in "additions" - making sure that revoke is still stronger
  • deletion of the template policy disabled imported access
  • etc.

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.

1 participant