webhook-handling

Verify HMAC signatures and enqueue idempotent webhook events in Ruby on Rails.

21|2|Updated May 24, 2026
One-click install
npx skills add https://github.com/sandeepmvl/rails-skills --skill webhook-handling-sandeepmvl
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: webhook-handling
Source: https://github.com/sandeepmvl/rails-skills/tree/main/skills/30-webhook-handling
Command: npx skills add https://github.com/sandeepmvl/rails-skills --skill webhook-handling-sandeepmvl

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

AI coding agents frequently implement webhook receivers incorrectly for Ruby on Rails applications: they skip signature verification, process webhook payloads synchronously, ignore retry semantics, and fail to implement idempotency, leading to security vulnerabilities, duplicate event processing, and unnecessary provider retries.

Core Features & Use Cases

  • HMAC Signature Verification: Supports generic HMAC-SHA256 verification for providers like GitHub and Slack, plus provider-specific verification for Stripe, using timing-safe comparison to prevent timing attacks.
  • Idempotent Event Processing: Persists webhook events with a unique index on provider and provider event ID to automatically deduplicate replayed or duplicate deliveries.
  • Async Job Enqueuing: Enqueues all webhook processing to background jobs and returns a 200 response immediately to prevent provider retries from slow synchronous processing.
  • Use Case: When integrating Stripe payment webhooks or GitHub push event webhooks into a Rails 8 app, this skill ensures you follow production-grade patterns that match senior Rails developer conventions.

Quick Start

Use the webhook-handling skill to build a secure, idempotent GitHub webhook receiver for your Rails application that verifies HMAC signatures, enqueues async processing jobs, and returns a 200 response immediately upon valid receipt.

Frequently Asked Questions about webhook-handling

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I verify webhook signatures in Ruby on Rails?

To verify webhook signatures in Ruby on Rails, use HMAC-SHA256 verification with timing-safe comparison to prevent timing attacks. Provider-specific patterns like Stripe verification are supported alongside generic HMAC methods to ensure secure receipt of incoming payloads.

Why does my Stripe webhook receiver trigger duplicate event processing?

Duplicate webhook processing occurs when event deduplication is missing. Implement idempotent event processing by persisting webhook events with a unique index on the provider and provider event ID, which automatically deduplicates replayed or duplicate deliveries.

What is the best way to handle slow synchronous webhook processing in Rails?

The best way to handle slow synchronous webhook processing in Rails is to enqueue all webhook payload processing to background jobs and return a 200 response immediately. This fast response prevents unnecessary provider retries caused by timeouts.

How do I prevent replay attacks on timestamped webhooks in Rails?

To prevent replay attacks on timestamped webhooks in Rails, implement replay protection for timestamped webhook signatures. Combined with timing-safe signature comparison and idempotent event storage, this ensures production-grade security against malicious replayed payloads.

Does this webhook handling pattern work for both GitHub and Shopify providers?

Yes, this webhook handling pattern works for GitHub, Shopify, Slack, and Twilio providers. It covers all incoming webhook integration scenarios with specific controller setup patterns, raw request body capture, and provider-specific HMAC signature verification.