GithubHelp home page GithubHelp logo

Comments (4)

haines avatar haines commented on May 28, 2024 1

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.

charithe avatar charithe commented on May 28, 2024

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.

haines avatar haines commented on May 28, 2024

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.

charithe avatar charithe commented on May 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.