Comments (4)
I think changing the data type would be too confusing (e.g. if the list had string values, are those literals or CEL expressions?). I also agree it's probably not worth introducing another field. Shall we close this one as wontfix then?
from cerbos.
Unfortunately, changing this is going to break existing deployments using a DB backend because the policies are stored in protobuf encoding and any data type change would make those policies undecodable.
from cerbos.
So, the map values would either be a constant value to be used directly as the value of the variable, or a CEL expression to evaluate to produce the value of the variable? How would we distinguish between a "raw" string and an expression?
At the moment we have definitions: map<string, string>
, what if we just introduced an additional field constants: map<string, Value>
, so that definitions
contains CEL expressions and constants
contains raw values?
from cerbos.
So, this originally came up because someone asked how to define an array variable. The answer is to use a stringified representation (e.g. x: "[1,2,3]"
) and Cerbos converts it to an array at runtime because it evaluates the string as a CEL expression. That's what got me thinking whether we could change the data type from string
to google.protobuf.Value
and let users write "native" lists, maps etc.
I don't know whether introducing a constants
field is worth it for fixing this minor annoyance. It might even confuse the users because they now have two options to pick from.
from cerbos.
Related Issues (20)
- Upgrade CEL to 0.18 HOT 2
- Improve error messages when gRPC endpoint doesn't exist
- Make the matched action available to conditions HOT 2
- Provide `runtime.action` to condition expressions HOT 1
- Document how to generate shell completion for 'cerbos', 'cerbosctl' CLI utilities HOT 2
- Make Validating and testing policies aware of lenientScope
- CORS Error on Firefox HOT 1
- Issue with multiple replicas and git backend HOT 8
- Installing Helm chart from OCI registry fails with 401 error HOT 1
- Kafka integration test is flaky
- Consider showing actual and expected values even when the tests succeed
- Repeated compilation errors HOT 1
- Inconsistent YAML parsing between schema validation and policy loading
- Update Otel HTTP semantic conventions HOT 2
- Make DBConnectionRetries configurable HOT 3
- Ability to produce output when the rule condition is not satisfied
- Typo in docs causes sample test to fail. HOT 1
- demo-python failes to start HOT 1
- Dynamic Permissions HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cerbos.