Skip to main content

Jupyter Extension for SMART on FHIR launch

Project description

Jupyter SMART on FHIR

Prototype extensions for loading credentials in Jupyter contexts via SMART on FHIR.

This package contains two implementations:

  • server_extension: a Jupyter server extension that acts as public client for a SMART server.
  • hub_service: a JupyterHub service that acts as confidential client for a SMART server and performs asymmetric authentication.

Check the READMEs in the example folders for more information.

This package is very much a work in progress.

Server Extension

The Server extension is enabled by default on install. It registers the following handlers:

  • {base_url}/smart-on-fhir/launch - the launch URL to provide
  • {base_url}/smart-on-fhir/login (an intermediate implementation-detail handler that may go away)
  • {base_url}/smart-on-fhir/callback - the OAuth callback you'll want to register

When deployed in JupyterHub, register the URLs https://jupyterhub.example.org/hub/user-redirect/smart-on-fhir/launch as the launch URL and https://jupyterhub.example.org/hub/user-redirect/smart-on-fhir/callback as the oauth callback URL.

After SMART launch, the token info will be stored in jupyter_runtime_dir() / "smart_token.json" (also available to notebooks as $SMART_TOKEN_FILE), and in $SMART_TOKEN. $SMART_TOKEN will only be available to notebooks started after

Currently, only one token is stored at a time, so if there are multiple smart launches to a single notebook server, only the latest will be persisted.

Configure SMARTExtensionApp in jupyter_server_config.py:

c.SMARTExtensionApp.scopes = ["openid", "fhirUser", "launch", "patient/*.*"]
c.SMARTExtensionApp.client_id = "your-client-id"

see sourcecode in server_extension.py for now for more options.

JupyterHub Service

The JupyterHub service is a bare proof of concept which completes the SMART flow and fetches some sample data, it is not useful yet.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jupyter_smart_on_fhir-0.1.0a2.tar.gz (19.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jupyter_smart_on_fhir-0.1.0a2-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file jupyter_smart_on_fhir-0.1.0a2.tar.gz.

File metadata

  • Download URL: jupyter_smart_on_fhir-0.1.0a2.tar.gz
  • Upload date:
  • Size: 19.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for jupyter_smart_on_fhir-0.1.0a2.tar.gz
Algorithm Hash digest
SHA256 751d624f77bb8b0d31ea43285ede82abb2c60b0e436de22b3674dc6164650380
MD5 b07447d6219ad667906a6d1e86969ccf
BLAKE2b-256 1b70eee8e044cebecb4ca2a297342908acbf5b0c28af65464a8262b41994669b

See more details on using hashes here.

Provenance

The following attestation bundles were made for jupyter_smart_on_fhir-0.1.0a2.tar.gz:

Publisher: release.yaml on jupyterhealth/jupyter-smart-on-fhir

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file jupyter_smart_on_fhir-0.1.0a2-py3-none-any.whl.

File metadata

File hashes

Hashes for jupyter_smart_on_fhir-0.1.0a2-py3-none-any.whl
Algorithm Hash digest
SHA256 7c77737818fa2f5570de2b02a8ee554d4e31465ad1ed85ce18c5f84aa9ff5951
MD5 012a3f81953db47a6753cfbe7ce81a78
BLAKE2b-256 2e08c9caf2c855646358ca5d5d92f5327f67ffafd8bd92dc187c2739d11cb398

See more details on using hashes here.

Provenance

The following attestation bundles were made for jupyter_smart_on_fhir-0.1.0a2-py3-none-any.whl:

Publisher: release.yaml on jupyterhealth/jupyter-smart-on-fhir

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page