SwanOauthRenew
This is a server extension that fetches the oAuth tokens available in the "user" endpoint of the JupyterHub API (1) and stores them in files that can be accessed by other processes (like the EOS client). It can be configured to take any token from the auth state dictionary and write it with any content format.
(1) For now, this functionality is exclusive to SwanHub (our JH wrapper). It does not work on vanilla JH, as the auth state is only available to admins.
Requirements
- notebook
Install
pip install swanoauthrenew
Usage
Configure the server extension to load when the notebook server starts
jupyter serverextension enable --py --user swanoauthrenew
Then is necessary to configure (in the jupyter config file) the files that need to be written, from where the tokens are coming from and how the file content should look like. Like so:
c.SwanOauthRenew.files = [
("/tmp/swan_oauth.token", "access_token", "{token}"),
("/tmp/cernbox_oauth.token", "exchanged_tokens/cernbox-service", "{token}"),
("/tmp/eos_oauth.token", "exchanged_tokens/eos-service", "oauth2:{token}:auth.cern.ch"),
]
Metadata
Release files for swanoauthrenew 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| swanoauthrenew-1.0.3.tar.gz | 4.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| swanoauthrenew-1.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.7 kB
Release files / swanoauthrenew-1.0.3.tar.gz
| Download URL | swanoauthrenew-1.0.3.tar.gz |
|---|---|
| Size | 4.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8c973b2e0065dc606275bdaf89088a2d7918b9e88e37a822ec1168755ee94086
|
|
BLAKE2b-256 checksum How to use checksums |
75a03ac959f5947036648a62908927af38d92003429b24cb2f57177b61fd0136
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.
Transparency logRelease files / swanoauthrenew-1.0.3-py3-none-any.whl
| Download URL | swanoauthrenew-1.0.3-py3-none-any.whl |
|---|---|
| Size | 4.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f13ba651765e9cf54973dd585c31ea66ab2e009327e2bd9bf72cdf6e7871af58
|
|
BLAKE2b-256 checksum How to use checksums |
5286a9a0677066f3858df990cff80173c7e9124d8f7411c3065f69a6162b96cf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.
Transparency log