Given an input object like this:
{
"items": {
"a": "b"
}
}
I made a mistake in how I interpreted the input, and used every like this:
allow if {
some key in ["a", "b", "c"]
every item in input.items[key] {
item == "foo"
}
}
This is non-sensical, as input.items["a"] will return the string "b" and not a collection, but surprisingly this passed.
Not just a runtime issue either, as the this also passes:
every item in 1 {
item == "foo"
}
I'd expect the every keyword to fail evaluation on anything but a valid collection, both at compile time and runtime.
Given an
inputobject like this:{ "items": { "a": "b" } }I made a mistake in how I interpreted the input, and used
everylike this:This is non-sensical, as
input.items["a"]will return the string"b"and not a collection, but surprisingly this passed.Not just a runtime issue either, as the this also passes:
I'd expect the
everykeyword to fail evaluation on anything but a valid collection, both at compile time and runtime.