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

Function _normalize_issuer

python/openshell/sandbox.py:856–865  ·  view source on GitHub ↗

Return the bundle's issuer with a trailing slash stripped. Used to detect whether the issuer changed when adopting a bundle re-read from disk, so a cached token endpoint computed for the old issuer can be invalidated. Trailing-slash differences are treated as equal, matching `_disco

(bundle: dict)

Source from the content-addressed store, hash-verified

854
855
856def _normalize_issuer(bundle: dict) -> str | None:
857 """Return the bundle's issuer with a trailing slash stripped.
858
859 Used to detect whether the issuer changed when adopting a bundle
860 re-read from disk, so a cached token endpoint computed for the old
861 issuer can be invalidated. Trailing-slash differences are treated as
862 equal, matching `_discover_token_endpoint`'s normalization.
863 """
864 issuer = bundle.get("issuer")
865 return issuer.rstrip("/") if isinstance(issuer, str) else None
866
867
868def _load_cluster_bearer_token(gateway_dir: pathlib.Path) -> str | None:

Callers 2

current_access_tokenMethod · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected