fix: cleanup file security pr
This commit is contained in:
parent
db3b757ffe
commit
8d53bb333d
7 changed files with 4 additions and 30 deletions
|
|
@ -37,21 +37,6 @@ class FileContextProvider extends BaseContextProvider {
|
|||
await extras.ide.getWorkspaceDirs(),
|
||||
);
|
||||
|
||||
if (isSecurityConcern(relativePathOrBasename)) {
|
||||
return [
|
||||
{
|
||||
description: last2Parts,
|
||||
content:
|
||||
"Content redacted, this file cannot be viewed for security reasons",
|
||||
name: baseName,
|
||||
uri: {
|
||||
type: "file",
|
||||
value: fileUri,
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
return [
|
||||
{
|
||||
name: baseName,
|
||||
|
|
|
|||
|
|
@ -29,14 +29,6 @@ class ProblemsContextProvider extends BaseContextProvider {
|
|||
problem.filepath,
|
||||
workspaceDirs,
|
||||
);
|
||||
if (isSecurityConcern(relativePathOrBasename)) {
|
||||
return {
|
||||
description: "Problems in current file",
|
||||
content:
|
||||
"Content was redacted because the file is detected as a potential security concern",
|
||||
name: `Warnings in ${baseName}`,
|
||||
};
|
||||
}
|
||||
const content = await ide.readFile(problem.filepath);
|
||||
const lines = content.split("\n");
|
||||
const rangeContent = lines
|
||||
|
|
|
|||
|
|
@ -95,6 +95,9 @@ export const DEFAULT_SECURITY_IGNORE_DIRS = [
|
|||
".gnupg/",
|
||||
".gpg/",
|
||||
|
||||
// Application specific
|
||||
".continue/",
|
||||
|
||||
// Temporary directories that might contain sensitive data
|
||||
"tmp/secrets/",
|
||||
"temp/secrets/",
|
||||
|
|
|
|||
1
extensions/cli/package-lock.json
generated
1
extensions/cli/package-lock.json
generated
|
|
@ -53,7 +53,6 @@
|
|||
"swr": "^2.3.4",
|
||||
"turndown": "^7.2.0",
|
||||
"typescript": "^5.8.3",
|
||||
"uri-js": "^4.4.1",
|
||||
"uuid": "^9.0.1",
|
||||
"winston": "^3.17.0",
|
||||
"yaml": "^2.8.0"
|
||||
|
|
|
|||
|
|
@ -83,7 +83,6 @@
|
|||
"swr": "^2.3.4",
|
||||
"turndown": "^7.2.0",
|
||||
"typescript": "^5.8.3",
|
||||
"uri-js": "^4.4.1",
|
||||
"uuid": "^9.0.1",
|
||||
"winston": "^3.17.0",
|
||||
"yaml": "^2.8.0"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
import * as fs from "fs";
|
||||
|
||||
import { throwIfFileIsSecurityConcern } from "core/indexing/ignore.js";
|
||||
|
||||
import { telemetryService } from "../../telemetry/telemetryService.js";
|
||||
import {
|
||||
calculateLinesOfCodeDiff,
|
||||
|
|
@ -97,7 +95,7 @@ Each string in the diffs array can contain multiple SEARCH/REPLACE blocks, and a
|
|||
preprocess: async (args) => {
|
||||
// Get and validate args
|
||||
const { filepath, diffs } = parseSearchAndReplaceArgs(args);
|
||||
throwIfFileIsSecurityConcern(filepath);
|
||||
|
||||
// Get current file contents
|
||||
if (!fs.existsSync(filepath)) {
|
||||
throw new Error(`file ${filepath} does not exist`);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import { type AssistantConfig } from "@continuedev/sdk";
|
||||
import { throwIfFileIsSecurityConcern } from "core/indexing/ignore.js";
|
||||
import { Box, Text, useApp, useInput } from "ink";
|
||||
import React, { useCallback, useState } from "react";
|
||||
|
||||
|
|
@ -255,7 +254,6 @@ const UserInput: React.FC<UserInputProps> = ({
|
|||
// Read the file content and notify parent component
|
||||
if (onFileAttached) {
|
||||
try {
|
||||
throwIfFileIsSecurityConcern(filePath);
|
||||
const fs = await import("fs/promises");
|
||||
const content = await fs.readFile(filePath, "utf-8");
|
||||
onFileAttached(filePath, content);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue