OpenAssetIO / OpenAssetIO-Manager-BAL

A contrived "asset management system" for OpenAssetIO integration test cases.
Apache License 2.0
5 stars 4 forks source link

Support entity access policies #104

Closed feltech closed 3 months ago

feltech commented 4 months ago

Closes #90 #92.

Error during publishing (preflight and register) if the provided trait set is incompatible with managementPolicy or entityTraits (with kWrite access mode).

Add access mode to EntityInfo, for use in JSON DB queries. Default to ignoring access mode and returning the same data (from the entity "versions" list) for all access modes.

EDIT: "exceptions" was renamed to "overrideByTraitSet" and "overrideByAccess", see review comments.

Add new "exceptions" option alongside an entity "versions" list in the JSON database. The "exceptions" object is a mapping of (stringified) access mode to entity data, overriding lookup in the "versions" list.

In the new "exceptions" mapping, use the special value of null to mean the entity doesn't 'exist' for that access mode. Use the special value of empty dict {} to mean the entity exists but is inaccessible for that access mode.

With this mechanism in place, we can simulate read-only and write-only entities, and customise the returned trait sets for read and write access patterns, which then feeds into the aforementioned additional publishing validation.

Reviewer notes

CI is retargeted to use OpenAssetIO main. This is only necessary because the new convenience signatures for entityTraits are used in the tests. I'm happy to change this to use the callback-based signatures, so we don't have to target main, if desired.

feltech commented 3 months ago

^ Rebased, updated commit message, and added missing release note.