seedwing-io / seedwing-policy

A functional type system for policy inspection, audit and enforcement.
https://www.seedwing.io
Apache License 2.0
12 stars 15 forks source link

pattern succeeds when using wrong value from data #234

Open joejstuart opened 1 year ago

joejstuart commented 1 year ago

When using a single value in a data file, I seem to get passing results even if the value is wrong. Here is an example. The version is swio 0.1.0-nightly.c36a4776

foo.json

50

tasks.dog

pattern blah = {
  hey: b
}

pattern b = *data::from<"foo.json">

att.json

{
    "hey": 10
}
$ swio eval -i att.json -n tasks::blah -d data/ -p policies/tasks.dog 
{
  "name": {
    "pattern": "tasks::blah"
  },
  "severity": "none",
  "reason": "Because all fields were satisfied"
}