-
Notifications
You must be signed in to change notification settings - Fork 2k
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
feat(Git Projects): Insomnia files can be anywhere inside the repository #8432
base: develop
Are you sure you want to change the base?
feat(Git Projects): Insomnia files can be anywhere inside the repository #8432
Conversation
const recursivelyFindInsomniaFiles = async (fsClient: PromiseFsClient, dir: string, files: string[] = []) => { | ||
const dirFiles = await fsClient.promises.readdir(dir); | ||
for (const file of dirFiles) { | ||
const fullPath = path.join(dir, file); |
Check warning
Code scanning / Semgrep OSS
Semgrep Finding: javascript.lang.security.audit.path-traversal.path-join-resolve-traversal.path-join-resolve-traversal Warning
const recursivelyFindInsomniaFiles = async (fsClient: PromiseFsClient, dir: string, files: string[] = []) => { | ||
const dirFiles = await fsClient.promises.readdir(dir); | ||
for (const file of dirFiles) { | ||
const fullPath = path.join(dir, file); |
Check warning
Code scanning / Semgrep OSS
Semgrep Finding: javascript.lang.security.audit.path-traversal.path-join-resolve-traversal.path-join-resolve-traversal Warning
const recursivelyGetDirectoryTree = async (directoryContents: string[], parentPath: string) => { | ||
const tree: (GitRepoDirectory | GitRepoFile)[] = await Promise.all( | ||
directoryContents.map(async (file: string) => { | ||
const fileOrDirPath = path.join(parentPath, file); |
Check warning
Code scanning / Semgrep OSS
Semgrep Finding: javascript.lang.security.audit.path-traversal.path-join-resolve-traversal.path-join-resolve-traversal Warning
const recursivelyGetDirectoryTree = async (directoryContents: string[], parentPath: string) => { | ||
const tree: (GitRepoDirectory | GitRepoFile)[] = await Promise.all( | ||
directoryContents.map(async (file: string) => { | ||
const fileOrDirPath = path.join(parentPath, file); |
Check warning
Code scanning / Semgrep OSS
Semgrep Finding: javascript.lang.security.audit.path-traversal.path-join-resolve-traversal.path-join-resolve-traversal Warning
2aae939
to
af9f4d2
Compare
const safeToUseFileNameWithExtension = safeToUseInsomniaFileNameWithExt(fileName); | ||
|
||
await models.workspaceMeta.update(workspaceMeta, { | ||
gitRepoPath: path.join(formData.get('folderPath')?.toString() || '', safeToUseFileNameWithExtension), |
Check warning
Code scanning / Semgrep OSS
Semgrep Finding: javascript.lang.security.audit.path-traversal.path-join-resolve-traversal.path-join-resolve-traversal Warning
const safeToUseFileNameWithExtension = safeToUseInsomniaFileNameWithExt(fileName); | ||
|
||
await models.workspaceMeta.update(workspaceMeta, { | ||
gitRepoPath: path.join(formData.get('folderPath')?.toString() || '', safeToUseFileNameWithExtension), |
Check warning
Code scanning / Semgrep OSS
Semgrep Finding: javascript.lang.security.audit.path-traversal.path-join-resolve-traversal.path-join-resolve-traversal Warning
bc8acd6
to
7db47d3
Compare
} | ||
|
||
await models.workspaceMeta.update(workspaceMeta, { | ||
gitRepoPath: path.join(existingPathDir, safeToUseInsomniaFileNameWithExt(fileName)), |
Check warning
Code scanning / Semgrep OSS
Semgrep Finding: javascript.lang.security.audit.path-traversal.path-join-resolve-traversal.path-join-resolve-traversal Warning
} | ||
|
||
await models.workspaceMeta.update(workspaceMeta, { | ||
gitRepoPath: path.join(existingPathDir, safeToUseInsomniaFileNameWithExt(fileName)), |
Check warning
Code scanning / Semgrep OSS
Semgrep Finding: javascript.lang.security.audit.path-traversal.path-join-resolve-traversal.path-join-resolve-traversal Warning
Co-authored-by: Jack Kavanagh <[email protected]>
f002a71
to
35f4669
Compare
Highlights:
Closes INS-5069