2i2c-org / infrastructure

Infrastructure for configuring and deploying our community JupyterHubs.
https://infrastructure.2i2c.org
BSD 3-Clause "New" or "Revised" License
106 stars 65 forks source link

Restrict `profile_list` options depending on the user #1120

Closed choldgraf closed 2 years ago

choldgraf commented 2 years ago

Context

Our profile_list config lets us define a subset of "configuration over-rides" that change the behavior of the user environment with launch.

For hubs that have different groups of users, they may want to allow only a subset of user profiles to be accessible to certain groups of users. For example:

Proposal

We should figure out a pattern to expose different parts of profile_list to different groups of users. A user's membership in a group would determine the profiles that are available to choose from when they hit the profile_list selection page.

Implementation guide and constraints

@consideRatio provided guidance on a way that this could be done by defining a custom spawner function that happened before a launch. Here's a link to details:

https://discourse.jupyter.org/t/tailoring-spawn-options-and-server-configuration-to-certain-users/8449

It sounds like this is "technically possible but with custom configuration" for now, so our goal should be to (1) show that it is possible, with a minimal reproducible example, (2) find a way to make this repeatable so it is not unmaintainable / scalable.

Updates and ongoing work

No response

yuvipanda commented 2 years ago

We support this via GitHub Teams now https://infrastructure.2i2c.org/en/latest/howto/configure/auth-management/github-orgs.html#restricting-user-profiles-based-on-github-team-membership