-
Notifications
You must be signed in to change notification settings - Fork 67
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
[LEAP Hub] Allow for profile list options based on GitHub team membership #1146
Comments
Note how we in this example have this line: auth_state = await spawner.user.get_auth_state() If we want to make decisions based on a GitHubOAuthenticator which is informed about what teams etc a user is part of, we should probably work to address the feature request: jupyterhub/oauthenticator#492 |
Ah-ha good catch @consideRatio , thanks for the reminder. Anything else that you think is needed in order to implement this within our hubs? |
@choldgraf no I think that is all it takes! |
Note - there was some other conversation about this in the original thread here: |
Hoping to get 2i2c-org/infrastructure#1146 done. Longer term, we might use some of the new group management features that JupyterHub 2.x uses - but I think this is still pretty helpful, and we're still on 1.x :D We automatically add read:org permission if the fetch_teams flag is set, otherwise you just get thrown a weird error. Fixes jupyterhub#492
@rabernat I just opened jupyterhub/oauthenticator#498 which should get us most of the way here. |
Hoping to get 2i2c-org/infrastructure#1146 done. Longer term, we might use some of the new group management features that JupyterHub 2.x uses - but I think this is still pretty helpful, and we're still on 1.x :D We automatically add read:org permission if the fetch_teams flag is set, otherwise you just get thrown a weird error. Fixes jupyterhub#492
profile_list is now dynamically generated, based on the GH teams user is a part of. This list of teams is refreshed only during login - so user needs to log out and log back in to see new teams! This also means that users removed from teams on GH will still have access to the profiles until they are logged out from the admin panel too (to be fixed) This approach is taken over customizing options_form to protect against users just bypassing the options form and using the API directly to spawn servers. Deployed to the leap hub, except 'huge' is only available to leap-stc:leap-pangeo-users members, not 2i2c-org:tech-team members. This is temporary. Fixes 2i2c-org#1146
profile_list is now dynamically generated, based on the GH teams user is a part of. This list of teams is refreshed only during login - so user needs to log out and log back in to see new teams! This also means that users removed from teams on GH will still have access to the profiles until they are logged out from the admin panel too (to be fixed) This approach is taken over customizing options_form to protect against users just bypassing the options form and using the API directly to spawn servers. Deployed to the leap hub, except 'large' & 'huge' is only available to leap-stc:leap-pangeo-research members, not to leap-stc:leap-pangeo-users members - based on 2i2c-org#1050 (comment) Fixes 2i2c-org#1146
profile_list is now dynamically generated, based on the GH teams user is a part of. This list of teams is refreshed only during login - so user needs to log out and log back in to see new teams! This also means that users removed from teams on GH will still have access to the profiles until they are logged out from the admin panel too (to be fixed) This approach is taken over customizing options_form to protect against users just bypassing the options form and using the API directly to spawn servers. Deployed to the leap hub, except 'large' & 'huge' is only available to leap-stc:leap-pangeo-research members, not to leap-stc:leap-pangeo-users members - based on 2i2c-org#1050 (comment) Fixes 2i2c-org#1146
ok, #1239 sets this up! I've 'small' and 'medium' available to |
@rabernat, can you confirm if you tested it? Thanks! |
Yes I tested it and it works as expected. |
Background and proposal
The LEAP Hub has different sub-communities within its user community. Some of them require access to more complex infrastructure than others, and they'd like to offer different environments to some users over others.
Specifically, they'd like this breakdown of github team membership and machine types (ref: #1050 (comment)):
leap-stc/leap-pangeo-users
leap-stc/leap-pangeo-research
So from a user's perspective, the end-result they would like is something like:
Implementation guide and constraints
@consideRatio provided a nice description of the solution in this Discourse comment.
Here's the major parts of this approach:
Opportunity to generalize
Note that while this is a request for a specific hub, the general pattern of "allow some users access to a subset of environments" will likely be very common. As we do this work, we should keep an eye on how to document and/or abstract this process to be repeatable with minimal extra toil.
Updates and ongoing work
The text was updated successfully, but these errors were encountered: