bzp2010 commented on a change in pull request #5874:
URL: https://github.com/apache/apisix/pull/5874#discussion_r774726348
##########
File path: apisix/plugins/opa/helper.lua
##########
@@ -45,16 +52,136 @@ local function build_http_request(conf, ctx)
end
-function _M.build_opa_input(conf, ctx, subsystem)
- local request = build_http_request(conf, ctx)
+local function _build_http_route(conf, ctx)
+ local route_id = ctx.route_id
+ local routes = get_routes()
+
+ for _, route in ipairs(routes) do
+ if route.value.id == route_id then
+ return core.table.deepcopy(route).value
Review comment:
Yes, deepcopy is too expensive to use and I have switched it to
`table.clone`.
##########
File path: apisix/plugins/opa/helper.lua
##########
@@ -45,16 +52,136 @@ local function build_http_request(conf, ctx)
end
-function _M.build_opa_input(conf, ctx, subsystem)
- local request = build_http_request(conf, ctx)
+local function _build_http_route(conf, ctx)
+ local route_id = ctx.route_id
+ local routes = get_routes()
Review comment:
changed
--
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]