Repository navigation
feat: replace TUI with interactive category menu #91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
205ae33
791aa6b
afee133
2c25286
8662548
d80b8d6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -101,3 +101,28 @@ | |
| const config = loadConfig() | ||
| expect(config.defaultCurrency).toBe("USD") | ||
| }) | ||
|
|
||
| test("webhook secrets are masked in list, get, and set output", async () => { | ||
| const { handleConfigSet, handleConfigGet, handleConfigList } = await import("../commands.ts") | ||
| const { resetConfig, loadConfig } = await import("../config.ts") | ||
| const SECRET = "https://hooks.slack.com/services/T000/B000/secret-token-abc" | ||
|
|
||
| resetConfig() | ||
| handleConfigSet("slackWebhook", SECRET) | ||
|
|
||
| // Set output masks the value | ||
| expect(successMessages.some((m) => m.includes(SECRET))).toBe(false) | ||
| expect(successMessages.some((m) => m.includes("slackWebhook = https://hooks.slack.com/***"))).toBe(true) | ||
|
|
||
| // Get output masks the value | ||
| handleConfigGet("slackWebhook") | ||
| expect(logMessages.some((m) => m.includes(SECRET))).toBe(false) | ||
|
github-advanced-security[bot] marked this conversation as resolved.
Fixed
|
||
| expect(logMessages.some((m) => m.includes("slackWebhook: https://hooks.slack.com/***"))).toBe(true) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win Replace the Slack-shaped test URL. The value at Line 108 matches a Slack Incoming Webhook pattern. Secret scanning fails on this fixture. CodeQL also tracks this value into the checks at Lines 114, 119, and 124. Use a synthetic HTTPS URL on Proposed fix- const SECRET = "https://hooks.slack.com/services/T000/B000/secret-token-abc"
+ const SECRET = "https://example.test/services/T000/B000/test-token"
...
- expect(successMessages.some((m) => m.includes("slackWebhook = https://hooks.slack.com/***"))).toBe(true)
+ expect(successMessages.some((m) => m.includes("slackWebhook = https://example.test/***"))).toBe(true)
...
- expect(logMessages.some((m) => m.includes("slackWebhook: https://hooks.slack.com/***"))).toBe(true)
+ expect(logMessages.some((m) => m.includes("slackWebhook: https://example.test/***"))).toBe(true)🧰 Tools🪛 GitHub Actions: app-ci / 1_check _ check.txt[error] 108-108: Secretlint detected a Slack Incoming Webhook secret. Remove or redact the secret and rotate the exposed webhook. 🪛 GitHub Actions: app-ci / check _ check[error] 108-108: Secretlint detected a Slack Incoming Webhook secret in the test file ( 🪛 GitHub Check: check / check[failure] 108-108: 🪛 GitHub Check: CodeQL[failure] 114-114: Incomplete URL substring sanitization [failure] 119-119: Incomplete URL substring sanitization 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||
|
|
||
| // List output masks the value | ||
| handleConfigList() | ||
| expect(logMessages.some((m) => m.includes(SECRET))).toBe(false) | ||
|
github-advanced-security[bot] marked this conversation as resolved.
Fixed
|
||
|
|
||
| // The real value is still stored | ||
| expect(loadConfig().slackWebhook).toBe(SECRET) | ||
| }) | ||
Uh oh!
There was an error while loading. Please reload this page.