feat(telemetry): consent-gated telemetry client with Ed25519 signing (PILOT-400)#263
Merged
Merged
Conversation
…(PILOT-400) Adds a self-contained telemetry client package that emits signed events to a configured endpoint only when consent is active (--telemetry-url non-empty). When the flag is empty (default), the client is a hard no-op: no dial, no buffering, no goroutines. The client signs all requests with the node's Ed25519 identity following the canonical telemetry signing contract (X-Pilot-Timestamp, X-Pilot-Public-Key, X-Pilot-Signature). This matches the telemetry server's internal/sig verification at pilot-protocol/telemetry. Changes: - pkg/telemetry/client.go: consent-gated telemetry client with Signed HTTP POST, lazy disabled init, configurable endpoint - pkg/telemetry/client_test.go: tests for no-op paths, disabled state, SignMessage round-trip verification - cmd/daemon/main.go: --telemetry-url flag (env PILOT_TELEMETRY_URL) - pkg/daemon/daemon.go: TelemetryURL field in Config struct Closes PILOT-400
…tion CodeQL flagged make([]byte, 0, len(ts)+1+len(body)) because len() sums can overflow on 32-bit platforms when body is very large. Drop the body from the capacity hint — append grows the buffer naturally. PILOT-400
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a consent-gated telemetry client to the daemon. When
--telemetry-url(or envPILOT_TELEMETRY_URL) is set, events are signed with the node's Ed25519 identity and POSTed to the endpoint. When empty (default), the client is a hard no-op — no dial, no buffering, no goroutines.What changed
telemetry.Clientwith Ed25519-signed HTTP POSTs matching the canonical telemetry signing contract (X-Pilot-Timestamp, X-Pilot-Public-Key, X-Pilot-Signature). Hard no-op when URL is empty.--telemetry-urlflag.TelemetryURLfield to Config struct.Verification
go build ./...— cleango vet ./...— cleango test ./pkg/telemetry/— 5/5 PASSmake build— daemon + pilotctl binaries builtCloses PILOT-400