MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / _load_cluster_bearer_token

Function _load_cluster_bearer_token

python/openshell/sandbox.py:868–880  ·  view source on GitHub ↗

Read a single (possibly expired) access token from disk. Lower-level helper used by both the legacy single-shot path and the refreshing provider. Returns the raw access_token string or None.

(gateway_dir: pathlib.Path)

Source from the content-addressed store, hash-verified

866
867
868def _load_cluster_bearer_token(gateway_dir: pathlib.Path) -> str | None:
869 """Read a single (possibly expired) access token from disk.
870
871 Lower-level helper used by both the legacy single-shot path and the
872 refreshing provider. Returns the raw access_token string or None.
873 """
874 bundle = _read_oidc_token_bundle(gateway_dir)
875 if bundle is None:
876 return None
877 access_token = bundle.get("access_token")
878 if not isinstance(access_token, str) or not access_token:
879 return None
880 return access_token
881
882
883def _make_fail_closed_bearer_provider(

Calls 2

_read_oidc_token_bundleFunction · 0.85
getMethod · 0.45