Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions packages/cli-core/src/lib/redact.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1336,16 +1336,14 @@ describe("secrets right after an escape sequence", () => {
});

// Bun's regex engine gives up on a long run without an error and reports no match.
describe("a secret followed by a long run", () => {
test.each([
["URL query", (tail: string) => `password=hunter2xyz&data=${tail}`],
["flag", (tail: string) => `--token hunter2xyz${tail}`],
["JSON field", (tail: string) => `{"password":"hunter2xyz","data":"${tail}"}`],
["camelCase name", (tail: string) => `dbPass=hunter2xyz${tail}`],
])("%s", (_label, shape) => {
for (const size of [10_000, 60_000, 200_000]) {
expect(redact(shape("a".repeat(size))).text).not.toContain("hunter2xyz");
}
describe.each([
["URL query", (tail: string) => `password=hunter2xyz&data=${tail}`],
["flag", (tail: string) => `--token hunter2xyz${tail}`],
["JSON field", (tail: string) => `{"password":"hunter2xyz","data":"${tail}"}`],
["camelCase name", (tail: string) => `dbPass=hunter2xyz${tail}`],
])("a secret followed by a long run: %s", (_label, shape) => {
test.each([10_000, 60_000, 200_000])("%d characters", (size) => {
expect(redact(shape("a".repeat(size))).text).not.toContain("hunter2xyz");
});
});

Expand Down
Loading