8000 feat: Define constants for use in condition expressions by haines · Pull Request #2364 · cerbos/cerbos · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: Define constants for use in condition expressions #2364

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
Nov 4, 2024

Conversation

haines
Copy link
Member
@haines haines commented Nov 1, 2024

Description

This PR introduces a new constants (C) top-level identifier in CEL expressions, a constants section to define the values, and an exportConstants policy type to share definitions between policies.

Constants are an alternative to defining variables with literal values, which avoids the need to quote values as CEL expressions by allowing them to be defined with standard YAML/JSON syntax.

It also fixes a few bugs in the policy inspection logic so that resource attributes and variables are discovered transitively for all policy types.

@haines haines marked this pull request as draft November 1, 2024 13:59
Signed-off-by: Andrew Haines <haines@cerbos.dev>
@haines haines merged commit 0ead3be into cerbos:main Nov 4, 2024
22 checks passed
@haines haines deleted the constants branch November 4, 2024 09:26
haines added a commit to cerbos/cerbos-sdk-go that referenced this pull request Nov 4, 2024
cerbos/cerbos#2364

Signed-off-by: Andrew Haines <haines@cerbos.dev>
haines added a commit that referenced this pull request Nov 4, 2024
#2364
cerbos/cerbos-sdk-go#83

---------

Signed-off-by: Andrew Haines <haines@cerbos.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0