-
Notifications
You must be signed in to change notification settings - Fork 1.9k
fix: Add access-control for admin-specific route #5942
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
fix: Add access-control for admin-specific route #5942
Conversation
b446a77 to
e2020af
Compare
|
@iamareebjamal Please check |
Codecov Report
@@ Coverage Diff @@
## development #5942 +/- ##
==============================================
- Coverage 66.44% 66.4% -0.05%
==============================================
Files 285 285
Lines 13871 13893 +22
==============================================
+ Hits 9216 9225 +9
- Misses 4655 4668 +13
Continue to review full report at Codecov.
|
|
HTTP Basic Auth should work with this. Please handle that |
HTTP basic auth as in? Can you please elaborate? |
|
@iamareebjamal Should the user be redirected to the authentication page when they're not logged in as an admin?Also, Isn't the basic HTTP auth working now? |
|
No, there'll be no redirection https://www.httpwatch.com/httpgallery/authentication/#showExample10 |
e2020af to
f098207
Compare
fc3f78d to
9e7f96a
Compare
|
Please verify that it is working or not |
1ba0852 to
3b88c50
Compare
| return f(*args, **kwargs) | ||
| return decorated | ||
|
|
||
| @authorised_blueprint.route('/environment') |
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.
expected 2 blank lines, found 1
| return ForbiddenError({'source': ''}, 'Authentication Required to access Invoice').respond() | ||
|
|
||
| # Access for Environment details & Basic Auth Support | ||
| def check_auth_admin(username, password): |
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.
expected 2 blank lines, found 1
3b88c50 to
8147af8
Compare
|
@iamareebjamal I've add proper support now which handles the admin access. I've also attached a GIF to the description. It works fine now. |
8147af8 to
7647046
Compare
Added basic auth support
29716fc to
89e1b28
Compare
Fixes #5923
Checklist
developmentbranch.Short description of what this resolves:
Fixes the vulnerability issue alluding to the credentials and environment details which are exposed to non-admin users.
Changes proposed in this pull request:
is_admindecorator to check for access