Przejdź do treści
Biblioteka skilli
Programowanie · Testowanie

idempotency-key-handling

/idempotency-key-handling

Odtwarza to samo żądanie z tym samym kluczem idempotentności i porównuje skutki, wykrywając klucze zapisane, ale niewymuszane przez API.

Repozytorium
flawpath ↗
Licencja
MIT
Ostatnia zmiana repozytorium
28.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
2
Przestarzałość

Brak sygnałów. Repozytorium zmienione 28.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Odtwarza to samo żądanie z tym samym kluczem idempotentności i porównuje skutki, wykrywając klucze zapisane, ale niewymuszane przez API.

Oryginalny opis (EN)

Replay one request with the same idempotency key and compare the effects, because a key that is recorded but not enforced produces a duplicate every retry. Use when the API accepts an idempotency key or a client-generated identifier for a create operation

Jak działa

  1. Procedure
  2. Signals
  3. Patterns
  4. Pitfalls
  5. Done when
  6. References
Sekcje z nagłówków SKILL.md, w oryginale · 63 linii, 389 słów
Podgląd SKILL.md
---
name: idempotency-key-handling
description: "Replay one request with the same idempotency key and compare the effects, because a key that is recorded but not enforced produces a duplicate every retry. Use when the API accepts an idempotency key or a client-generated identifier for a create operation"
pack: flawpath
version: 1.0.0
category: backend-api
tags: [probe, idempotency, concurrency]
---

# Idempotency Key Handling

> Replay one request with the same idempotency key and compare the effects, because a key that is recorded but not enforced produces a duplicate every retry

**Use when:** the API accepts an idempotency key or a client-generated identifier for a create operation

**Avoid when:** a test confirms a replayed key returns the original result without a second effect

## Procedure

1. Confirm the boundary permits the create operation and identify its rollback.
2. Send a create with a client-generated key and record the response and the created record.
3. Replay the identical request with the same key and record the response and any second record.
4. Compare the two responses and the resulting object count to determine whether the effect repeated.
5. Send a third request with the same key but a changed body to see which of the two the server honours.
6. Record the key's behaviour: enforced, recorded but not enforced, or ignored.

## Signals

- A replay with the same key creates a second object
- The key is recorded in logs or responses but does not suppress the effect
- A changed body with a reused key is processed rather than rejected
- The response to a replay differs from the original with no explanation

## Patterns

**1. Replay record**

```text
request 1 key K -> 201, object A
request 2 key K same body -> 201, object B  <- effect repeated
request 3 key K changed body -> 201, object C
```

**2. Three-request rule**

```text
the third request with a changed body is what distinguishes a key that is ignored from one that is enforced but keyed only on the body
```

**3. Count evidence**

```text
object count after each replay is the evidence; record it beside the status codes rather than relying on status alone
```

## Pitfalls

- Judging enforcement from the status code when a second object was created anyway
- Replaying a request the boundary forbids for this operation
- Skipping the changed-body case, which is what separates ignored from enforced

## Done when

- Three requests with one key have recorded responses and object counts
- The key is labelled enforced, recorded but not enforced, or ignored

## References

- [CWE-841 - Improper enforcement of behavioral workflow](https://cwe.mitre.org/data/definitions/841.html)
- [OWASP - Race condition guidance](https://owasp.org/www-project-web-security-testing-guide/)

Wersje

W bazie nie ma innych skilli o nazwie idempotency-key-handling.

Migawka bazy z 13.11.2026 · wersja paczki c3b84f8881c5 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 3 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 90backend-idempotency
    Wdraża klucze idempotentności, by ponowienia żądań nie powodowały podwójnych skutków, np. dwóch obciążeń tej samej płatności.
  • 100br-idempotency
    Konfiguruje idempotencję z pamięcią powtórzeń w better-route przez IdempotencyMiddleware i nagłówek Idempotency-Key, z wyborem magazynu i obsługą konfliktów kluczy.
  • 100idempotency-handling
    Implementuje idempotentne operacje API z kluczami idempotentności, cache w Redis i ograniczeniami w bazie danych, dla płatności, ponowień webhooków i problemów z podwójnym przetwarzaniem.
  • 100api-idempotency-retry
    Projektuje obsługę kluczy idempotencji i wytyczne ponowień po stronie klienta dla publicznego API: zakres kluczy, TTL, atomowe zajmowanie, odrzucanie niezgodnych ładunków, backoff z jitterem i budżety ponowień.
  • 100idempotency-test-author
    Pisze testy idempotentności dla zadań, kolejek i API: obsługa kluczy idempotencji, semantyka exactly-once, at-least-once i at-most-once, deduplikacja odciskami i dobór okna.
  • 100idempotency-enforcer
    Projektuje klucze idempotentności podawane przez klienta, przechowywanie deduplikacji i semantykę powtórzeń, by ponowienia zwracały pierwszy wynik zamiast podwójnego obciążenia lub wysyłki.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.