SwanOauthRenew
This is a server extension that fetches the oAuth tokens from the JupyterHub API 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.
Requirements
- notebook
Install
pip install swanoauthrenew
Usage
In your JupyterHub configuration, add the admin:auth_state!user scope to both the user and server roles to allow the extension to fetch the authentication state for the user:
c.JupyterHub.load_roles = [
{"name": "user", "scopes": ["self", "admin:auth_state!user"]},
{
"name": "server",
"scopes": [
"access:servers!user",
"users:activity!user",
"admin:auth_state!user",
],
},
]
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.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| swanoauthrenew-1.0.4.tar.gz | 4.3 kB | With provenance | Details for swanoauthrenew-1.0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| swanoauthrenew-1.0.4-py3-none-any.whl | Python 3 | none | any | Details for swanoauthrenew-1.0.4-py3-none-any.whl |
Total release size: 8.9 kB
Release files / swanoauthrenew-1.0.4.tar.gz
| Download URL | swanoauthrenew-1.0.4.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5c7513e8feee07b0a417c41e33f917dff3978a700632ab23244cbe49eccb44bc
|
|
BLAKE2b-256 checksum How to use checksums |
9458a4479fdcfd8c62d87af18515404d7a8ddf46ac3f19560183bfe5497366a9
|
| 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 27, 2026.
Transparency logRelease files / swanoauthrenew-1.0.4-py3-none-any.whl
| Download URL | swanoauthrenew-1.0.4-py3-none-any.whl |
|---|---|
| Size | 4.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3c519387237ef7a5444f67a0f66b02812ae95d9669541014ca7ca039fe983d79
|
|
BLAKE2b-256 checksum How to use checksums |
108a8a4336c300e6c8c2b26d1cf06cc21834a8630fc3e646d290fe346c62d275
|
| 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 27, 2026.
Transparency logSecurity for swanoauthrenew 1.0.4
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for swanoauthrenew-1.0.4.tar.gz
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 27, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.