mirror of
https://github.com/openai/codex.git
synced 2026-04-29 00:55:38 +00:00
fix for https://github.com/openai/codex/issues/6153 supports mTLS configuration and includes TLS features in the library build to enable secure HTTPS connections with custom root certificates. grpc: https://docs.rs/tonic/0.13.1/src/tonic/transport/channel/endpoint.rs.html#63 https: https://docs.rs/reqwest/0.12.23/src/reqwest/async_impl/client.rs.html#516
43 lines
964 B
Rust
43 lines
964 B
Rust
use std::collections::HashMap;
|
|
use std::path::PathBuf;
|
|
|
|
#[derive(Clone, Debug)]
|
|
pub struct OtelSettings {
|
|
pub environment: String,
|
|
pub service_name: String,
|
|
pub service_version: String,
|
|
pub codex_home: PathBuf,
|
|
pub exporter: OtelExporter,
|
|
}
|
|
|
|
#[derive(Clone, Debug)]
|
|
pub enum OtelHttpProtocol {
|
|
/// HTTP protocol with binary protobuf
|
|
Binary,
|
|
/// HTTP protocol with JSON payload
|
|
Json,
|
|
}
|
|
|
|
#[derive(Clone, Debug, Default)]
|
|
pub struct OtelTlsConfig {
|
|
pub ca_certificate: Option<PathBuf>,
|
|
pub client_certificate: Option<PathBuf>,
|
|
pub client_private_key: Option<PathBuf>,
|
|
}
|
|
|
|
#[derive(Clone, Debug)]
|
|
pub enum OtelExporter {
|
|
None,
|
|
OtlpGrpc {
|
|
endpoint: String,
|
|
headers: HashMap<String, String>,
|
|
tls: Option<OtelTlsConfig>,
|
|
},
|
|
OtlpHttp {
|
|
endpoint: String,
|
|
headers: HashMap<String, String>,
|
|
protocol: OtelHttpProtocol,
|
|
tls: Option<OtelTlsConfig>,
|
|
},
|
|
}
|