Skip to content

Commit 1742ed3

Browse files
authored
Merge pull request #555 from LerianStudio/hotfix/idempotency-ttl
fix: reduce idempotency TTL from 24h to 30s
2 parents 09a4c51 + 2d0bdd0 commit 1742ed3

File tree

5 files changed

+7
-9
lines changed

5 files changed

+7
-9
lines changed

.github/workflows/pr-security-scan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ on:
2727

2828
jobs:
2929
security-scan:
30-
uses: LerianStudio/github-actions-shared-workflows/.github/workflows/pr-security-scan.yml@v1.11.0
30+
uses: LerianStudio/github-actions-shared-workflows/.github/workflows/pr-security-scan.yml@v1.13.1
3131
with:
3232
runner_type: "blacksmith-4vcpu-ubuntu-2404"
3333
filter_paths: |-

.trivyignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ CVE-2025-58186
88
CVE-2025-58187
99
CVE-2025-58188
1010
CVE-2025-61723
11-
CVE-2025-61724
11+
CVE-2025-61724
12+
CVE-2026-25882

components/manager/internal/services/create-report_test.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99
"encoding/json"
1010
"errors"
1111
"testing"
12-
"time"
1312

1413
"github.com/LerianStudio/reporter/pkg/constant"
1514
"github.com/LerianStudio/reporter/pkg/model"
@@ -361,8 +360,7 @@ func TestUseCase_CreateReport_Idempotency(t *testing.T) {
361360
cachedResponseJSON, err := json.Marshal(reportEntity)
362361
require.NoError(t, err, "failed to marshal report entity for cached response")
363362

364-
// Idempotency TTL: 24 hours as specified in requirements
365-
idempotencyTTL := 24 * time.Hour
363+
idempotencyTTL := constant.IdempotencyTTL
366364

367365
tests := []struct {
368366
name string

components/manager/internal/services/create-template_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -602,8 +602,7 @@ func TestUseCase_CreateTemplate_Idempotency(t *testing.T) {
602602
cachedResponseJSON, err := json.Marshal(templateEntity)
603603
require.NoError(t, err, "failed to marshal template entity for cached response")
604604

605-
// Idempotency TTL: 24 hours as specified in requirements
606-
idempotencyTTL := 24 * time.Hour
605+
idempotencyTTL := constant.IdempotencyTTL
607606

608607
tests := []struct {
609608
name string

pkg/constant/redis.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ const (
1515
// IdempotencyKeyPrefix is the Redis key prefix for idempotency locks.
1616
IdempotencyKeyPrefix = "idempotency"
1717

18-
// IdempotencyTTL is the time-to-live for idempotency keys (24 hours).
19-
IdempotencyTTL = 24 * time.Hour
18+
// IdempotencyTTL is the time-to-live for idempotency keys (30 seconds).
19+
IdempotencyTTL = 30 * time.Second
2020

2121
// IdempotencyKeyCtx is the context key for client-provided Idempotency-Key header values.
2222
IdempotencyKeyCtx = contextKey("idempotency_key")

0 commit comments

Comments
 (0)