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

Fix/inspect unknowns in with stmt #6824

Conversation

johanfylling
Copy link
Contributor

Allowing with statement to contain references to unknown functions during bundle inspection.

Fixes: #6812

Fixing issue where policies containing `with` replacing unknown functions can't be inspected.

Fixes: open-policy-agent#6812
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
when `allowUndefinedFuncCalls` is enabled

Signed-off-by: Johan Fylling <johan.dev@fylling.se>
Copy link

netlify bot commented Jun 17, 2024

Deploy Preview for openpolicyagent ready!

Name Link
🔨 Latest commit b45b4bb
🔍 Latest deploy log https://app.netlify.com/sites/openpolicyagent/deploys/6672b48d4feae800080f0623
😎 Deploy Preview https://deploy-preview-6824--openpolicyagent.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@tsandall tsandall requested a review from srenatus June 18, 2024 18:00
@tsandall
Copy link
Member

@srenatus PTAL

Copy link
Contributor

@srenatus srenatus left a comment

Choose a reason for hiding this comment

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

LGTM, the tests are comprehensive. Does this have implications for stuff like this in the playground?

@johanfylling
Copy link
Contributor Author

@srenatus, this won't (automatically) open up for mocking unknown built-ins in the playground. We only allow that when WithAllowUndefinedFunctionCalls(true) is set on the compiler; which right now is only set by the inspect command. We could possibly let the playground also set this too (maybe behind a toggle), but since this was designed specifically for bundle inspection, we'd need to investigate implications for topdown.

@johanfylling johanfylling merged commit b4679c2 into open-policy-agent:main Jun 19, 2024
28 checks passed
@johanfylling johanfylling deleted the fix/inspect_unknowns_in_with_stmt branch June 19, 2024 10:45
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 command failing after version upgrade on mock-tests for remote/external function dependencies
3 participants