feat: Enhance Booklooker client with webhook signature verification, idempotency handling, and retry logic

This commit is contained in:
claudi 2026-04-16 14:58:18 +02:00
parent 1d8ee1bba6
commit f2e5774204
6 changed files with 232 additions and 50 deletions

View file

@ -1,4 +1,4 @@
from booklooker_client import BooklookerWebhookHelper
from booklooker_client import BooklookerWebhookHelper, InMemoryIdempotencyStore
from booklooker_client.models.order import OrderBatch, OrderRecord
@ -39,3 +39,9 @@ def test_duplicate_detection() -> None:
assert first.resource_type == "order"
assert second.resource_type == "duplicate"
assert second.enriched_data == {"duplicate": True}
def test_idempotency_store_ttl_expiry() -> None:
store = InMemoryIdempotencyStore(ttl_seconds=0)
store.mark_seen("evt-expire")
assert store.has_seen("evt-expire") is False