Channel TLS material. All three fields are optional so callers can pick the trust profile: - Full mTLS: pass all three (server trusts client identity). - CA-only: pass `ca_path` (custom CA, no client identity). - System roots: pass no fields (`TlsConfig()`) — uses the OS trust
| 44 | |
| 45 | @dataclass(frozen=True) |
| 46 | class TlsConfig: |
| 47 | """Channel TLS material. |
| 48 | |
| 49 | All three fields are optional so callers can pick the trust profile: |
| 50 | |
| 51 | - Full mTLS: pass all three (server trusts client identity). |
| 52 | - CA-only: pass `ca_path` (custom CA, no client identity). |
| 53 | - System roots: pass no fields (`TlsConfig()`) — uses the OS trust |
| 54 | store. Useful for OIDC gateways behind a public CA. |
| 55 | |
| 56 | `cert_path` and `key_path` must be set together or not at all. |
| 57 | """ |
| 58 | |
| 59 | ca_path: pathlib.Path | None = None |
| 60 | cert_path: pathlib.Path | None = None |
| 61 | key_path: pathlib.Path | None = None |
| 62 | |
| 63 | def __post_init__(self) -> None: |
| 64 | if (self.cert_path is None) != (self.key_path is None): |
| 65 | raise ValueError("TlsConfig: cert_path and key_path must be set together") |
| 66 | |
| 67 | |
| 68 | class _BearerAuthInterceptor( |
no outgoing calls