Skip to content

Commit 9367ed6

Browse files
continue[bot]nate
authored andcommitted
Update tests to reflect removed token.* and credentials.* patterns
Remove test expectation for credentials.json which no longer matches after removing credentials.* pattern. Add new tests to verify legitimate source files (tokens.py, credentials.go, etc.) are not blocked. Co-authored-by: nate <[email protected]>
1 parent 1a005f9 commit 9367ed6

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

core/indexing/ignore.vitest.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ describe("isSecurityConcern", () => {
4848
expect(isSecurityConcern("app.secret")).toBe(true);
4949
expect(isSecurityConcern("api.secrets")).toBe(true);
5050
expect(isSecurityConcern("credentials")).toBe(true);
51-
expect(isSecurityConcern("credentials.json")).toBe(true);
5251
expect(isSecurityConcern("auth.json")).toBe(true);
5352
expect(isSecurityConcern("token")).toBe(true);
5453
expect(isSecurityConcern("api.token")).toBe(true);
@@ -183,6 +182,17 @@ describe("isSecurityConcern", () => {
183182
expect(isSecurityConcern("secret-utils.js")).toBe(false);
184183
expect(isSecurityConcern("token-validator.ts")).toBe(false);
185184
});
185+
186+
it("should not flag legitimate source files with token/credentials in name", () => {
187+
expect(isSecurityConcern("tokens.py")).toBe(false);
188+
expect(isSecurityConcern("tokens.go")).toBe(false);
189+
expect(isSecurityConcern("tokens.js")).toBe(false);
190+
expect(isSecurityConcern("credentials.py")).toBe(false);
191+
expect(isSecurityConcern("credentials.go")).toBe(false);
192+
expect(isSecurityConcern("credentials.ts")).toBe(false);
193+
expect(isSecurityConcern("token_manager.py")).toBe(false);
194+
expect(isSecurityConcern("credential_helper.js")).toBe(false);
195+
});
186196
});
187197

188198
describe("Edge cases", () => {

0 commit comments

Comments
 (0)