Giter Site home page Giter Site logo

Comments (4)

srenatus avatar srenatus commented on July 18, 2024

What did you expect? The query false;0 does not yield any results. It's a single query with two expressions, not a "multi-query" of two separate queries -- there's no such thing in Rego, I'm afraid.

from opa.

nkey0 avatar nkey0 commented on July 18, 2024

I am expect to receive the same results as for true;0 except values should differ.

The first

if set == nil {
		t.Fatal()

is not failing, only the second one.

In the real case it is a query like:
is_allowed;deny_reasons

So, I want to get reasons if is_allowed == false, but currently I can't.

Or I should use ugly hack like is_allowed_as_int;deny_reasons;

from opa.

srenatus avatar srenatus commented on July 18, 2024

In a query, ; is basically and. So you cannot treat it as ||.

However, you can change your policy, I suppose, to get this:

So, I want to get reasons if is_allowed == false, but currently I can't.

result.allow := is_allowed
result.reasons := deny_reasons

then query data.your.package.result and inspect object you get back. It should have either an allow or a reasons key.

from opa.

nkey0 avatar nkey0 commented on July 18, 2024

In a query, ; is basically and.

OMG, I was sure it is just some kind of separator for the statements :)

Thanks for you help.

from opa.

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.