Read the active gateway endpoint from metadata.
()
| 68 | |
| 69 | |
| 70 | def _gateway_endpoint() -> tuple[str, bool]: |
| 71 | """Read the active gateway endpoint from metadata.""" |
| 72 | cluster_name = os.environ.get("OPENSHELL_GATEWAY", "openshell") |
| 73 | metadata_path = ( |
| 74 | _xdg_config_home() / "openshell" / "gateways" / cluster_name / "metadata.json" |
| 75 | ) |
| 76 | metadata = json.loads(metadata_path.read_text()) |
| 77 | endpoint = metadata["gateway_endpoint"] |
| 78 | is_tls = endpoint.startswith("https://") |
| 79 | return endpoint, is_tls |
| 80 | |
| 81 | |
| 82 | def _mtls_dir() -> Path: |
no test coverage detected