Skip to content

Commit

Permalink
Merge branch 'jupyterhub:main' into feature/github-authz-by-repo
Browse files Browse the repository at this point in the history
  • Loading branch information
koendelaat authored Mar 7, 2024
2 parents 38595f8 + d7e0756 commit 404bef0
Show file tree
Hide file tree
Showing 55 changed files with 1,606 additions and 458 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ jobs:
id-token: write

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ jobs:
linkcheck:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"

Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,14 @@ jobs:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
include:
- python: "3.9"
oldest_dependencies: oldest_dependencies

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "${{ matrix.python }}"

Expand All @@ -55,8 +56,8 @@ jobs:
- name: Downgrade to oldest dependencies
if: matrix.oldest_dependencies != ''
# take any dependencies in requirements.txt such as jupyterhub>=1.2 and
# transform them to jupyterhub==1.2 so we can run tests with the
# take any dependencies in requirements.txt such as jupyterhub>=2.2 and
# transform them to jupyterhub==2.2 so we can run tests with the
# earliest-supported versions
run: |
cat requirements.txt | grep '>=' | sed -e 's@>=@==@g' > oldest-requirements.txt
Expand All @@ -68,4 +69,4 @@ jobs:
pytest
# GitHub action reference: https://github.com/codecov/codecov-action
- uses: codecov/codecov-action@v3
- uses: codecov/codecov-action@v4
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
repos:
# Autoformat: Python code, syntax patterns are modernized
- repo: https://github.com/asottile/pyupgrade
rev: v3.8.0
rev: v3.15.0
hooks:
- id: pyupgrade
args:
- --py38-plus

# Autoformat: Python code
- repo: https://github.com/PyCQA/autoflake
rev: v2.2.0
rev: v2.2.1
hooks:
- id: autoflake
# args ref: https://github.com/PyCQA/autoflake#advanced-usage
Expand All @@ -28,25 +28,25 @@ repos:

# Autoformat: python imports
- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort

# Autoformat: Python code
- repo: https://github.com/psf/black
rev: 23.3.0
rev: 24.1.1
hooks:
- id: black

# Autoformat: markdown, yaml
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0-alpha.9-for-vscode
rev: v4.0.0-alpha.8
hooks:
- id: prettier

# Misc...
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
# ref: https://github.com/pre-commit/pre-commit-hooks#hooks-available
hooks:
# Autoformat: Makes sure files end in a newline and only a newline.
Expand All @@ -64,7 +64,7 @@ repos:

# Lint: Python code
- repo: https://github.com/pycqa/flake8
rev: "6.0.0"
rev: "7.0.0"
hooks:
- id: flake8

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ plugged in and used with JupyterHub.
The following authentication services are supported through their own authenticator: [Auth0](oauthenticator/auth0.py),
[Azure AD](oauthenticator/azuread.py), [Bitbucket](oauthenticator/bitbucket.py), [CILogon](oauthenticator/cilogon.py), [FeiShu](https://github.com/tezignlab/jupyterhub_feishu_authenticator),
[GitHub](oauthenticator/github.py), [GitLab](oauthenticator/gitlab.py), [Globus](oauthenticator/globus.py),
[Google](oauthenticator/google.py), [MediaWiki](oauthenticator/mediawiki.py), [Okpy](oauthenticator/okpy.py),
[Google](oauthenticator/google.py), [MediaWiki](oauthenticator/mediawiki.py),
[OpenShift](oauthenticator/openshift.py).

There is also a [GenericAuthenticator](oauthenticator/generic.py)
Expand Down
1 change: 0 additions & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
autodoc-traits
importlib_metadata>=3.6; python_version < '3.10'
myst-parser
sphinx>=2
sphinx-autobuild
sphinx-book-theme
sphinx-copybutton
Expand Down
1 change: 0 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ def setup(app):
"api/gen/oauthenticator.gitlab": "reference/api/gen/oauthenticator.gitlab",
"api/gen/oauthenticator.globus": "reference/api/gen/oauthenticator.globus",
"api/gen/oauthenticator.google": "reference/api/gen/oauthenticator.google",
"api/gen/oauthenticator.okpy": "reference/api/gen/oauthenticator.okpy",
"api/gen/oauthenticator.openshift": "reference/api/gen/oauthenticator.openshift",
"api/gen/oauthenticator.mediawiki": "reference/api/gen/oauthenticator.mediawiki",
# 2023-06-29 docs refresh
Expand Down
1 change: 1 addition & 0 deletions docs/source/how-to/example-oauthenticator.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Example OAuthenticator to use with My Service
"""

from jupyterhub.auth import LocalAuthenticator

from oauthenticator.oauth2 import OAuthenticator, OAuthLoginHandler
Expand Down
9 changes: 5 additions & 4 deletions docs/source/how-to/writing-an-oauthenticator.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ There are two ways to write your own OAuthenticator.

## Using GenericOAuthenticator

```{note}
Before writing your own config, [](tutorials:provider-specific:generic) may already have an example for your service.
```

The first and simplest is to use the `oauthenticator.generic.GenericOAuthenticator` class
and configuration to set the necessary configuration variables.

Expand All @@ -17,7 +21,7 @@ and configuration to set the necessary configuration variables.
Example config:

```python
c.JupyterHub.authenticator_class = "generic"
c.JupyterHub.authenticator_class = "generic-oauth"

c.GenericOAuthenticator.oauth_callback_url = 'https://{host}/hub/oauth_callback'
c.GenericOAuthenticator.client_id = 'OAUTH-CLIENT-ID'
Expand All @@ -28,9 +32,6 @@ c.GenericOAuthenticator.token_url = 'url-retrieving-access-token-oauth-completio
c.GenericOAuthenticator.username_claim = 'username-key-for-USERDATA-URL'
```

Checkout [](tutorials:provider-specific:generic:moodle) and [](tutorials:provider-specific:generic:yandex) for how to configure
GenericOAuthenticator for Moodle and Yandex.

## Writing your own OAuthenticator class

If you want more advanced features and customization beyond the basics of OAuth,
Expand Down
1 change: 1 addition & 0 deletions docs/source/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Topic guides go more in-depth on a particular topic.
:maxdepth: 2
:caption: Topic guides
topic/allowing
topic/extending
```

Expand Down
Loading

0 comments on commit 404bef0

Please sign in to comment.