Git Product home page Git Product logo

Comments (5)

charithe avatar charithe commented on June 9, 2024 1

I now remember why we didn't add filtering in the first place. Doing that on disk-based policies would require reading all of them -- which would not scale as the number of policies increase.

I think we should keep ListPolicies as it is and introduce a different RPC (FilterPolicies?) that is only implemented on stores that can be easily queried.

from cerbos.

Sambigeara avatar Sambigeara commented on June 9, 2024 1

Makes sense. We're not (directly), but I started tinkering with the cgo-dependent package for name matching and came across this. No blockers - was just intrigued.

from cerbos.

Sambigeara avatar Sambigeara commented on June 9, 2024

This RPC is currently enabled for non-mutable stores. I can't decide if there's any practical use for this filtering for "static" policy sets.

On one hand, users can review their stores (git or otherwise) to see what's there, but on the other hand, this filter might be useful for quickly getting a view on what's there (particularly if they have a hefty number of policies deployed).

I'm erring on the side of implementing this only for mutable stores for now. Thoughts?

from cerbos.

Sambigeara avatar Sambigeara commented on June 9, 2024

TL;DR: I'm intrigued about why we set CGO_ENABLED=0.

Enabling REGEXP in SQLite (via a user defined function when using https://github.com/mattn/go-sqlite3) requires cgo which we disable (CGO_ENABLED=0). This got me thinking - is there a particular reason we disable this?

There are numerous ways to work around this (using a cgo-free port of SQLite, disabling for unsupported drivers, post-filtering result sets in code, etc), but I'm just intrigued.

from cerbos.

charithe avatar charithe commented on June 9, 2024

It's to avoid platform incompatibilities and security issues. We ship a minimal scratch image that doesn't have a libc.

The version of SQLite we use is the CGO-free one. Are we referencing the CGO-based driver anywhere in the code?

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.