You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Similar to #2027 but more specific to the HTTP server in OPA.
Expected Behavior
With a policy like:
package policy["com.foo.acme.ingress"].main
p :=1
When I make a REST API call to /v1/data/policy/com.foo.acme.ingress/main/p I should see a decision log entry with path set to policy/com.foo.acme.ingress/main/p
Actual Behavior
The decision log path swaps all .'s to /'s so the path ends up being incorrect:
Run opa server with policy as described above, and decision logger enabled: opa run -s --log-format json-pretty --set decision_logs.console=true /tmp/policy.rego
Make a request with the data API path including the non-standard package name: curl -s localhost:8181/v1/data/policy/com.foo.acme.ingress/main/p
Observe the decision log output from the server
The text was updated successfully, but these errors were encountered:
The logger was swapping `.`'s with `/`'s but this isn't safe when a
valid path should be /foo/a.b.c/main. The server was already doing
the right thing by passing in the url path where applicable, or only
specifying a query instead of the path.
This might affect anyone using the decision logger golang API passing
in something in dot-notation and expecting it to come out with paths.
Anyone using the HTTP server should be unaffected.
Fixes: open-policy-agent#2031
Signed-off-by: Patrick East <east.patrick@gmail.com>
The logger was swapping `.`'s with `/`'s but this isn't safe when a
valid path should be /foo/a.b.c/main. The server was already doing
the right thing by passing in the url path where applicable, or only
specifying a query instead of the path.
This might affect anyone using the decision logger golang API passing
in something in dot-notation and expecting it to come out with paths.
Anyone using the HTTP server should be unaffected.
Fixes: #2031
Signed-off-by: Patrick East <east.patrick@gmail.com>
Similar to #2027 but more specific to the HTTP server in OPA.
Expected Behavior
With a policy like:
When I make a REST API call to
/v1/data/policy/com.foo.acme.ingress/main/p
I should see a decision log entry withpath
set topolicy/com.foo.acme.ingress/main/p
Actual Behavior
The decision log path swaps all
.
's to/
's so the path ends up being incorrect:Steps to Reproduce the Problem
opa run -s --log-format json-pretty --set decision_logs.console=true /tmp/policy.rego
curl -s localhost:8181/v1/data/policy/com.foo.acme.ingress/main/p
The text was updated successfully, but these errors were encountered: