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
# Running OPA 1.0.0
./opa_darwin_arm64_static_1.0.0 run -s 2>> opa.log &
# Put a document where the path contains backslash character (backslash character URL encoded to %5C)
curl -XPUT 'http://localhost:8181/v1/data/some/path/pa%5Cpa/test2' -d'{"key": "value"}'
# Getting the inserted document
curl -XGET 'http://localhost:8181/v1/data/some/path/pa%5Cpa/test2'
{
"code": "internal_error",
"message": "2 errors occurred:\n1:19: rego_parse_error: illegal escape sequence\n\tdata[\"some\"].path[\"pa\\pa\"].test2\n\t ^\n1:19: rego_parse_error: illegal token\n\tdata[\"some\"].path[\"pa\\pa\"].test2\n\t ^"
}
Expected behavior
This behaves as expected in OPA 0.70.0
# Running OPA 0.70.0
./opa_darwin_arm64_static_0.70.0 run -s 2>> opa.log &
# Put a document where the path contains backslash character (backslash character URL encoded to %5C)
curl -XPUT 'http://localhost:8181/v1/data/some/path/pa%5Cpa/test2' -d'{"key": "value"}'
# Getting the inserted document
curl -XGET 'http://localhost:8181/v1/data/some/path/pa%5Cpa/test2'
{"result":{"key":"value"}}
Additional context
Looks like in 1.0.0 GET API is expecting the path to be quoted in JSON, whereas the PUT is working as before.
# Running OPA 1.0.0
./opa_darwin_arm64_static_1.0.0 run -s 2>> opa.log &
# Put a document where the path contains backslash character (backslash character URL encoded to %5C)
curl -XPUT 'http://localhost:8181/v1/data/some/path/pa%5Cpa/test2' -d'{"key": "value"}'
# Getting the inserted document (NOTE the double backslashes URL encoded as %5C%5C)
curl -XGET 'http://localhost:8181/v1/data/some/path/pa%5C%5Cpa/test2'
{"result":{"key":"value"}}
The text was updated successfully, but these errors were encountered:
Interesting. I don't recall us having made any changes in that code recently. I wonder if it could be some dependency that changed? Oh well, I guess we'll find out eventually. Thanks for reporting it!
Short description
OPA 1.0.0 get document API is broken when path contains backslash character.
Steps To Reproduce
Expected behavior
This behaves as expected in OPA 0.70.0
Additional context
Looks like in 1.0.0 GET API is expecting the path to be quoted in JSON, whereas the PUT is working as before.
The text was updated successfully, but these errors were encountered: