ppl: add data type, implement string and list matchers (#2228)

* ppl: add data type, implement string and list matchers

* update policy converter
This commit is contained in:
Caleb Doxsey 2021-05-21 11:28:41 -06:00 committed by GitHub
parent 1cd95e808d
commit 96b9702ee3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 325 additions and 104 deletions

View file

@ -12,7 +12,7 @@ import (
func Test(t *testing.T) {
g := New(WithCriterion(func(g *Generator) Criterion {
return NewCriterionFunc([]string{"accept"}, func(subPath string, data parser.Value) (rule *ast.Rule, additionalRules []*ast.Rule, err error) {
return NewCriterionFunc(CriterionDataTypeUnused, []string{"accept"}, func(subPath string, data parser.Value) (rule *ast.Rule, additionalRules []*ast.Rule, err error) {
rule = g.NewRule("accept")
rule.Body = append(rule.Body, ast.MustParseExpr("1 == 1"))
return rule, nil, nil