10000 fix: Reload rule table when store contents change by charithe · Pull Request #2452 · cerbos/cerbos · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: Reload rule table when store contents change #2452

8000 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

Merged
merged 1 commit into from
Jan 17, 2025

Conversation

charithe
Copy link
Contributor
@charithe charithe commented Jan 16, 2025

This needs a proper unit test that I'll add in a different PR. In the
mean time, this should fix the E2E test failures (or uncover more issues).

Fixes #2451

Signed-off-by: Charith Ellawala charith@cerbos.dev

This needs a proper unit test that I'll add in a different PR. In the
mean time, this should fix the E2E test failures.

Fixes cerbos#2451

Signed-off-by: Charith Ellawala <charith@cerbos.dev>
@charithe charithe merged commit 0b80bcb into cerbos:main Jan 17, 2025
24 checks passed
@charithe charithe deleted the rule-table-reload branch January 17, 2025 10:48
Comment on lines +175 to +176
if ss, ok := policyLoader.(storage.Subscribable); ok {
ss.Subscribe(rt)
Copy link
Contributor
@Sambigeara Sambigeara Jan 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#2451 (comment)

I'm not sure I understand why this is the case. For mutable stores, the original stores remain as the source of truth, and a "partial rule table" is generated at query time (and discarded afterwards).

In the mutable-store case, partial rule tables are (currently) generated from the mutable store per-query and discarded afterwards. I chose to do this as an initial step as it seemed odd to maintain two sources of mutable truth.

This may or may not be related to the recent E2E test failure (it's currently nil-pointering on a nonexistent policy set passed to the addPolicy method).

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.

Rule table doesn't get updated when the store contents change
3 participants
0