8000 enhancement: Make `now` fully deterministic by haines · Pull Request #2353 · cerbos/cerbos · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

enhancement: Make now fully deterministic #2353

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 2 commits into from
Oct 18, 2024
Merged

Conversation

haines
Copy link
Member
@haines haines commented Oct 18, 2024

At the moment, now is deterministic within a CEL expression. However, within a single check, it varies between conditions of different rules in a policy.

This PR fixes the value of now at the time the check (or plan) is initiated instead of the time each expression is evaluated, so that the results are guaranteed to be consistent even between separate evaluations.

Signed-off-by: Andrew Haines <haines@cerbos.dev>
@haines haines added the kind/enhancement New feature or request label Oct 18, 2024
I forgot this in cerbos#2352.

Signed-off-by: Andrew Haines <haines@cerbos.dev>
@haines haines requested a review from charithe October 18, 2024 16:42
@haines haines marked this pull request as ready for review October 18, 2024 16:42
@haines haines enabled auto-merge (squash) October 18, 2024 16:42
@haines haines merged commit c1d16b9 into cerbos:main Oct 18, 2024
22 checks passed
@haines haines deleted the deterministic-now branch October 18, 2024 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0