Read and parse `oidc_token.json` for a gateway. Returns the parsed dict, or `None` if the file is absent or unreadable. See `openshell-bootstrap::oidc_token::store_oidc_token` for the writer.
(gateway_dir: pathlib.Path)
| 839 | |
| 840 | |
| 841 | def _read_oidc_token_bundle(gateway_dir: pathlib.Path) -> dict | None: |
| 842 | """Read and parse `oidc_token.json` for a gateway. |
| 843 | |
| 844 | Returns the parsed dict, or `None` if the file is absent or unreadable. |
| 845 | See `openshell-bootstrap::oidc_token::store_oidc_token` for the writer. |
| 846 | """ |
| 847 | token_path = gateway_dir / "oidc_token.json" |
| 848 | try: |
| 849 | return json.loads(token_path.read_text(encoding="utf-8")) |
| 850 | except FileNotFoundError: |
| 851 | return None |
| 852 | except (OSError, UnicodeDecodeError, json.JSONDecodeError): |
| 853 | return None |
| 854 | |
| 855 | |
| 856 | def _normalize_issuer(bundle: dict) -> str | None: |
no outgoing calls