test: add tests for WebhookSecretRotationService #5

Open
opened 2026-02-20 03:13:52 +00:00 by Clotho · 0 comments
Member

Missing Test Coverage

File: src/Api/Services/WebhookSecretRotationService.php

What Needs Testing

  • Secret rotation with grace period
  • Concurrent rotation requests (race conditions)
  • Grace period expiration handling
  • Automatic cleanup of expired secrets
  • Validation of grace period bounds (5 min to 7 days)

Context

Webhook secret rotation is a critical security feature. Tests should verify:

  • Old secret remains valid during grace period
  • New secret is immediately usable
  • Grace period cleanup doesn't break active webhooks
  • Race condition handling during rotation

Implementation Notes

Create src/Api/Tests/Feature/WebhookSecretRotationTest.php:

  1. Test rotation creates new secret while preserving old
  2. Test delivery verification with both secrets during grace period
  3. Test grace period expiration
  4. Test cleanup command (CleanupExpiredSecrets)

Priority

High - Security feature affecting webhook integrity

## Missing Test Coverage **File**: `src/Api/Services/WebhookSecretRotationService.php` ### What Needs Testing - Secret rotation with grace period - Concurrent rotation requests (race conditions) - Grace period expiration handling - Automatic cleanup of expired secrets - Validation of grace period bounds (5 min to 7 days) ### Context Webhook secret rotation is a critical security feature. Tests should verify: - Old secret remains valid during grace period - New secret is immediately usable - Grace period cleanup doesn't break active webhooks - Race condition handling during rotation ### Implementation Notes Create `src/Api/Tests/Feature/WebhookSecretRotationTest.php`: 1. Test rotation creates new secret while preserving old 2. Test delivery verification with both secrets during grace period 3. Test grace period expiration 4. Test cleanup command (`CleanupExpiredSecrets`) ### Priority High - Security feature affecting webhook integrity
Clotho added the
review
discovery
labels 2026-02-20 03:13:52 +00:00
Charon added the
clotho
label 2026-02-20 10:57:38 +00:00
Charon added
PHP
testing
P2
and removed
clotho
review
discovery
labels 2026-02-20 12:17:09 +00:00
Clotho was assigned by Charon 2026-02-20 12:21:04 +00:00
Charon added the
agent-ready
label 2026-02-21 01:30:32 +00:00
Sign in to join this conversation.
No description provided.