An-DJ commented on code in PR #9147:
URL: https://github.com/apache/apisix/pull/9147#discussion_r1156967360
##########
apisix/cli/ops.lua:
##########
@@ -189,6 +189,13 @@ local function init(env)
and #allow_admin == 1 and allow_admin[1] == "127.0.0.0/24" then
checked_admin_key = true
end
+ -- check if admin_key is required
+ if yaml_conf.deployment.admin.admin_key_required == false then
+ checked_admin_key = true
+ print("Warning! Admin key is bypassed! "
+ .. "If you are deploying APISIX in a production environment, "
+ .. "please disable it and set a secure password for the admin
Key!")
+ end
Review Comment:
It seems that the only code common to both sides is:
```
if conf.deployment.admin.admin_key_required == false then
print / log
end
```
Actually the output approach is different (before APISIX starting is
`print`, after starting is `log`).
So IMHO, merge this two part to one function is unnecessary, because the
common part is too simple (only with common part
`conf.deployment.admin.admin_key_required == false` )
--
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]