Repository navigation
Ergo CLI and Rust engine 0.2.0
·
40 commits
to main
since this release
New
- Every phrase that lacked an opposite has one, as spec 0.4 says:
does not start with,does not end with,is not a <type>,is not a non-empty string,is not between,is not <value> within <number>,does not equal <field> within <number>,contains some ofanddoes not contain all of, plusis alphabetically on or beforeandis alphabetically on or after. The sentence reader'sPhrasehas the variantsNotStartsWith,NotEndsWith,NotType,NotNonEmptyString,ContainsSomeandNotContainsAll,Betweenhas anotfield andAlphabeticallyanor_equalfield. A count, a sum, a plus or an elapsed time can now be followed byis not ... withintoo, which the engine refused before. - Text can be joined on the right side with
followed by, as spec 0.4 says:rego.version is tag.version followed by "-dev". The sentence reader'sOperandhas a new variantJoined, with the pieces in order, andcompareandcontainsread it.
Changed
- A path that names its key by a field lists the field in a row's
inputsfor acount of, asum of, aneveryand asometoo, right after the list's entry, and the check of aforline keeps its whole path,m named by pand thenp, where it showed onlym, as spec 0.4 says. When the path before the field can't be read, aneveryorsomefails with that path's cause, not the field's, soevery zz.x named by p is 1withzzmissing or a string isabsentorunusablewhenpisnull, where it wasnull. A list it walks before the field doesn't count, soevery rows.w named by k is "xy"still fails asnullwhenkisnull. Withrowsnullit fails asnullwhateverkholds, where a missing or numberkgaveabsentorunusable, andfailed_itemsnamesrows, where it was empty whenkcouldn't be read. Aforline whose own path has such a field, likeevery rows.w named by p as w, listsptoo, sorted with the rest by name, asergo.regodoes. Aplusor an elapsed time that reads such a path no longer has the field's location in its own entry, as spec 0.4 says. Reports change for such policies. - The report's
enginename isergo-rust, where it wasergo-policy-engine, so it matches the Rego engine'sergo-regoand therust-v*tag. Every report changes in that field only, and the hash leavesengineout, so hashes stay the same. The version is the same. - The engine follows spec 0.4, so a policy says
ergo_spec: v0.4. - An empty name,
"", is written wrong too, whether it names a requirement, a check, anany_ofoption or a part, witha name can't be empty. - The CLI has its own page,
CLI.md: install, how to run it, its exit codes and how it reads YAML. They were in the README and in this folder's README. - The
$well_formedrow lists the problems of fields, parts and checks sorted by name as the report writes it, quotes and escapes included, by code point, where the quotes were left out, and lists the requirement's own fields first, then the subject's, then the checks. Reports change for names that need quoting and for a requirement with both a field and a subject problem. - An own field named like a part of the subject or like a
foralias keeps its dot in the name of an input, like.cov.pct, and so does the list acount of,sum ofor a walk reads, like.art.xs[]. A policy written wrong keeps the dots it was written with in the expression and infrom: a check whoseforisn't a string, and a part named like one of its parent's. - An input that reads the item's own field named like a parent subject keeps its dot, like
.art.k, as spec 0.4 says. Afromthat starts at the input with anamed bystep is written as it is in the$min_subjectsand$unique_idsexpressions, soevery $input named by $params.kis no longercount(matching(every [$params.k])). Reports change for such policies. Thefroma subject gets insubjectskeeps every dot the policy wrote on the left of awhose, like.art.k,.art.xs[0]or a part's.att.id, where it dropped them. - A policy with no requirement, because
requirementsis missing,null, not an object or empty, gets Ergo's own requirement$policywith a failing$well_formedrow that says what is wrong, as spec 0.4 says, where the report had no row andviolationswas empty whilecompliantwasfalse. A requirement called$policyis written wrong. Reports change for such policies. - A name that starts with
$is written wrong, whether it names a subject, a requirement, a check, anany_ofoption or a part, witha name can't start with $, as spec 0.4 says, in place ofname reserved,a subject can't be named $inputandinvalid aliasfor a part called$dollar. A check with such a name has no entry inrequirements. Reports change for such policies. - A name that starts or ends with a space or an invisible character (Unicode White_Space or general category Cf, like U+200B or U+FEFF) is written wrong too, with
a name can't start or end with a space or an invisible character, as spec 0.4 says, for a subject, a requirement, a check, anany_ofoption and a part. Reports change for such policies. - A key read from
$paramsor$input, afternamed byor in brackets, has to be a string, as spec 0.4 says. A whole number used to read that item of a list, som named by $input.k is 1withkholding1andmholding[5, 1]passed by reading1, andcommits[$params.n]read a commit. It fails asunusablenow, and afromline with such a key gives no subjects. Reports change for such policies. - A
fromline likescans named by $params.env named by each of $params.kgave$min_subjectsthe worst of the causes ofenvandk, so anullenvwithkmissing gaveabsent. The ref before the list decides now, as subjects.sentence says, so that one givesnull. Reports change for such policies, in the cause only.
Fixed
- A check could pass when it should fail. A path named by a
foralias that holds a number read the number as a list position, som named by k is 1underevery ks as kpassed on{"ks": [1], "m": [5, 1]}, by readingm[1]. So did a later item,every ks as k, every m named by k as x, and a one-lineeveryorsomeunder theforline. Aforalias that holds anything but a string now fails asunusable, as for.named_by says, and asergo.regodoes. When the path before it is an object, the failed item is namedm named by k, where it wasitem 4 of mfor a3. Reports change for such policies: some that passed now fail.