Artifact 30759cc0501e8ac8358cd2d01e9fee95c17cdd09d97932155433585c2d79f7ee:
- File
leaf/agent/internal/natshdr/carrier.go
— part of check-in
[eb4b6f52d0]
at
2026-08-12 20:35:17
on branch main
— chore(deps): update Go, Hugo, and cargo dependencies (#194)
* chore(deps): update Go, Hugo, and cargo dependencies
- nats.go 1.49→1.53.1, nats-server 2.12.6→2.14.5, otel 1.43→1.45, modernc sqlite 1.46→1.56, libfossil 0.6.2→0.6.3, hextra 0.12.2→0.12.3 - cargo update for iroh-sidecar; ed25519/pkcs8/signature pinned to the rc series required by iroh's ed25519-dalek 3.0.0-pre.1 - fix traceparent test: nats.go ≥1.50 preserves header case and Get is exact-match; assert via natshdr.Carrier - rustfmt pass on sidecar sources
* chore(deps): bump iroh 0.97→1.0.3, fixes hickory-proto security alerts
SecretKey::generate no longer takes an rng; drop now-unused rand dep. Verified with make test-iroh (peer sync + convergence e2e).
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> (user: [email protected], size: 1542) [annotate] [blame] [check-ins using]
// Package natshdr provides a propagation.TextMapCarrier adapter for // nats.Header so OpenTelemetry propagators can read/write W3C trace // context directly on a NATS message's headers. // // Header key case on the wire varies: nats.go before v1.50 delivered // keys lower-cased, later versions preserve send case, and nats.Header's // own Get is exact-match. Get here is case-insensitive so subscribers // find "traceparent" regardless of which variant arrives. package natshdr import ( "net/http" "strings" "github.com/nats-io/nats.go" "go.opentelemetry.io/otel/propagation" ) // Carrier adapts nats.Header to propagation.TextMapCarrier. type Carrier nats.Header // Get returns the first value for the header keyed by any case-variant // of key, or "" if none is set. Header maps are tiny (typically ≤3 // entries), so an EqualFold scan is simple and demonstrably correct. func (c Carrier) Get(key string) string { for k, v := range c { if len(v) > 0 && strings.EqualFold(k, key) { return v[0] } } return "" } // Set writes the canonical form so both publishers and subscribers // converge on the same key regardless of direction. func (c Carrier) Set(key, value string) { http.Header(c).Set(key, value) } // Keys returns the header names currently present on the carrier. func (c Carrier) Keys() []string { keys := make([]string, 0, len(c)) for k := range c { keys = append(keys, k) } return keys } // Verify Carrier implements TextMapCarrier at compile time. var _ propagation.TextMapCarrier = Carrier(nil)