bzp2010 commented on code in PR #12424:
URL: https://github.com/apache/apisix/pull/12424#discussion_r2208089852
##########
apisix/admin/consumer_group.lua:
##########
@@ -23,7 +23,7 @@ local tostring = tostring
local ipairs = ipairs
-local function check_conf(id, conf, need_id, schema)
+local function check_conf(id, conf, need_id, schema, secret_type,
skip_references_check)
Review Comment:
What is the relevance of secret type to consumer group? In fact, according
to these code changes, it has nothing to do with any code other than the secret.
Normally, we wouldn't write something like `fu(nil, true)` in codes. A
required field (infer from your use case) should not come after an optional
field.
Most functions don't care about the value of `secret_type`, and more
importantly, we can't accept an infinite rise in the number of input arguments
to this function. I would suggest using a table directly as an input parameter,
so that you can be completely unconcerned about which fields are not needed.
```lua
local function fn1(i1, i2, i3, opts)
if opts.skip_references_check then
-- do something
end
end
local function fn2(i1, i2, i3, opts)
if opts.secret_type == "xx" then
-- do something
end
end
```
--
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]