wangjia
|
fb3389a94b
|
feat(15A): probe ingest endpoint + Redis store (tsk_rBPr0Xuy10bz)
Add `server/internal/scheduler/probe/` package:
* types.go – frozen ReportRequest/NodeReport/L1-L3 schema (15B/15C contract)
* store.go – Redis read/write: probe:{nodeId}:{vantage} TTL 30min,
probe:hb:{probeId} TTL 15min; missing key = no data, not failure;
SnapshotsByNode + AliveProbes read interfaces for 15D
* ingest.go – POST /probe/report handler: per-probe HMAC-SHA256 auth
(X-Probe-Id / X-Probe-Ts / X-Probe-Sign), ±300s time window,
constant-time comparison, idempotent replay via Redis SetNX
Wire route in cmd/server/main.go (opt-in via PROBE_SECRETS env var).
18/18 tests pass (go test ./internal/scheduler/probe/... -count=1).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
2026-06-13 11:56:34 +08:00 |
|