Skip to content

Commit

Permalink
correct warning
Browse files Browse the repository at this point in the history
  • Loading branch information
An-DJ committed Apr 4, 2023
1 parent 7665604 commit bffbf56
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion apisix/admin/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ function _M.init_worker()
if local_conf.deployment.admin.admin_key_required == false then
core.log.warn("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!")
"please disable `admin_key_required` and set a secure admin key!")
end

local ok, err = ngx_timer_at(0, function(premature)
Expand Down
2 changes: 1 addition & 1 deletion apisix/cli/ops.lua
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ local function init(env)
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!")
.. "please disable `admin_key_required` and set a secure admin key!")
end

if yaml_conf.apisix.enable_admin and not checked_admin_key then
Expand Down
13 changes: 12 additions & 1 deletion t/admin/api.t
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,18 @@ GET /apisix/admin/routes
=== TEST 12: Access without api key, but admin_key_required=false
=== TEST 12: Access without api key, but admin_key_required=true
--- yaml_config
deployment:
admin:
admin_key_required: true
--- request
GET /apisix/admin/routes
--- error_code: 200
=== TEST 13: Access without api key, but admin_key_required=false
--- yaml_config
deployment:
admin:
Expand Down

0 comments on commit bffbf56

Please sign in to comment.