Skip to content

Commit

Permalink
update docstrings on relationship between allowed_groups and `allow…
Browse files Browse the repository at this point in the history
…_[provider_group_equivalents]`

should clarify that they do not conflict, and are used in different circumstances.
  • Loading branch information
minrk committed Sep 2, 2024
1 parent ab1f75e commit e3c44c4
Showing 1 changed file with 24 additions and 16 deletions.
40 changes: 24 additions & 16 deletions oauthenticator/oauth2.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,9 +334,17 @@ class OAuthenticator(Authenticator):
Unicode(),
config=True,
help="""
Allow members of selected groups to log in.
Requires `manage_groups` to also be `True`.
Allow members of selected JupyterHub groups to log in.
Requires :attr:`manage_groups` to also be `True`.
Typically also requires :attr:`auth_state_groups_key` to be configured to populate the JupyterHub groups.
This option is *independent* of other configuration such as :attr:`.GitLabOAuthenticator.allowed_gitlab_groups`,
which do not populate the *JupyterHub* groups,
and do not require :attr:`manage_groups` to be True.
.. versionadded:: 17
Previously available only on :class:`.GenericOAuthenticator`
""",
)

Expand All @@ -348,9 +356,12 @@ class OAuthenticator(Authenticator):
JupyterHub admins.
If this is set and a user isn't part of one of these groups or listed in
`admin_users`, a user signing in will have their admin status revoked.
:attr:`admin_users`, a user signing in will have their admin status revoked.
Requires :attr:`manage_groups` to also be `True`.
Requires `manage_groups` to also be `True`.
.. versionadded:: 17
Previously available only on :class:`.GenericOAuthenticator`
""",
)

Expand All @@ -364,11 +375,10 @@ class OAuthenticator(Authenticator):
that accepts the auth state (as a dict) and returns the groups list.
Callables may be async.
Requires `manage_groups` to also be `True`.
.. versionchanged:: 17.0
Requires :attr:`manage_groups` to also be `True`.
Added async support.
.. versionadded:: 17.0
Previously available as :attr:`.GenericOAuthenticator.claim_groups_key`
""",
)

Expand All @@ -377,18 +387,16 @@ class OAuthenticator(Authenticator):
default_value=None,
allow_none=True,
help="""
Callable to modify `auth_state`.
Callable to modify `auth_state`
Will be called with the Authenticator instance and the existing auth_state dictionary
and must return the new auth_state dictionary:
and must return the new auth_state dictionary::
```
auth_state = [await] modify_auth_state_hook(authenticator, auth_state)
```
auth_state = [await] modify_auth_state_hook(authenticator, auth_state)
This hook is called _before_ populating group membership,
This hook is called *before* populating group membership,
so can be used to make additional requests to populate additional fields
which may then be consumed by `auth_state_groups_key` to populate groups.
which may then be consumed by :attr:`auth_state_groups_key` to populate groups.
This hook may be async.
Expand Down

0 comments on commit e3c44c4

Please sign in to comment.