-
Notifications
You must be signed in to change notification settings - Fork 76
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: Support pre-configured supertoken authentication #687
base: main
Are you sure you want to change the base?
feat: Support pre-configured supertoken authentication #687
Conversation
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #687 +/- ##
==========================================
- Coverage 83.23% 83.18% -0.05%
==========================================
Files 79 79
Lines 6291 6304 +13
==========================================
+ Hits 5236 5244 +8
- Misses 1055 1060 +5 ☔ View full report in Codecov by Sentry. |
Co-authored-by: Jan-Benedikt Jagusch <[email protected]>
def assert_server_roles(self, roles: list, msg: Optional[str] = None): | ||
if self.is_supertoken: | ||
return "supertoken" |
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.
I don't like how we're sneaking the super token into the authorization layer here. But I also understand that anything more explicit would require big changes in the Quetz authentication and authorization model.
Motivation
We want to run automated CI tests on a dockerized version of quetz (deployed with helm/Kubernetes). To be able to use the API there without any real user (e.g. authenticated via GitHub) we would like to be able to define a supertoken in the TOML config. It should act as an initial technical service account.
This token does not have to support all API endpoints (that could depend on an actual user being present). However, it should at least support creating new "real users" with username/password authentication (in our case https://github.com/mamba-org/quetz-sql-authenticator).
Changes
Introduce a new config element
users.supertoken
and allow theRules
class to bypass this token in the server role assertions.