You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "An-DJ (via GitHub)" <gi...@apache.org> on 2023/04/04 09:01:31 UTC
[GitHub] [apisix] An-DJ commented on a diff in pull request #9147: feat(cli): support bypassing Admin API Auth by configuration
An-DJ commented on code in PR #9147:
URL: https://github.com/apache/apisix/pull/9147#discussion_r1156948151
##########
t/admin/token.t:
##########
@@ -177,3 +177,21 @@ PUT /apisix/admin/plugins/reload?api_key=4054f7cf07e344346cd3f287985e76a2
--- request
GET /apisix/admin/routes??api_key=4054f7cf07e344346cd3f287985e76a2
--- error_code: 401
+
+
+
+=== TEST 10: access without api key
+--- request
+GET /apisix/admin/routes
+--- error_code: 401
+
+
+
+=== TEST 11: access without api key, but APISIX_BYPASS_ADMIN_API_AUTH=true
+--- main_config
+env APISIX_BYPASS_ADMIN_API_AUTH=true;
Review Comment:
We can export an env variable and use it in `config.yaml`:
https://github.com/apache/apisix/blob/master/conf/config.yaml#L28
For example:
```
export admin_key_required=false
echo '
deployment:
admin:
admin_key_required: ${{admin_key_required}}
' > conf/config.yaml
```
--
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: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org