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

ast+cmd: Allowing bundle to contain calls to unknown functions when inspected #6462

Merged

Conversation

johanfylling
Copy link
Contributor

Fixes: #6457


bs := out.Bytes()
output := strings.TrimSpace(string(bs))
// Note: unknown foo.bar() built-in doesn't appear in the output, but also didn't cause an error.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've taken care of the bug that will opa inspect fail with an error.

As a possible improvement, we could also include the unknown function in the capabilities/builtins listing. We wouldn't know the types other than what's in the call, though, so I think we'd need to set the result and args types to any.
The question is if this would be helpful or confusing to the user.

…nspected

Fixes: open-policy-agent#6457
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
@johanfylling johanfylling merged commit 9f63fdb into open-policy-agent:main Dec 20, 2023
24 checks passed
@johanfylling johanfylling deleted the cmd/inspect_unknown_funcs branch December 20, 2023 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

opa inspect failure on custom funcs in policies
2 participants