-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
The [opa eval] command is unable to access Rego policies located on other drives on windows #6922
Changes from 3 commits
3a9a702
02dc039
9601e7e
b2f071f
035070d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -879,6 +879,15 @@ func TestSplitPrefix(t *testing.T) { | |
wantParts: []string{"x", "y"}, | ||
wantPath: "file:///c:/a/b/c", | ||
}, | ||
{ | ||
input: "c:/a/b/c", | ||
wantPath: "c:/a/b/c", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doesn't seem compatible with how data prefixes work in OPA, as we'd expect There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it advisable to always use a file URL(ex: In this image, we see that using |
||
}, | ||
{ | ||
input: "c:file:///c:/a/b/c", | ||
wantParts: []string{"c"}, | ||
wantPath: "file:///c:/a/b/c", | ||
}, | ||
} | ||
|
||
for _, tc := range tests { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we put significance on the path containing
file:///
or the document prefix being more than one chars long for us to return those parts rather than the givenpath
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To add some context: I believe the prefix part is the prefix for which the contents of that file will be found under the
data
document during evaluation.E.g.: given the following data file
data.json
:and we run:
we expect the output:
But if we add the
a:
prefix to the file path, we expect this prefix to be added to the data document: