-
Notifications
You must be signed in to change notification settings - Fork 11
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
Support apikey auth #46
Conversation
Tested on sensu backend 5.21 and 6.2.5 |
@fgouteroux Cool - thanks for working on this. Overall this looks good to me. but now that username, password, and an API key are all optional, I think we should add some kind of additional logic to make sure that the user has supplied a valid combination of authentication. This should probably go in if c.username == "" && c.password == "" && c.apiKey == "" {
return nil, fmt.Errorf("Must provide a username and password or an API key")
}
if c.username != "" && c.password == "" {
return nil, fmt.Errorf("Must provide a password when using a username")
}
etc Thoughts? |
Yes, you are right, so I also added the schema conflicts keys, which provide this output when api_key and username/password are provided together. Error: "api_key": conflicts with username
Error: "username": conflicts with api_key
Error: "password": conflicts with api_key |
Nice work 🙂 Let me know if you're ready for this to be merged. |
Yes, this is ready to be merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - thank you!
Hi @jtopjian,
It's been a while, ;-)
Adding support of api key authentication (more secure than username/password), based on sensu/sensu-go#4256.