Sn0rt commented on code in PR #10232:
URL: https://github.com/apache/apisix/pull/10232#discussion_r1335342445
##########
apisix/admin/resource.lua:
##########
@@ -139,7 +181,7 @@ function _M:post(id, conf, sub_path, args)
return 405, {error_msg = "not supported `POST` method for " ..
self.kind}
end
- local id, err = self:check_conf(id, conf, false)
+ local id, err = self:check_conf(id, conf, false, false)
Review Comment:
sound good. I will fix it later
##########
apisix/admin/resource.lua:
##########
@@ -49,7 +49,41 @@ local function split_typ_and_id(id, sub_path)
end
-function _M:check_conf(id, conf, need_id, typ)
+local function check_create_update_time(conf)
+ local not_allow_create_time = "forbidden create_time in request body"
+ local not_allow_update_time = "forbidden update_time in request body"
+
+ if conf.create_time then
+ return not_allow_create_time
+ end
+
+ if conf.update_time then
+ return not_allow_update_time
+ end
+
+ if conf.upstream then
+ if conf.upstream.create_time then
+ return not_allow_create_time
+ end
+ if conf.upstream.update_time then
+ return not_allow_update_time
+ end
+ end
+
+ if conf.plugins then
+ if conf.plugins.create_time then
+ return not_allow_create_time
+ end
+ if conf.plugins.update_time then
+ return not_allow_update_time
+ end
+ end
+
+ return nil
+end
+
+
+function _M:check_conf(id, conf, need_id, need_time, typ)
Review Comment:
great!
--
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]