Web UI Modern Auth - #2538
Conversation
4569b0d to
f302982
Compare
|
Cool stuff. See comments. Can you have an extra look and ensure there are no remnants (documentation etc) of the old stuff? Pretty sure we can nuke the AuthCredentialsError class for example. |
3c9e288 to
0520dbf
Compare
|
Looking good! Only that one last comment about --web-auth :) |
47cb865 to
099ac03
Compare
|
Given that the package we use is called flask-login, perhaps it makes more sense to name the argument |
|
Yup that makes sense! What do you think about |
099ac03 to
09d11c5
Compare
| host: str, | ||
| port: int, | ||
| auth_credentials: Optional[str] = None, | ||
| use_auth: bool = False, |
There was a problem hiding this comment.
rename this to web_login? or maybe just login...
| metavar="<username:password>", | ||
| default=None, | ||
| help="DEPRECATED. See https://github.com/locustio/locust/issues/2517 Turn on Basic Auth for the web interface. Should be supplied in the following format: username:password ", | ||
| help="DEPRECATED: use --web-login", |
There was a problem hiding this comment.
Change this to configargparse.SUPPRESS to hide it from the help text and let the error message speak for itself :)
|
I made two more comments :) And also... I have another thought. Maybe we dont even need a command line argument to enable it? Perhaps we can just check whether someone has registered a user_loader callback (by calling |
09d11c5 to
71e856e
Compare
|
Unfortunately I don't think there's a clean way to get around having an argument. The issue is that without the argument we need to initialize the |
|
I guess we could have the users set their |
|
I see! Sounds messy. Lets keep the parameter then. Ok to merge? |
|
Let's do it :) |
|
Never mind, it is fine, I just made a mistake when testing it :) |
Fixes #2517
Proposal
flask_basicauthin favor offlask_login. The proposal is to move the responsibility of security and maintainability onto the user. Locust will simply specify which routes need to be protected, but the user will be the one responsible for implementing the protection. This has the added benefit of providing flexibility as to how users authenticate to the app