apisix icon indicating copy to clipboard operation
apisix copied to clipboard

bug: manager-api should not allow create consumers with two more auth plugin

Open idbeta opened this issue 6 years ago • 2 comments

Bug report

Describe the bug

Same as adminAPI, manager-api should not allow create consumers with more than one auth plugins, but now it is allowed.

How to Reproduce

{
			caseDesc: "create consumers with two auth plugin",
			Object:   MangerApiExpect(t),
			Path:     "/apisix/admin/consumers",
			Method:   http.MethodPut,
			Body: `{
						"username": "case_11",
						"plugins": {
							"jwt-auth": {
								"key": "a36c3049b36249a3c9f8891cb127243c",
								"secret": "e71829c351aa4242c2719cbfbe671c09"
							},
							"key-auth": {
							"key": "auth-one"
							}
						}
			   }`,
			Headers:      map[string]string{"Authorization": token},
			ExpectStatus: http.StatusBadRequest,
			ExpectBody:   "scheme validate failed",
		},

idbeta avatar Nov 25 '20 09:11 idbeta

nice catch

membphis avatar Nov 25 '20 09:11 membphis

after we talked right now, I think manager-api way is correct.

"allow one consumer to bind more than one auth plugins", that is the right way. I think the APISIX should support this case too.

membphis avatar Nov 25 '20 11:11 membphis