Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consumer List Page reports error when a consumer is created with admin api #2436

Closed
qihaiyan opened this issue Apr 20, 2022 · 5 comments · Fixed by #2437
Closed

Consumer List Page reports error when a consumer is created with admin api #2436

qihaiyan opened this issue Apr 20, 2022 · 5 comments · Fixed by #2437
Labels
bug Something isn't working

Comments

@qihaiyan
Copy link
Contributor

Issue description

Consumer List Page reports error when a consumer is created with admin api, the consumer doesn't have plugin.

Expected behavior

Consumer List should list the consumer created with admin api

How to Reproduce

  1. creating a consumer with admin api:
curl --location --request PUT 'http://10.18.216.71:9180/apisix/admin/consumers'  -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' \
--header 'Content-Type: application/json' \
--data '{"username":"test","desc":"test"}'
  1. then view the Consumer List Page got a error

Screenshots

image

Environment

  • apisix version (2.13.1):
  • OS (image: apache/apisix:2.13.1-alpine):
  • OpenResty / Nginx version (cmd: nginx -V or openresty -V):
  • etcd version, if have (cmd: run etcd --version):
  • apisix-dashboard version, if have: image: apache/apisix-dashboard:2.11-alpine
  • Browser version, if have: Microsoft Edge 100.0.1185.44

Additional context

No response

@qihaiyan qihaiyan added the bug Something isn't working label Apr 20, 2022
@Baoyuantop
Copy link
Contributor

Hi @qihaiyan, thanks for your report.

  1. creating a consumer with admin API:

I want to know the response to this request.
By the way you can refer to https://apisix.apache.org/docs/apisix/admin-api#consumer

@qihaiyan
Copy link
Contributor Author

Hi @qihaiyan, thanks for your report.

  1. creating a consumer with admin API:

I want to know the response to this request. By the way you can refer to https://apisix.apache.org/docs/apisix/admin-api#consumer

the response is

{"action":"set","node":{"value":{"username":"test","update_time":1650504185,"create_time":1650504185,"desc":"test"},"key":"\/apisix\/consumers\/test"}}

the admin api document mentions that only username for consumer is required, other params ars all optional. so when i create a consumer with admin api , only username is used.

@qihaiyan
Copy link
Contributor Author

qihaiyan commented Apr 21, 2022

I made a pr for this issue if you don't mind. #2437 @Baoyuantop

@Baoyuantop
Copy link
Contributor

I made a pr for this issue if you don't mind. #2437 @Baoyuantop

Thanks, let me check

@Baoyuantop
Copy link
Contributor

Dashboard does not allow users to create consumer objects without auth plugins, which seems inconsistent with the Admin API behavior. cc @bzp2010 @juzhiyuan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants