Root cause: upstream_request_filter was inserting x-forwarded-proto with a raw headers.insert() call (via DerefMut) which only updates base.headers but NOT the CaseMap. header_to_h1_wire zips CaseMap with base.headers, so headers added without a CaseMap entry are silently dropped on the wire. Fix: use insert_header() which keeps both maps in sync. Also adds: - src/lib.rs + [lib] section: exposes SunbeamProxy/RouteConfig/AcmeRoutes to integration tests without re-declaring modules in main.rs - tests/e2e.rs: real end-to-end test — starts a SunbeamProxy over plain HTTP, routes it to a TCP echo backend, and asserts x-forwarded-proto: http is present in the upstream request headers - Updated unit tests to verify header_to_h1_wire round-trip (not just that HeaderMap::insert works in isolation) Signed-off-by: Sienna Meridian Satterwhite <sienna@sunbeam.pt>
52 lines
1.4 KiB
TOML
52 lines
1.4 KiB
TOML
[package]
|
|
name = "sunbeam-proxy"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
|
|
[lib]
|
|
name = "sunbeam_proxy"
|
|
path = "src/lib.rs"
|
|
|
|
[dependencies]
|
|
# Pingora with rustls backend (pure Rust TLS, no BoringSSL C build)
|
|
pingora = { version = "0.7", features = ["rustls"] }
|
|
pingora-proxy = { version = "0.7", features = ["rustls"] }
|
|
pingora-core = { version = "0.7", features = ["rustls"] }
|
|
pingora-http = "0.7"
|
|
|
|
# HTTP header constants
|
|
http = "1"
|
|
|
|
# Config
|
|
serde = { version = "1", features = ["derive"] }
|
|
toml = "0.8"
|
|
|
|
# Async
|
|
tokio = { version = "1", features = ["full"] }
|
|
futures = "0.3"
|
|
async-trait = "0.1"
|
|
|
|
# Structured logging + OTEL
|
|
tracing = "0.1"
|
|
tracing-subscriber = { version = "0.3", features = ["json", "env-filter"] }
|
|
tracing-opentelemetry = "0.28"
|
|
opentelemetry = { version = "0.27", features = ["trace"] }
|
|
opentelemetry_sdk = { version = "0.27", features = ["rt-tokio"] }
|
|
opentelemetry-otlp = { version = "0.27", features = ["http-proto", "reqwest-client"] }
|
|
serde_json = "1"
|
|
anyhow = "1"
|
|
|
|
# Rustls crypto provider — must be installed before any TLS init
|
|
rustls = { version = "0.23", features = ["aws-lc-rs"] }
|
|
|
|
# K8s watcher for cert/config hot-reload
|
|
kube = { version = "3", features = ["runtime", "client"] }
|
|
k8s-openapi = { version = "0.27", features = ["v1_35"] }
|
|
libc = "0.2"
|
|
|
|
[profile.release]
|
|
opt-level = 3
|
|
lto = true
|
|
codegen-units = 1
|
|
strip = true
|