Giter Site home page Giter Site logo

Comments (6)

Megha-96 avatar Megha-96 commented on July 18, 2024 1

Thank your helping. I think we got the issue. This is not a bug, a miss from our end. The rules added were only test rules not of any significance.

from opa.

srenatus avatar srenatus commented on July 18, 2024

Please provide an example policy.

from opa.

Megha-96 avatar Megha-96 commented on July 18, 2024

I have updated the description. The policy name has promoPackage but if you write any tests it will still pass. But the bundles do now allow such path at all, So should we not include this in test results as well ?

from opa.

srenatus avatar srenatus commented on July 18, 2024

I'm confused is that your exact policy? Because that package name works fine -- I just tried in the playground.

How do you experience

the bundles do now allow such path at all

exactly?

from opa.

srenatus avatar srenatus commented on July 18, 2024

BTW I think it's instructive to run your policy on the playground: see here.

In the lower right, you'll notice some Regal findings, and one of them stands out to me: "impossible not".

bugs/impossible-not: Impossible not condition (Learn more)

That line,

deny[output] {
    not permit # <------
    output := "deny "
}

cannot fail because it's a multi-value rule (or "partial set rule"). Even if its body never succeeds, the result with be an empty set, and not ... of that is false.

As a remedy, you could write count(permit) == 0 or permit == set(). See here for more details.

from opa.

anderseknert avatar anderseknert commented on July 18, 2024

Adding to what @srenatus said, there are more impossible conditions, or expressions that are essentially constant in your policy:

authorize = deny[output] {
    deny
}

authorize = permit[output] {
    permit
}

As both deny and permit are multi-value rules, they will always evaluate to something (minimum, an empty set), so they'll always evaluate "truthy".

Perhaps if you describe what you're trying to accomplish, we can try and help write a policy for that purpose 🙂

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.