feat: webhook reliability and idempotency guarantees - #50
Merged
MaryammAli merged 2 commits intoJul 23, 2026
Merged
Conversation
Implements the full scope of issue Proof-Stell#48: Strongly-typed configuration wrappers: - Add ValidatedUrl, ValidatedRedisUrl, ValidatedPort wrapper types - Each validates format at construction time with clear error messages Rate-limit invariant enforcement: - Add burst >= per_second validation for both global and per-issuer tiers - Prevents misconfiguration where burst is less than the refill rate Bounds checking: - Add MAX_TIMEOUT_MS (300s) upper bound for all delay/timeout values - Add log level validation (trace/debug/info/warn/error only) - Port validation with explicit min/max constants Config versioning: - Add CONFIG_VERSION constant and ConfigVersion type - Rollback detection via validate_compatible() - Version exposed via config status endpoint Hot-reload mechanism: - ConfigWatcher using tokio::sync::watch channel - POST /config/reload endpoint to trigger reload from env - GET /config/status endpoint exposing current version - Background task applies updates to dependent services Documentation: - All 30+ environment variables documented with purpose, defaults, and validation rules - Config versioning policy documented Tests: - 14 new tests covering all validation rules, wrapper types, versioning, and hot-reload
- HMAC-SHA256 request signing: X-Signature-256 header on every delivery when WEBHOOK_SECRET is configured - Redis-backed DLQ persistence: dead-letter entries survive process restarts via the cache backend with 7-day TTL - Webhook health endpoint: GET /webhooks/health returns healthy, degraded, or disabled status based on DLQ depth and URL count - Enhanced deduplication: Redis-backed idempotency keys with configurable TTL for cross-restart deduplication - Idempotency protocol documentation covering all headers and recommended receiver implementation - New public API: url_count() on WebhookDispatcher - 7 new tests for signature, dedup, DLQ persistence, and drain
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.
Description
Resolves #47
Closes #47
Adds webhook reliability improvements and idempotency guarantees to the ProofStell service.
Changes
HMAC-SHA256 Request Signing
X-Signature-256header whenWEBHOOK_SECRETis configuredRedis-backed DLQ Persistence
Webhook Health Endpoint
GET /webhooks/healthreturnshealthy,degraded, ordisabledstatusEnhanced Deduplication
Documentation
Testing