Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wasm: glob.match default delimiters aren't handled properly #3294

Closed
srenatus opened this issue Mar 19, 2021 · 0 comments · Fixed by #3296
Closed

wasm: glob.match default delimiters aren't handled properly #3294

srenatus opened this issue Mar 19, 2021 · 0 comments · Fixed by #3296
Assignees

Comments

@srenatus
Copy link
Contributor

The these four calls should yield the same thing:

$ opa eval -t rego --format=pretty  'glob.match("*foo*", [], "5.0 foo/90")'
false
$ opa eval -t rego --format=pretty  'glob.match("*foo*", ["."], "5.0 foo/90")'
false
$ opa eval -t wasm --format=pretty  'glob.match("*foo*", [], "5.0 foo/90")'
true
$ opa eval -t wasm --format=pretty  'glob.match("*foo*", ["."], "5.0 foo/90")'
false

The last two don't line up, but the docs on glob.match say

If delimiters is empty, it defaults to ["."].

@srenatus srenatus self-assigned this Mar 19, 2021
srenatus added a commit to srenatus/opa that referenced this issue Mar 19, 2021
Also
- use opa_value_iter in opa_glob_match
- add test cases to `wasm-rego-test`
- adapt existing test cases in `wasm-lib-test`

Fixes open-policy-agent#3294.

Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
srenatus added a commit that referenced this issue Mar 19, 2021
Also
- use opa_value_iter in opa_glob_match
- add test cases to `wasm-rego-test`
- adapt existing test cases in `wasm-lib-test`

Fixes #3294.

Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant