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)
| 866 | |
| 867 | |
| 868 | def _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 | |
| 883 | def _make_fail_closed_bearer_provider( |