The group sync works as expected. After I login, I can see the the groups created in the admin panel. However, as admin, I cannot delete or edit these groups.
logs from hub:
Checking access to /hub/api/groups/jupyterhub-test-admin via scope delete:groups!group=jupyterhub-test-admin
[W 2025-01-27 12:04:45.399 JupyterHub web:1873] 400 DELETE /hub/api/groups/jupyterhub-test-admin?_xsrf=token (95.90.206.235): Group management via API is disabled
[W 2025-01-27 12:04:45.399 JupyterHub log:192] 400 DELETE /hub/api/groups/jupyterhub-test-admin?_xsrf=[secret]
Is that the expected behaviour? I thought that having admin permission includes this role : āadmin:groups!group=jupyterhub-test-adminā and āadmin:users!group=jupyterhub-test-adminā
I need to be able to delete the groups because sometimes we delete the user groups in azure app registration, but this is not synced in jupyterhub user management database. Even though the groups is delete in azure, it still remains in jupyterhub.
Unfortunately, there is currently no way to delete groups when the Authenticator is managing them. We set this up for roles to have the ability to re-initialize roles on startup, but havenāt done that for groups.
Weāll have to think about what that config should look like, but I think the simplest fix is to actually change the āGroup management via API is disabledā condition to only apply to group membership, and still permit group creation and deletion via the API.
We could also reconsider blocking group-management via the API altogether. Admins will have to realize that any changes they make via the API will be overridden when users login again, but this would allow manual reconciliation like the deletion here without any unnecessary frustration. But itās not inherently wrong to allow group management via the API. It just may lead to surprise that admin changes may get lost since the Authenticator has priority. But if the admin changes are manually reconciling with upstream as is the case here, then everything will be as the admin expects. Iām currently leaning toward this choice.
allow group management API when managed_groups is True by minrk Ā· Pull Request #5004 Ā· jupyterhub/jupyterhub Ā· GitHub removes the manage_groups check, allowing admins full access to group membership. Thereās a caveat that managed groups means that any changes you make manually could be clobbered by an authentication event, but that doesnāt mean you shouldnāt be allowed to ever make them (especially those that canāt be done by authentication events, such as group deletion).