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

cmd/exec: Supporting simultaneous input from stdin and files #6831

Merged

Conversation

johanfylling
Copy link
Contributor

Previously, opa exec --stdin-input input1.json input2.json would read input from stdin, but ignore the provided input file paths.

e.g., opa exec --decision /foo/bar/baz ...

Alternative Usage:
` + RootCommand.Use + ` exec [<path> [...]] --stdin-input [flags]`,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

$ opa exec -h
Execute against input files.

The 'exec' command executes OPA against one or more input files. If the paths
refer to directories, OPA will execute against files contained inside those
directories, recursively.

The 'exec' command accepts a --config-file/-c or series of --set options as
arguments. These options behave the same as way as 'opa run'. Since the 'exec'
command is intended to execute OPA in one-shot, the 'exec' command will
manually trigger plugins before and after policy execution:

Before: Discovery -> Bundle -> Status
After: Decision Logs

By default, the 'exec' command executes the "default decision" (specified in
the OPA configuration) against each input file. This can be overridden by
specifying the --decision argument and pointing at a specific policy decision,
e.g., opa exec --decision /foo/bar/baz ...

Alternative Usage:
  opa_darwin_arm64 exec [<path> [...]] --stdin-input [flags]

Usage:
  opa_darwin_arm64 exec <path> [<path> [...]] [flags]

Copy link

netlify bot commented Jun 26, 2024

Deploy Preview for openpolicyagent ready!

Name Link
🔨 Latest commit 9ccdd54
🔍 Latest deploy log https://app.netlify.com/sites/openpolicyagent/deploys/667c1b6321ae3f0008e91409
😎 Deploy Preview https://deploy-preview-6831--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.

@johanfylling johanfylling merged commit e50a306 into open-policy-agent:main Jun 26, 2024
28 checks passed
@johanfylling johanfylling deleted the exec/support_stdin_and_files branch June 26, 2024 13:54
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.

None yet

2 participants