LuciaCabanillasRodriguez commented on issue #11908:
URL: https://github.com/apache/apisix/issues/11908#issuecomment-2592248479
And how could I access that field in the OPA result?
I was trying something like that but I am not very clear on how to get that
value:
```
"proxy-rewrite": {
"uri": "/${upstream_uri}"
},
"serverless-pre-function": {
"functions": [
"return function(conf, ctx)\n local core =
require(\"apisix.core\")\n core.ctx.register_var(\"opa_query\",
function(ctx)\n if ctx.var.opa_result and ctx.var.opa_result.result and
ctx.var.opa_result.result.dynamic_metadata and
ctx.var.opa_result.result.dynamic_metadata.query then\n return
ctx.var.opa_result.result.dynamic_metadata.query.q\n end\n return nil\n
end)\n local query_q = ctx.var.opa_query\n if query_q then\n local
encoded_q = core.utils.url_escape(\"publisher==\\\"\" .. query_q .. \"\\\"\")\n
ctx.var.upstream_uri =
```
Thanks! :)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]