Skip to content

fix: allowlist a gitleaks false positive on a test idempotency key - #115

Merged
Sirajmx merged 1 commit into
mainfrom
fix/gitleaks-false-positive-idempotency-key
Oct 9, 2026
Merged

Sirajmx merged 1 commit into
mainfrom
fix/gitleaks-false-positive-idempotency-key

Conversation

@Kishore-2572

Copy link
Copy Markdown
Contributor

The defect

The post-merge hygiene workflow on main failed after #71 landed: https://github.com/IABTechLab/seller-agent/actions/runs/37925700129

gitleaks's generic-api-key rule flagged a new test fixture string added by #71 — "idempotency_key": "idem-orphan-deal-1" at tests/unit/test_change_request.py:308 — for being a quoted string next to a key named idempotency_key.

Verified this is a false positive, not a real secret

  • Entropy 3.57 — far below what a real credential would score.
  • It's a hardcoded test fixture value for test_unresolvable_deal_id_does_not_create_pending_cr, not a credential of any kind.
  • Ran gitleaks locally: confirmed it flags the line without an allow comment, and clears clean with one.
  • The same file already has an identical, older allowlisted false positive at line 650 (from fix: enforce idempotency for change requests #64), using the same convention.

The fix

One line: added # gitleaks:allow per CONTRIBUTING.md's documented convention for confirmed false positives — no config file needed in this repo.

Verification

  • Full unit suite: 1670 passed, 0 regressions.
  • ruff check / ruff format --check: clean.
  • gitleaks re-run locally on the file: no leaks found.

Test plan

  • uv run pytest tests/unit -q
  • uv run ruff check / ruff format --check
  • gitleaks re-run locally, confirmed clean

generic-api-key flagged the literal fixture string "idem-orphan-deal-1"
in test_unresolvable_deal_id_does_not_create_pending_cr (PR #71) for
sitting next to a key named idempotency_key. Low entropy (3.57), not a
credential. Allowlisted per CONTRIBUTING.md's documented gitleaks:allow
convention, same as the existing one at line 650.
@Kishore-2572
Kishore-2572 marked this pull request as ready for review October 9, 2026 12:09
@Kishore-2572
Kishore-2572 requested a review from Sirajmx October 9, 2026 12:09
@Sirajmx
Sirajmx merged commit ba54aac into main Oct 9, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants