Config Reference

class globus_jupyterlab.globus_config.GlobusConfig

Bases: object

Track all Globus Related information related to the Globus JupyterLab server extension. Many settings can be re-configured via environment variables where JupyterLab is being run. For example:

$ export GLOBUS_REFRESH_TOKENS=true
$ jupyter lab
get_refresh_tokens() bool

Should JupyterLab use Refresh tokens? Default is False. When True, JupyterLab will automatically refresh access tokens, eliminating the need for additional user authentications to refresh tokens.

Configurable via evironment variable: GLOBUS_REFRESH_TOKENS Default: false

Acceptable env values:

  • ‘true’ – use refresh tokens

  • ‘false’ – do not use refresh tokens

get_token_storage_path() str

Modify the default path of token storage for Globus JupyterLab. This location MUST be only accessible by the logged in Globus User.

Configurable via evironment variable: GLOBUS_TOKEN_STORAGE_PATH

Default is: ~/.globus_jupyterlab_tokens.json

“~” Expands to the local POSIX user, on JupyterHub this is /home/jovyan

get_named_grant() str

Set a custom Named Grant when a user logs into Globus. Changes the pre-filled text displayed on the Globus Consent page when logging in.

Configurable via evironment variable: GLOBUS_NAMED_GRANT

get_collection_id() str

Configure the Globus Collection used by JupyterLab. By default, this will check for collections in the following order:

  • A GLOBUS_COLLECTION_ID environment variable

  • A local Globus Connect Personal Collection (GCP is installed)

  • Environment Variable set by OAuthenticator (GLOBUS_LOCAL_ENDPOINT)

If a Globus Collection is not found, transfers cannot be submited by JupyterLab.

Configurable via environment variable: GLOBUS_COLLECTION_ID

get_collection_path() str

Configure the base path for the local Globus Collection. By default, this path will assume the environment is a mapped collection or local user environment where ~ corresponds to the local user home directory. The path is pre-pended to all paths for files/dirs selected within JupyterLab prior to transfer.

Note

Local JupyterLab paths are not cross-checked with paths on a Globus Endpoint prior to tranfer. If there is a mismatch between the base paths for each, transfers will either fail or encounter FileNotFound errors.

Configurable via environment variable: GLOBUS_COLLECTION_PATH

get_host_posix_basepath() str

If JupyterLab is generating incorrect paths for transfer on a Gloubs Collection, this setting will ‘fix’ them during transfers to ensure the path within POSIX and the path visible through the Gloubs Collection point to the same file. For example, if the Host Globus collection was mounted at /home/jovyan, JupyterLab and the Host collection would refer to the same file with two separate paths:

  • JupyterLab (POSIX): /home/jovyan/foo.txt

  • Collection (Globus): /foo.txt

Setting “GLOBUS_HOST_POSIX_BASEPATH=/home/jovyan” will ensure a file transferred by JupyterLab “/home/jovyan/foo.txt” will be rewritten to “foo.txt” on transfer, such that the Globus Transfer can complete with the correct path.

By default when blank or unset, no path translation takes place.

get_host_collection_basepath() str

Similar to GLOBUS_HOST_POSIX_BASEPATH, this will prepend a base path on a Globus Collection which isn’t visible from JupyterLab (POSIX)

  • JupyterLab (POSIX): foo.txt

  • Collection (Globus): /shared/foo.txt

You may set “GLOBUS_HOST_COLLECTION_BASEPATH=/shared”. This will ensure a file transferred by JupyterLab “foo.txt” will be rewritten to “/shared/foo.txt” on transfer, such that the Globus Transfer can complete with the correct path.

By default when blank or unset, no path translation takes place. This setting can be used with or without GLOBUS_HOST_POSIX_BASEPATH.

get_transfer_submission_url() str

By default, JupyterLab will start transfers on the user’s behalf using the Globus Transfer API directly. Configure this to instead use a custom Globus Resource Server for submitting transfers on the user’s behalf.

Note: GLOBUS_TRANSFER_SUBMISSION_SCOPE must also be configured.

Configurable via evironment variable: GLOBUS_TRANSFER_SUBMISSION_URL

get_transfer_submission_scope() str

Define a custom ‘transfer submission’ scope for submitting user transfers. Used in conjunction with GLOBUS_TRANSFER_SUBMISSION_URL. Includes a custom scope to use when logging in and submitting transfers. Transfers submitted to the custom URL will be authorized with the access token for this custom scope instead of a Globus Transfer access token.

Configurable via evironment variable: GLOBUS_TRANSFER_SUBMISSION_SCOPE

get_transfer_submission_is_hub_service() bool

Defines how JupyterLab should authorize with the custom submission service. If the Globus Resource Server is embedded inside a hub service, set this to ‘true’ in order to use the ‘hub’ token for authorization with the hub (Hub token will be passed in the header under Authorization). The Globus token will be passed instead in POST data.

If false, submission will not use the hub token, and assume the remote service is a normal Globus resource server, and pass the token in the header under the name “Authorization”.

Configurable via evironment variable: GLOBUS_TRANSFER_SUBMISSION_IS_HUB_SERVICE

Acceptable env values:

  • ‘true’ - use refresh tokens

  • ‘false’ - do not use refresh tokens