mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-18 23:42:59 +00:00
Added authenticator hook for synchronizing user groups
- Added hook function stub to authenticator base class - Added new config option `manage_groups` to base `Authenticator` class - Call authenticator hook from `refresh_auth`-function in `Base` handler class - Added example
This commit is contained in:

committed by
Min RK

parent
dcf21d53fd
commit
144abcb965
@@ -635,6 +635,30 @@ class Authenticator(LoggingConfigurable):
|
||||
"""
|
||||
self.allowed_users.discard(user.name)
|
||||
|
||||
manage_groups = Bool(
|
||||
False,
|
||||
config=True,
|
||||
help="""Let authenticator manage user groups
|
||||
|
||||
Authenticator must implement get_user_groups for this to be useful.
|
||||
""",
|
||||
)
|
||||
|
||||
def load_user_groups(self, user, auth_state):
|
||||
"""Hook called allowing authenticator to read user groups
|
||||
|
||||
Updates user group memberships
|
||||
|
||||
Args:
|
||||
auth_state (dict): Proprietary dict returned by authenticator
|
||||
user(User): the User object associated with the auth-state
|
||||
|
||||
Returns:
|
||||
groups (list):
|
||||
List of user group memberships
|
||||
"""
|
||||
return None
|
||||
|
||||
auto_login = Bool(
|
||||
False,
|
||||
config=True,
|
||||
|
Reference in New Issue
Block a user