-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
opa eval on windows uses drive letter as json object for the data document #4174
Comments
Additional NoteI did a deeper review on #1505 - looks like using file:/// url is another work around that the vscode plugin was modified to use, but it was stated that a subsequent release of opa was supposed to fix it, which I assume meant the exe to have the capability to properly parse the drive letter w/out making it part of the json object. Or is opa.exe using file:/// url syntax supposed to be the permanent fix? If so:
|
Heya, sorry for the radio silence. Yeah it seems like there's some ambiguity here, and I don't see how it could be fixed, except for using Where would you have expected this being documented...? 🤔 I wonder if we need a "specific to Windows" section in the docs, or something. The code reference you've found is the help output of the eval command, i.e. what you see when you use |
This issue has been automatically marked as inactive because it has not had any activity in the last 30 days. |
The CLI docs are up. Let's close this, it's not clear how we can improve this in code. Feel free to reopen of you think otherwise. 😃 |
Short description
opa eval on windows using absolute paths for the data files is consuming the drive letter as an json object. Looks related to related to #1505 but is happening at the command line directly, outside of any plugin. Worth noting that evals were producing undefined in the JetBrains OPA Plugin which led to me troubleshooting this outside of the plugin/IDE and directly in the command line.
Oddly, the rego policy doesn't seem affected by this.
Windows 10 21H1 OS Builds 19043.1415)
OPA version
Steps To Reproduce
Using the RBAC example from the rego playground:
This yields:
As in #1505, the drive letter becomes an object in the json for the data document
Expected behavior
I expect that the drive letter used in the absolute path is not parsed as a json object at the command line
Additional context
It's worth noting that while the input and policy json files provided at the command line also use absolute pathing, they are not parsed with the drive letter as a json object.
Example of eval on input
Example of eval on policy namespace under the data document
Workaround
Seems that referencing the documents with a path relative to the root of the current drive is a workaround
yields
This pathing from root also works in the JetBrains OPA Plugin
![image](https://user-images.githubusercontent.com/7775294/147673317-704f53f5-9e2f-4e21-9465-64c73e98d77f.png)
The text was updated successfully, but these errors were encountered: