Skip to content

fix(app): redact tokens in miner dashboard change text - #449

Merged
JSONbored merged 2 commits into
JSONbored:mainfrom
galuis116:fix/dashboard-token-redaction
Jun 7, 2026
Merged

fix(app): redact tokens in miner dashboard change text#449
JSONbored merged 2 commits into
JSONbored:mainfrom
galuis116:fix/dashboard-token-redaction

Conversation

@galuis116

Copy link
Copy Markdown
Contributor

Closes #448.

sanitizePublicText (the public-safety boundary for miner-dashboard change labels and rerun reasons) stripped local paths and sensitive words but had no rule for secret tokens (ghp_/github_pat_/gts_/glpat-/sk-), unlike the sibling sanitizers in agent-action-explanation-card.ts, weekly-value-report.ts, and control-panel-roles.ts. Its own test already declared those tokens forbidden, but the assertion only passed because no fixture injected one.

Changes

  • Add a FORBIDDEN_TOKEN redaction step to sanitizePublicText, matching the established pattern.
  • Add a ghp_… token to the rerunWhen fixture so the existing public-safety assertion actually exercises token redaction.

Verification

  • npx vitest run test/unit/miner-dashboard-recommendations.test.ts → 10/10 pass.

sanitizePublicText stripped local paths and sensitive words but had no rule for secret tokens (ghp_/github_pat_/gts_/glpat-/sk-), unlike the sibling public-safety sanitizers. Add a token redaction step and a fixture that exercises it.
@galuis116
galuis116 requested a review from JSONbored as a code owner June 7, 2026 00:19
@github-actions github-actions Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jun 7, 2026
@ghost

ghost commented Jun 7, 2026

Copy link
Copy Markdown

Note

Gittensory Gate skipped

PR closed before full evaluation. No late first comment was created.

Signal Result Evidence Action
Gate result ⚠️ Skipped #449 is no longer open. No action.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

@JSONbored JSONbored left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Requesting changes. CI is green, but the token redaction regex misses a common hyphenated sk- token shape, so the changed sanitizer is not safe enough for the behavior this PR claims. No merge action taken.

Comment thread src/services/miner-dashboard-recommendations.ts
@JSONbored
JSONbored dismissed their stale review June 7, 2026 05:39

Retracting this review: the regex character class already allows hyphenated sk- token bodies, so the requested-change note was incorrect.

@JSONbored JSONbored left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Reviewed again after correcting my earlier regex read. The added token sanitizer covers the tested GitHub token path and the hyphenated sk- shape; the dashboard text sanitizer still runs private-language redaction after token redaction. CI is green. Approved. No merge action taken.

@dosubot dosubot Bot added the lgtm label Jun 7, 2026
@dosubot dosubot Bot added the size:XS label Jun 7, 2026
@JSONbored
JSONbored merged commit 3c0fb6f into JSONbored:main Jun 7, 2026
6 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in gittensory - v1 roadmap Jun 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

Miner dashboard change/rerun text isn't redacted for secret tokens

2 participants