Skip to content

feat: Use a ReadOnlyStore for returning policy data#89

Open
joachimvh wants to merge 1 commit into
mainfrom
readonly-store
Open

feat: Use a ReadOnlyStore for returning policy data#89
joachimvh wants to merge 1 commit into
mainfrom
readonly-store

Conversation

@joachimvh
Copy link
Copy Markdown
Contributor

@joachimvh joachimvh commented May 12, 2026

This prevents unnecessarily copying all rules when trying to read data.

A new Store was created every time data was read, to prevent the in-memory store to be modified outside of the rules storage class, but this results in copying all policies every time data is read which is quite inefficient. This PR resolves this by introducing a new ReadOnlyStore, which retains all functions of an N3 Store that do not modify the Store in place.

Some casts were done in the BaseController to make this work, which are not ideal but that entire class is not ideal in general anyway.

This prevents unnecessarily copying all rules when trying to read data
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