Skip to content

Commit 8d53bb3

Browse files
committed
fix: cleanup file security pr
1 parent db3b757 commit 8d53bb3

File tree

7 files changed

+4
-30
lines changed

7 files changed

+4
-30
lines changed

core/context/providers/FileContextProvider.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,6 @@ class FileContextProvider extends BaseContextProvider {
3737
await extras.ide.getWorkspaceDirs(),
3838
);
3939

40-
if (isSecurityConcern(relativePathOrBasename)) {
41-
return [
42-
{
43-
description: last2Parts,
44-
content:
45-
"Content redacted, this file cannot be viewed for security reasons",
46-
name: baseName,
47-
uri: {
48-
type: "file",
49-
value: fileUri,
50-
},
51-
},
52-
];
53-
}
54-
5540
return [
5641
{
5742
name: baseName,

core/context/providers/ProblemsContextProvider.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,6 @@ class ProblemsContextProvider extends BaseContextProvider {
2929
problem.filepath,
3030
workspaceDirs,
3131
);
32-
if (isSecurityConcern(relativePathOrBasename)) {
33-
return {
34-
description: "Problems in current file",
35-
content:
36-
"Content was redacted because the file is detected as a potential security concern",
37-
name: `Warnings in ${baseName}`,
38-
};
39-
}
4032
const content = await ide.readFile(problem.filepath);
4133
const lines = content.split("\n");
4234
const rangeContent = lines

core/indexing/ignore.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ export const DEFAULT_SECURITY_IGNORE_DIRS = [
9595
".gnupg/",
9696
".gpg/",
9797

98+
// Application specific
99+
".continue/",
100+
98101
// Temporary directories that might contain sensitive data
99102
"tmp/secrets/",
100103
"temp/secrets/",

extensions/cli/package-lock.json

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

extensions/cli/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@
8383
"swr": "^2.3.4",
8484
"turndown": "^7.2.0",
8585
"typescript": "^5.8.3",
86-
"uri-js": "^4.4.1",
8786
"uuid": "^9.0.1",
8887
"winston": "^3.17.0",
8988
"yaml": "^2.8.0"

extensions/cli/src/tools/searchAndReplace/index.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import * as fs from "fs";
22

3-
import { throwIfFileIsSecurityConcern } from "core/indexing/ignore.js";
4-
53
import { telemetryService } from "../../telemetry/telemetryService.js";
64
import {
75
calculateLinesOfCodeDiff,
@@ -97,7 +95,7 @@ Each string in the diffs array can contain multiple SEARCH/REPLACE blocks, and a
9795
preprocess: async (args) => {
9896
// Get and validate args
9997
const { filepath, diffs } = parseSearchAndReplaceArgs(args);
100-
throwIfFileIsSecurityConcern(filepath);
98+
10199
// Get current file contents
102100
if (!fs.existsSync(filepath)) {
103101
throw new Error(`file ${filepath} does not exist`);

extensions/cli/src/ui/UserInput.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { type AssistantConfig } from "@continuedev/sdk";
2-
import { throwIfFileIsSecurityConcern } from "core/indexing/ignore.js";
32
import { Box, Text, useApp, useInput } from "ink";
43
import React, { useCallback, useState } from "react";
54

@@ -255,7 +254,6 @@ const UserInput: React.FC<UserInputProps> = ({
255254
// Read the file content and notify parent component
256255
if (onFileAttached) {
257256
try {
258-
throwIfFileIsSecurityConcern(filePath);
259257
const fs = await import("fs/promises");
260258
const content = await fs.readFile(filePath, "utf-8");
261259
onFileAttached(filePath, content);

0 commit comments

Comments
 (0)