-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
feat(admin) Add authorization provider in snuba admin #2301
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2301 +/- ##
==========================================
- Coverage 92.75% 92.74% -0.01%
==========================================
Files 558 559 +1
Lines 25668 25694 +26
==========================================
+ Hits 23808 23831 +23
- Misses 1860 1863 +3
Continue to review full report at Codecov.
|
snuba/admin/auth.py
Outdated
# TODO: provide a more structured representation of the User that | ||
# includes the role at least. | ||
def authorize_request() -> str: | ||
provider_id = state.settings.ADMIN_AUTH_PROVIDER |
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.
Don't think you need to go through state module for this
provider_id = state.settings.ADMIN_AUTH_PROVIDER | |
provider_id = snuba.settings.ADMIN_AUTH_PROVIDER |
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.
right I changed it from runtime config to settings sand forgot to fix that
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.
Thanks, this will be useful
The admin relies on a proxy to perform authentication and authorization.
This is not great for two reasons:
This adds an abstraction to performa authorization before each server request on the admin UI.
This abstraction has multiple implementations for multiple authorization providers. The default is NOOP and allows everything through. The next to be implemented is IAP, then we can add one for basic HTTP auth useful on prem.