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

Add basic auth for webui #1313

Merged
merged 15 commits into from
Apr 8, 2020
Merged

Add basic auth for webui #1313

merged 15 commits into from
Apr 8, 2020

Conversation

anuj-ssharma
Copy link
Contributor

Added the ability to configure basic auth for the webui. This will be done via the command  line option --web-auth. If enabled, then the routes will need to authorised with the correct credentials before they can be accessed

@codecov
Copy link

codecov bot commented Apr 6, 2020

Codecov Report

Merging #1313 into master will decrease coverage by 0.23%.
The diff coverage is 80.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1313      +/-   ##
==========================================
- Coverage   80.73%   80.50%   -0.24%     
==========================================
  Files          24       24              
  Lines        2154     2154              
  Branches      328      332       +4     
==========================================
- Hits         1739     1734       -5     
- Misses        330      334       +4     
- Partials       85       86       +1     
Impacted Files Coverage Δ
locust/exception.py 100.00% <ø> (ø)
locust/main.py 22.70% <14.28%> (-0.08%) ⬇️
locust/web.py 89.02% <93.75%> (+0.29%) ⬆️
locust/argument_parser.py 75.00% <100.00%> (+0.24%) ⬆️
locust/stats.py 88.24% <0.00%> (-0.47%) ⬇️
locust/rpc/zmqrpc.py 86.20% <0.00%> (-0.46%) ⬇️
locust/util/cache.py 90.90% <0.00%> (-0.40%) ⬇️
locust/runners.py 78.29% <0.00%> (-0.39%) ⬇️
locust/core.py 97.68% <0.00%> (-0.02%) ⬇️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aa16edc...d744e75. Read the comment docs.

@cyberw
Copy link
Collaborator

cyberw commented Apr 6, 2020

LGTM, and I do see the use case. The only drawback is that the list of arguments for locust is getting pretty long.

Could you find somewhere to add it in the documentation?

@cyberw
Copy link
Collaborator

cyberw commented Apr 6, 2020

Perhaps also add a test case where no credentials were provided?

locust/main.py Outdated
@@ -8,6 +8,7 @@
import time

import gevent
from flask_basicauth import BasicAuth
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This import doesn't seem to be used.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, and I do see the use case. The only drawback is that the list of arguments for locust is getting pretty long.

Could you find somewhere to add it in the documentation?

I agree but maybe a separate PR though, what do you think ?

Anuj Sharma added 3 commits April 7, 2020 09:26
… done via the command line option --web-auth. If enabled, then the routes will need to authorised with the correct credentials before they can be accessed.
@heyman heyman merged commit eecfb12 into locustio:master Apr 8, 2020
@heyman
Copy link
Member

heyman commented Apr 8, 2020

Great! Thanks!

@cyberw
Copy link
Collaborator

cyberw commented Nov 21, 2023

@anuj-ssharma I want to deprecate (and then remove) the support for basic auth. It relies on Flask-BasicAuth that hasnt been updated for a REALLY long time. Do you have a problem with this? Or maybe you want to update it?

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 this pull request may close these issues.

3 participants