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)
| 854 | |
| 855 | |
| 856 | def _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 | |
| 868 | def _load_cluster_bearer_token(gateway_dir: pathlib.Path) -> str | None: |
no test coverage detected