Skip to content

set redacted value to last 4 characters of secret, to match how the secret type admin interface displays it#5027

Merged
jordanTunstill merged 1 commit into
mainfrom
ContentfulPersonalAccessTokenDetectorUpdate
Jun 10, 2026
Merged

set redacted value to last 4 characters of secret, to match how the secret type admin interface displays it#5027
jordanTunstill merged 1 commit into
mainfrom
ContentfulPersonalAccessTokenDetectorUpdate

Conversation

@jordanTunstill

@jordanTunstill jordanTunstill commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

This detector's admin interface shows the last 4 characters of the secret, rather than the prefix that we default to. This PR sets the redacted value to the last 4 in order to better display helpful information.

Description:

Explain the purpose of the PR.

Checklist:

  • Tests passing (make test-community)?
  • Lint passing (make lint this requires golangci-lint)?

Note

Low Risk
Only changes how detected secrets are displayed in Redacted; detection and verification logic are unchanged.

Overview
Contentful personal access token findings now set an explicit Redacted value of ... plus the last four characters of the token, instead of the scanner’s default prefix-style redaction. That aligns TruffleHog output with how Contentful’s admin UI surfaces PATs.

Tests add a fixture with a full CFPAT- token (pattern “found” case) and TestContentfulPersonalAccessToken_SecretRedacted to lock in the suffix redaction behavior.

Reviewed by Cursor Bugbot for commit 4d233b1. Bugbot is set up for automated code reviews on this repo. Configure here.

…ecret type admin interface displays it

Co-authored-by: Cursor <cursoragent@cursor.com>
@jordanTunstill jordanTunstill requested a review from a team June 9, 2026 23:00
@jordanTunstill jordanTunstill requested a review from a team as a code owner June 9, 2026 23:00
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

Corpora Test Results

No detector regex or keyword changes in this PR. Bench skipped.

@MuneebUllahKhan222 MuneebUllahKhan222 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@MuneebUllahKhan222 MuneebUllahKhan222 added the review/product-eng Team integrations reviewed, awaiting product-eng review label Jun 10, 2026
@jordanTunstill jordanTunstill merged commit b64cefe into main Jun 10, 2026
17 checks passed
@jordanTunstill jordanTunstill deleted the ContentfulPersonalAccessTokenDetectorUpdate branch June 10, 2026 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review/product-eng Team integrations reviewed, awaiting product-eng review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants