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

bug: plugin basic-auth needs required field #1244

Closed
juzhiyuan opened this issue Mar 13, 2020 · 1 comment · Fixed by #1251
Closed

bug: plugin basic-auth needs required field #1244

juzhiyuan opened this issue Mar 13, 2020 · 1 comment · Fixed by #1251
Assignees

Comments

@juzhiyuan
Copy link
Member

Issue description

Plugin basic-auth doesn't have required field currently.

Environment

  • apisix version (cmd: apisix version):
  • OS:

Minimal test code / Steps to reproduce the issue

None

What's the actual result? (including assertion message & call stack if applicable)

No required field.

What's the expected result?

It should have at least one required field such as username or password in my opinion.

@membphis
Copy link
Member

For all of the authorization plugin:

When it was used with consumer, it is necessary to provide specific authentication information.

When it was used with route / service, we don't need any parameters, just enable or disable this plugin.

So I think the current way is right.

How about this schema definition? Is it better?

oneof = {
    -- no parameter
    required = {}, 
    -- two parameters
    required = {"username", "passwd"}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants