diff --git a/cliv2/go.mod b/cliv2/go.mod index 1d1913ea49..eaa6bfa14f 100644 --- a/cliv2/go.mod +++ b/cliv2/go.mod @@ -12,15 +12,15 @@ require ( github.com/google/uuid v1.6.0 github.com/pkg/errors v0.9.1 github.com/rs/zerolog v1.33.0 - github.com/snyk/cli-extension-dep-graph v0.0.0-20240426125928-8d56ac52821e + github.com/snyk/cli-extension-dep-graph v0.0.0-20241014075215-311d3c8a423f github.com/snyk/cli-extension-iac-rules v0.0.0-20241008152401-24c8cf03a1a3 - github.com/snyk/cli-extension-sbom v0.0.0-20240820111700-68258cba52c7 + github.com/snyk/cli-extension-sbom v0.0.0-20241016065306-0df2be5b3b8f github.com/snyk/container-cli v0.0.0-20240821111304-7ca1c415a5d7 github.com/snyk/error-catalog-golang-public v0.0.0-20240809094525-c48d19c27edb github.com/snyk/go-application-framework v0.0.0-20241011135148-71eca49aa231 github.com/snyk/go-httpauth v0.0.0-20240307114523-1f5ea3f55c65 github.com/snyk/snyk-iac-capture v0.6.5 - github.com/snyk/snyk-ls v0.0.0-20241017063705-68655f0e7f39 + github.com/snyk/snyk-ls v0.0.0-20241023124225-627b73041471 github.com/spf13/cobra v1.8.1 github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.9.0 diff --git a/cliv2/go.sum b/cliv2/go.sum index 66fa59ec97..87cff4c87d 100644 --- a/cliv2/go.sum +++ b/cliv2/go.sum @@ -750,12 +750,12 @@ github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/skeema/knownhosts v1.2.2 h1:Iug2P4fLmDw9f41PB6thxUkNUkJzB5i+1/exaj40L3A= github.com/skeema/knownhosts v1.2.2/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo= -github.com/snyk/cli-extension-dep-graph v0.0.0-20240426125928-8d56ac52821e h1:j17Ujw51/2SC3m1hbNCUwxFc8aNIFyfpnwFAszgEM8c= -github.com/snyk/cli-extension-dep-graph v0.0.0-20240426125928-8d56ac52821e/go.mod h1:QF3v8HBpOpyudYNCuR8LqfULutO76c91sBdLzD+pBJU= +github.com/snyk/cli-extension-dep-graph v0.0.0-20241014075215-311d3c8a423f h1:xZK+6ug+pNgnIfPFGkQtxBZwcN/6RoXpQruRHimjfKM= +github.com/snyk/cli-extension-dep-graph v0.0.0-20241014075215-311d3c8a423f/go.mod h1:QF3v8HBpOpyudYNCuR8LqfULutO76c91sBdLzD+pBJU= github.com/snyk/cli-extension-iac-rules v0.0.0-20241008152401-24c8cf03a1a3 h1:AQMi52/aevl9bBSzwxGLz9kxInojkSe/Q6j1s1s6yJg= github.com/snyk/cli-extension-iac-rules v0.0.0-20241008152401-24c8cf03a1a3/go.mod h1:A/DNK3ZnUgqOKJ33Lc1z5KbbHqRSBgwCWw9KuyJu0xQ= -github.com/snyk/cli-extension-sbom v0.0.0-20240820111700-68258cba52c7 h1:+xhigV8lkriZ8riIg79Yx/sDpKZV9ihz2iAM0Xa8/V4= -github.com/snyk/cli-extension-sbom v0.0.0-20240820111700-68258cba52c7/go.mod h1:5CaY1bgvJY/uoG/1plLOf8T8o9AkwoBIGvw34RfRLZw= +github.com/snyk/cli-extension-sbom v0.0.0-20241016065306-0df2be5b3b8f h1:dlL+f+5sjHj4JCzW/Evl1x9UREXLyc3M4KjoZvQx0Bs= +github.com/snyk/cli-extension-sbom v0.0.0-20241016065306-0df2be5b3b8f/go.mod h1:5CaY1bgvJY/uoG/1plLOf8T8o9AkwoBIGvw34RfRLZw= github.com/snyk/code-client-go v1.10.0 h1:t/hBINxj4lKvoo681uGhxHBpMued/j68p2sHbB9qbfo= github.com/snyk/code-client-go v1.10.0/go.mod h1:orU911flV1kJQOlxxx0InUQkAfpBrcERsb2olfnlI8s= github.com/snyk/container-cli v0.0.0-20240821111304-7ca1c415a5d7 h1:Zn5BcV76oFAbJm5tDygU945lvoZ3yY8FoRFDC3YpwF8= @@ -770,8 +770,8 @@ github.com/snyk/policy-engine v0.31.3 h1:FepCg6QN/X8uvxYjF+WwB2aiBPJB+NENDgKQeI/ github.com/snyk/policy-engine v0.31.3/go.mod h1:Z9/hcngz+2txX4QfQRwfODk8F7w4mr/IQOvCtIosnLo= github.com/snyk/snyk-iac-capture v0.6.5 h1:992DXCAJSN97KtUh8T5ndaWwd/6ZCal2bDkRXqM1u/E= github.com/snyk/snyk-iac-capture v0.6.5/go.mod h1:e47i55EmM0F69ZxyFHC4sCi7vyaJW6DLoaamJJCzWGk= -github.com/snyk/snyk-ls v0.0.0-20241017063705-68655f0e7f39 h1:yZwQfzpNNYmV6p97F2mW14N725Ce5Zem3VNcriKhuJY= -github.com/snyk/snyk-ls v0.0.0-20241017063705-68655f0e7f39/go.mod h1:ymVHnn1JE/pqWhTHSQEz/1MP8FmYYfYFszaptaaI/PE= +github.com/snyk/snyk-ls v0.0.0-20241023124225-627b73041471 h1:k2mJ+C7chUf+THMsgbUBFTxxMBNBeGEdz6NrMbZHt/o= +github.com/snyk/snyk-ls v0.0.0-20241023124225-627b73041471/go.mod h1:ymVHnn1JE/pqWhTHSQEz/1MP8FmYYfYFszaptaaI/PE= github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= github.com/sourcegraph/go-lsp v0.0.0-20240223163137-f80c5dd31dfd h1:Dq5WSzWsP1TbVi10zPWBI5LKEBDg4Y1OhWEph1wr5WQ= diff --git a/package-lock.json b/package-lock.json index 572b993ed4..5d228578bc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -70,13 +70,13 @@ "snyk-cpp-plugin": "2.24.0", "snyk-docker-plugin": "6.13.2", "snyk-go-plugin": "1.23.0", - "snyk-gradle-plugin": "4.1.0", + "snyk-gradle-plugin": "4.6.0", "snyk-module": "3.1.0", "snyk-mvn-plugin": "3.6.0", "snyk-nodejs-lockfile-parser": "1.58.10", "snyk-nodejs-plugin": "1.3.4", "snyk-nuget-plugin": "2.7.8", - "snyk-php-plugin": "1.9.2", + "snyk-php-plugin": "1.10.0", "snyk-policy": "^4.0.0", "snyk-python-plugin": "2.2.1", "snyk-resolve-deps": "4.8.0", @@ -20536,9 +20536,9 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "node_modules/snyk-gradle-plugin": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/snyk-gradle-plugin/-/snyk-gradle-plugin-4.1.0.tgz", - "integrity": "sha512-7b13PetdNbM9rFMMjmCfoRYiI9mqU9qmGeBvscnhWPVZ9TGBg8jgF54L/23++8VsGPhIAhX+IokqjVrD0+81ew==", + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/snyk-gradle-plugin/-/snyk-gradle-plugin-4.6.0.tgz", + "integrity": "sha512-Gt0m0jcpR16MxH3048BvYJnMKmJPoc6pJqvxI+WE8856yaE8EKOxrDGMhsSjAmJrJe1kzBXYysKog1xsWQ4E4g==", "dependencies": { "@snyk/cli-interface": "2.11.3", "@snyk/dep-graph": "^1.28.0", @@ -21136,22 +21136,66 @@ } }, "node_modules/snyk-php-plugin": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/snyk-php-plugin/-/snyk-php-plugin-1.9.2.tgz", - "integrity": "sha512-IQcdsQBqqXVRY5DatlI7ASy4flbhtU2V7cr4P2rK9rkFnVHO6LHcitwKXVZa9ocdOmpZDzk7U6iwHJkVFcR6OA==", + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/snyk-php-plugin/-/snyk-php-plugin-1.10.0.tgz", + "integrity": "sha512-S3DgV/R2xQabG11WWsBp5DstW/jXP4L11yll2xp3laWIo8/Jey3hhsf0WNHqv33Uh7B7VN5dgg/eA8moKY57yw==", "dependencies": { "@snyk/cli-interface": "^2.9.1", "@snyk/composer-lockfile-parser": "^1.4.1", - "tslib": "1.11.1" + "@snyk/dep-graph": "^1.22.0", + "tslib": "1.14.1" }, "engines": { "node": ">=8" } }, - "node_modules/snyk-php-plugin/node_modules/tslib": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.1.tgz", - "integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==" + "node_modules/snyk-php-plugin/node_modules/@snyk/dep-graph": { + "version": "1.31.0", + "resolved": "https://registry.npmjs.org/@snyk/dep-graph/-/dep-graph-1.31.0.tgz", + "integrity": "sha512-nGSua40dcI/ISDDW46EYSjwVZxdWohb4bDlHFYtudL5bxo0PV9wFA1QeZewKQVeHLVaGkrESXdqQubP0pFf4vA==", + "dependencies": { + "event-loop-spinner": "^2.1.0", + "lodash.clone": "^4.5.0", + "lodash.constant": "^3.0.0", + "lodash.filter": "^4.6.0", + "lodash.foreach": "^4.5.0", + "lodash.isempty": "^4.4.0", + "lodash.isequal": "^4.5.0", + "lodash.isfunction": "^3.0.9", + "lodash.isundefined": "^3.0.1", + "lodash.keys": "^4.2.0", + "lodash.map": "^4.6.0", + "lodash.reduce": "^4.6.0", + "lodash.size": "^4.2.0", + "lodash.transform": "^4.6.0", + "lodash.union": "^4.6.0", + "lodash.values": "^4.3.0", + "object-hash": "^2.0.3", + "semver": "^7.0.0", + "tslib": "^1.13.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/snyk-php-plugin/node_modules/object-hash": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-2.2.0.tgz", + "integrity": "sha512-gScRMn0bS5fH+IuwyIFgnh9zBdo4DV+6GhygmWM9HyNJSgS0hScp1f5vjtm7oIIOiT9trXrShAkLFSc2IqKNgw==", + "engines": { + "node": ">= 6" + } + }, + "node_modules/snyk-php-plugin/node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } }, "node_modules/snyk-poetry-lockfile-parser": { "version": "1.4.2", @@ -39878,9 +39922,9 @@ } }, "snyk-gradle-plugin": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/snyk-gradle-plugin/-/snyk-gradle-plugin-4.1.0.tgz", - "integrity": "sha512-7b13PetdNbM9rFMMjmCfoRYiI9mqU9qmGeBvscnhWPVZ9TGBg8jgF54L/23++8VsGPhIAhX+IokqjVrD0+81ew==", + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/snyk-gradle-plugin/-/snyk-gradle-plugin-4.6.0.tgz", + "integrity": "sha512-Gt0m0jcpR16MxH3048BvYJnMKmJPoc6pJqvxI+WE8856yaE8EKOxrDGMhsSjAmJrJe1kzBXYysKog1xsWQ4E4g==", "requires": { "@snyk/cli-interface": "2.11.3", "@snyk/dep-graph": "^1.28.0", @@ -40361,19 +40405,51 @@ } }, "snyk-php-plugin": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/snyk-php-plugin/-/snyk-php-plugin-1.9.2.tgz", - "integrity": "sha512-IQcdsQBqqXVRY5DatlI7ASy4flbhtU2V7cr4P2rK9rkFnVHO6LHcitwKXVZa9ocdOmpZDzk7U6iwHJkVFcR6OA==", + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/snyk-php-plugin/-/snyk-php-plugin-1.10.0.tgz", + "integrity": "sha512-S3DgV/R2xQabG11WWsBp5DstW/jXP4L11yll2xp3laWIo8/Jey3hhsf0WNHqv33Uh7B7VN5dgg/eA8moKY57yw==", "requires": { "@snyk/cli-interface": "^2.9.1", "@snyk/composer-lockfile-parser": "^1.4.1", - "tslib": "1.11.1" + "@snyk/dep-graph": "^1.22.0", + "tslib": "1.14.1" }, "dependencies": { - "tslib": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.1.tgz", - "integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==" + "@snyk/dep-graph": { + "version": "1.31.0", + "resolved": "https://registry.npmjs.org/@snyk/dep-graph/-/dep-graph-1.31.0.tgz", + "integrity": "sha512-nGSua40dcI/ISDDW46EYSjwVZxdWohb4bDlHFYtudL5bxo0PV9wFA1QeZewKQVeHLVaGkrESXdqQubP0pFf4vA==", + "requires": { + "event-loop-spinner": "^2.1.0", + "lodash.clone": "^4.5.0", + "lodash.constant": "^3.0.0", + "lodash.filter": "^4.6.0", + "lodash.foreach": "^4.5.0", + "lodash.isempty": "^4.4.0", + "lodash.isequal": "^4.5.0", + "lodash.isfunction": "^3.0.9", + "lodash.isundefined": "^3.0.1", + "lodash.keys": "^4.2.0", + "lodash.map": "^4.6.0", + "lodash.reduce": "^4.6.0", + "lodash.size": "^4.2.0", + "lodash.transform": "^4.6.0", + "lodash.union": "^4.6.0", + "lodash.values": "^4.3.0", + "object-hash": "^2.0.3", + "semver": "^7.0.0", + "tslib": "^1.13.0" + } + }, + "object-hash": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-2.2.0.tgz", + "integrity": "sha512-gScRMn0bS5fH+IuwyIFgnh9zBdo4DV+6GhygmWM9HyNJSgS0hScp1f5vjtm7oIIOiT9trXrShAkLFSc2IqKNgw==" + }, + "semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==" } } }, diff --git a/package.json b/package.json index 9199a61f37..33d48c275d 100644 --- a/package.json +++ b/package.json @@ -118,13 +118,13 @@ "snyk-cpp-plugin": "2.24.0", "snyk-docker-plugin": "6.13.2", "snyk-go-plugin": "1.23.0", - "snyk-gradle-plugin": "4.1.0", + "snyk-gradle-plugin": "4.6.0", "snyk-module": "3.1.0", "snyk-mvn-plugin": "3.6.0", "snyk-nodejs-lockfile-parser": "1.58.10", "snyk-nodejs-plugin": "1.3.4", "snyk-nuget-plugin": "2.7.8", - "snyk-php-plugin": "1.9.2", + "snyk-php-plugin": "1.10.0", "snyk-policy": "^4.0.0", "snyk-python-plugin": "2.2.1", "snyk-resolve-deps": "4.8.0", diff --git a/src/lib/constants.ts b/src/lib/constants.ts index 61b2bd178e..c88460e4d2 100644 --- a/src/lib/constants.ts +++ b/src/lib/constants.ts @@ -10,6 +10,3 @@ export const CALL_PATH_LEADING_ELEMENTS = 2; // Number of function names to show in the end of an abbreviated call path export const CALL_PATH_TRAILING_ELEMENTS = 2; - -// Number of subdirectories to search when running monitor or test -export const MAX_DETECTION_DEPTH = 4; diff --git a/src/lib/find-files.ts b/src/lib/find-files.ts index f841d34547..5da2328277 100644 --- a/src/lib/find-files.ts +++ b/src/lib/find-files.ts @@ -3,14 +3,13 @@ import * as pathLib from 'path'; import * as sortBy from 'lodash.sortby'; import * as groupBy from 'lodash.groupby'; +import * as assign from 'lodash.assign'; import { detectPackageManagerFromFile } from './detect'; import * as debugModule from 'debug'; import { PNPM_FEATURE_FLAG, SUPPORTED_MANIFEST_FILES, } from './package-managers'; -import * as merge from 'lodash.merge'; -import { MAX_DETECTION_DEPTH } from './constants'; const debug = debugModule('snyk:find-files'); @@ -56,12 +55,28 @@ interface FindFilesRes { const ignoreFolders = ['node_modules', '.build']; interface FindFilesConfig { + path: string; + ignore?: string[]; + filter?: string[]; + levelsDeep?: number; + featureFlags?: Set; +} + +type DefaultFindConfig = { path: string; ignore: string[]; filter: string[]; levelsDeep: number; featureFlags: Set; -} +}; + +const defaultFindConfig: DefaultFindConfig = { + path: '', + ignore: [], + filter: [], + levelsDeep: 4, + featureFlags: new Set(), +}; /** * Find all files in given search path. Returns paths to files found. @@ -71,10 +86,8 @@ interface FindFilesConfig { * @param filter (optional) file names to find. If not provided all files are returned. * @param levelsDeep (optional) how many levels deep to search, defaults to two, this path and one sub directory. */ -export async function find( - findConfig: Partial, -): Promise { - const config = getFindConfig(findConfig); +export async function find(findConfig: FindFilesConfig): Promise { + const config: DefaultFindConfig = assign({}, defaultFindConfig, findConfig); const found: string[] = []; const foundAll: string[] = []; @@ -139,28 +152,10 @@ function findFile(path: string, filter: string[] = []): string | null { return null; } -function getFindConfig(option: Partial): FindFilesConfig { - const result = merge( - { - path: '', - ignore: [], - filter: [], - levelsDeep: MAX_DETECTION_DEPTH, - featureFlags: new Set(), - }, - option, - ); - - if (isNaN(result.levelsDeep) || result.levelsDeep === null) { - result.levelsDeep = MAX_DETECTION_DEPTH; - } - return result; -} - async function findInDirectory( findConfig: FindFilesConfig, ): Promise { - const config = getFindConfig(findConfig); + const config: DefaultFindConfig = assign({}, defaultFindConfig, findConfig); const files = await readDirectory(config.path); const toFind = files .filter((file) => !config.ignore.includes(file)) diff --git a/src/lib/plugins/get-deps-from-plugin.ts b/src/lib/plugins/get-deps-from-plugin.ts index 718e7fd430..13c4039a27 100644 --- a/src/lib/plugins/get-deps-from-plugin.ts +++ b/src/lib/plugins/get-deps-from-plugin.ts @@ -21,7 +21,6 @@ import { convertSingleResultToMultiCustom } from './convert-single-splugin-res-t import { convertMultiResultToMultiCustom } from './convert-multi-plugin-res-to-multi-custom'; import { processYarnWorkspaces } from './nodejs-plugin/yarn-workspaces-parser'; import { ScannedProject } from '@snyk/cli-interface/legacy/common'; -import { MAX_DETECTION_DEPTH } from '../constants'; const debug = debugModule('snyk-test'); @@ -44,7 +43,7 @@ export async function getDepsFromPlugin( ): Promise { if (Object.keys(multiProjectProcessors).some((key) => options[key])) { const scanType = options.yarnWorkspaces ? 'yarnWorkspaces' : 'allProjects'; - const levelsDeep = options.detectionDepth || MAX_DETECTION_DEPTH; + const levelsDeep = options.detectionDepth; const ignore = options.exclude ? options.exclude.split(',') : []; const { files: targetFiles, allFilesFound } = await find({ diff --git a/src/lib/plugins/get-extra-project-count.ts b/src/lib/plugins/get-extra-project-count.ts index c6d3ffca28..a923d9f83c 100644 --- a/src/lib/plugins/get-extra-project-count.ts +++ b/src/lib/plugins/get-extra-project-count.ts @@ -2,7 +2,6 @@ import { legacyPlugin as pluginApi } from '@snyk/cli-interface'; import { find } from '../find-files'; import { AUTO_DETECTABLE_FILES } from '../detect'; import { Options } from '../types'; -import { MAX_DETECTION_DEPTH } from '../constants'; export async function getExtraProjectCount( root: string, @@ -24,8 +23,6 @@ export async function getExtraProjectCount( path: root, ignore: [], filter: AUTO_DETECTABLE_FILES, - levelsDeep: MAX_DETECTION_DEPTH, - featureFlags: new Set(), }); const foundProjectsCount = extraTargetFiles.length > 1 ? extraTargetFiles.length - 1 : undefined; diff --git a/test/acceptance/workspaces/mono-repo-nested/.gitignore b/test/acceptance/workspaces/mono-repo-nested/.gitignore deleted file mode 100644 index 9c108a1068..0000000000 --- a/test/acceptance/workspaces/mono-repo-nested/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -target -project/target diff --git a/test/acceptance/workspaces/mono-repo-nested/README.md b/test/acceptance/workspaces/mono-repo-nested/README.md deleted file mode 100644 index 4290b5add4..0000000000 --- a/test/acceptance/workspaces/mono-repo-nested/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Simple Monorepo - -This repository contains a number of different projects, both at the root and in directories. - -It is used as a simple test fixture for monorepo and multi-language support on [Snyk.io](https://snyk.io). As such, each "project" is merely the files needed to describe dependencies. diff --git a/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/Gemfile b/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/Gemfile deleted file mode 100644 index 8827060912..0000000000 --- a/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/Gemfile +++ /dev/null @@ -1,5 +0,0 @@ -source "https://rubygems.org" - -gem "rack-cache", "~> 1.1.0" -gem "rack", "~> 1.6.2" -gem "rack-protection", "~> 1.5.0" diff --git a/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/Gemfile.lock b/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/Gemfile.lock deleted file mode 100644 index f8cd4503f8..0000000000 --- a/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/Gemfile.lock +++ /dev/null @@ -1,19 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - rack (1.6.5) - rack-cache (1.1) - rack (>= 0.4) - rack-protection (1.5.3) - rack - -PLATFORMS - ruby - -DEPENDENCIES - rack (~> 1.6.2) - rack-cache (~> 1.1.0) - rack-protection (~> 1.5.0) - -BUNDLED WITH - 1.14.3 diff --git a/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/level-4/Gemfile b/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/level-4/Gemfile deleted file mode 100644 index 8827060912..0000000000 --- a/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/level-4/Gemfile +++ /dev/null @@ -1,5 +0,0 @@ -source "https://rubygems.org" - -gem "rack-cache", "~> 1.1.0" -gem "rack", "~> 1.6.2" -gem "rack-protection", "~> 1.5.0" diff --git a/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/level-4/Gemfile.lock b/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/level-4/Gemfile.lock deleted file mode 100644 index f8cd4503f8..0000000000 --- a/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/level-4/Gemfile.lock +++ /dev/null @@ -1,19 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - rack (1.6.5) - rack-cache (1.1) - rack (>= 0.4) - rack-protection (1.5.3) - rack - -PLATFORMS - ruby - -DEPENDENCIES - rack (~> 1.6.2) - rack-cache (~> 1.1.0) - rack-protection (~> 1.5.0) - -BUNDLED WITH - 1.14.3 diff --git a/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/level-4/level-5/level-6/Gemfile b/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/level-4/level-5/level-6/Gemfile deleted file mode 100644 index eaaf55a49f..0000000000 --- a/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/level-4/level-5/level-6/Gemfile +++ /dev/null @@ -1,6 +0,0 @@ -source :rubygems - -gem "sinatra" -gem "haml" -gem "httparty" -gem "actionpack" diff --git a/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/level-4/level-5/level-6/Gemfile.lock b/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/level-4/level-5/level-6/Gemfile.lock deleted file mode 100644 index c204545ac4..0000000000 --- a/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/level-4/level-5/level-6/Gemfile.lock +++ /dev/null @@ -1,71 +0,0 @@ -GEM - remote: http://rubygems.org/ - specs: - actionpack (4.2.5) - actionview (= 4.2.5) - activesupport (= 4.2.5) - rack (~> 1.6) - rack-test (~> 0.6.2) - rails-dom-testing (~> 1.0, >= 1.0.5) - rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (4.2.5) - activesupport (= 4.2.5) - builder (~> 3.1) - erubis (~> 2.7.0) - rails-dom-testing (~> 1.0, >= 1.0.5) - rails-html-sanitizer (~> 1.0, >= 1.0.2) - activesupport (4.2.5) - i18n (~> 0.7) - json (~> 1.7, >= 1.7.7) - minitest (~> 5.1) - thread_safe (~> 0.3, >= 0.3.4) - tzinfo (~> 1.1) - builder (3.2.2) - erubis (2.7.0) - haml (3.1.4) - httparty (0.8.1) - multi_json - multi_xml - i18n (0.7.0) - json (1.8.3) - loofah (2.0.3) - nokogiri (>= 1.5.9) - mini_portile2 (2.1.0) - minitest (5.9.1) - multi_json (1.12.1) - multi_xml (0.5.5) - nokogiri (1.6.8.1) - mini_portile2 (~> 2.1.0) - rack (1.6.4) - rack-protection (1.5.3) - rack - rack-test (0.6.3) - rack (>= 1.0) - rails-deprecated_sanitizer (1.0.3) - activesupport (>= 4.2.0.alpha) - rails-dom-testing (1.0.7) - activesupport (>= 4.2.0.beta, < 5.0) - nokogiri (~> 1.6.0) - rails-deprecated_sanitizer (>= 1.0.1) - rails-html-sanitizer (1.0.3) - loofah (~> 2.0) - sinatra (1.3.2) - rack (~> 1.3, >= 1.3.6) - rack-protection (~> 1.2) - tilt (~> 1.3, >= 1.3.3) - thread_safe (0.3.5) - tilt (1.4.1) - tzinfo (1.2.2) - thread_safe (~> 0.1) - -PLATFORMS - ruby - -DEPENDENCIES - actionpack - haml - httparty - sinatra - -BUNDLED WITH - 1.13.2 diff --git a/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/level-4/level-5/package-lock.json b/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/level-4/level-5/package-lock.json deleted file mode 100644 index fce7bf7f28..0000000000 --- a/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/level-4/level-5/package-lock.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "shallow-goof", - "version": "0.0.1", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "node-uuid": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.0.tgz", - "integrity": "sha1-B/myM3Vy/2J1x3Xh1IUT86RdemU=" - }, - "qs": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/qs/-/qs-0.0.6.tgz", - "integrity": "sha1-SBZZt+W/al6omAEN5a7TXrRp4SQ=" - } - } -} diff --git a/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/level-4/level-5/package.json b/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/level-4/level-5/package.json deleted file mode 100644 index 4b2ecd8d3d..0000000000 --- a/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/level-4/level-5/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "shallow-goof", - "version": "0.0.1", - "description": "A vulnerable demo application", - "homepage": "https://snyk.io/", - "repository": { - "type": "git", - "url": "https://github.com/Snyk/shallow-goof" - }, - "dependencies": { - "qs": "0.0.6", - "node-uuid": "1.4.0" - } -} diff --git a/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/package-lock.json b/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/package-lock.json deleted file mode 100644 index fce7bf7f28..0000000000 --- a/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/package-lock.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "shallow-goof", - "version": "0.0.1", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "node-uuid": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.0.tgz", - "integrity": "sha1-B/myM3Vy/2J1x3Xh1IUT86RdemU=" - }, - "qs": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/qs/-/qs-0.0.6.tgz", - "integrity": "sha1-SBZZt+W/al6omAEN5a7TXrRp4SQ=" - } - } -} diff --git a/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/package.json b/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/package.json deleted file mode 100644 index 4b2ecd8d3d..0000000000 --- a/test/acceptance/workspaces/mono-repo-nested/level-1/level-2/level-3/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "shallow-goof", - "version": "0.0.1", - "description": "A vulnerable demo application", - "homepage": "https://snyk.io/", - "repository": { - "type": "git", - "url": "https://github.com/Snyk/shallow-goof" - }, - "dependencies": { - "qs": "0.0.6", - "node-uuid": "1.4.0" - } -} diff --git a/test/acceptance/workspaces/mono-repo-nested/level-1/node_modules/node-uuid/README.md b/test/acceptance/workspaces/mono-repo-nested/level-1/node_modules/node-uuid/README.md deleted file mode 100644 index d62f7a14d4..0000000000 --- a/test/acceptance/workspaces/mono-repo-nested/level-1/node_modules/node-uuid/README.md +++ /dev/null @@ -1,203 +0,0 @@ -# node-uuid - -Simple, fast generation of [RFC4122](http://www.ietf.org/rfc/rfc4122.txt) UUIDS. - -Features: - -* Generate RFC4122 version 1 or version 4 UUIDs -* Runs in node.js and all browsers. -* Cryptographically strong random # generation on supporting platforms -* 1.1K minified and gzip'ed (Want something smaller? Check this [crazy shit](https://gist.github.com/982883) out! ) -* [Annotated source code](http://broofa.github.com/node-uuid/docs/uuid.html) - -## Getting Started - -Install it in your browser: - -```html - -``` - -Or in node.js: - -``` -npm install node-uuid -``` - -```javascript -var uuid = require('node-uuid'); -``` - -Then create some ids ... - -```javascript -// Generate a v1 (time-based) id -uuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a' - -// Generate a v4 (random) id -uuid.v4(); // -> '110ec58a-a0f2-4ac4-8393-c866d813b8d1' -``` - -## API - -### uuid.v1([`options` [, `buffer` [, `offset`]]]) - -Generate and return a RFC4122 v1 (timestamp-based) UUID. - -* `options` - (Object) Optional uuid state to apply. Properties may include: - - * `node` - (Array) Node id as Array of 6 bytes (per 4.1.6). Default: Randomly generated ID. See note 1. - * `clockseq` - (Number between 0 - 0x3fff) RFC clock sequence. Default: An internally maintained clockseq is used. - * `msecs` - (Number | Date) Time in milliseconds since unix Epoch. Default: The current time is used. - * `nsecs` - (Number between 0-9999) additional time, in 100-nanosecond units. Ignored if `msecs` is unspecified. Default: internal uuid counter is used, as per 4.2.1.2. - -* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. -* `offset` - (Number) Starting index in `buffer` at which to begin writing. - -Returns `buffer`, if specified, otherwise the string form of the UUID - -Notes: - -1. The randomly generated node id is only guaranteed to stay constant for the lifetime of the current JS runtime. (Future versions of this module may use persistent storage mechanisms to extend this guarantee.) - -Example: Generate string UUID with fully-specified options - -```javascript -uuid.v1({ - node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab], - clockseq: 0x1234, - msecs: new Date('2011-11-01').getTime(), - nsecs: 5678 -}); // -> "710b962e-041c-11e1-9234-0123456789ab" -``` - -Example: In-place generation of two binary IDs - -```javascript -// Generate two ids in an array -var arr = new Array(32); // -> [] -uuid.v1(null, arr, 0); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15] -uuid.v1(null, arr, 16); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15 02 a3 1c b0 14 32 11 e1 85 58 0b 48 8e 4f c1 15] - -// Optionally use uuid.unparse() to get stringify the ids -uuid.unparse(buffer); // -> '02a2ce90-1432-11e1-8558-0b488e4fc115' -uuid.unparse(buffer, 16) // -> '02a31cb0-1432-11e1-8558-0b488e4fc115' -``` - -### uuid.v4([`options` [, `buffer` [, `offset`]]]) - -Generate and return a RFC4122 v4 UUID. - -* `options` - (Object) Optional uuid state to apply. Properties may include: - - * `random` - (Number[16]) Array of 16 numbers (0-255) to use in place of randomly generated values - * `rng` - (Function) Random # generator to use. Set to one of the built-in generators - `uuid.mathRNG` (all platforms), `uuid.nodeRNG` (node.js only), `uuid.whatwgRNG` (WebKit only) - or a custom function that returns an array[16] of byte values. - -* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. -* `offset` - (Number) Starting index in `buffer` at which to begin writing. - -Returns `buffer`, if specified, otherwise the string form of the UUID - -Example: Generate string UUID with fully-specified options - -```javascript -uuid.v4({ - random: [ - 0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea, - 0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36 - ] -}); -// -> "109156be-c4fb-41ea-b1b4-efe1671c5836" -``` - -Example: Generate two IDs in a single buffer - -```javascript -var buffer = new Array(32); // (or 'new Buffer' in node.js) -uuid.v4(null, buffer, 0); -uuid.v4(null, buffer, 16); -``` - -### uuid.parse(id[, buffer[, offset]]) -### uuid.unparse(buffer[, offset]) - -Parse and unparse UUIDs - - * `id` - (String) UUID(-like) string - * `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. Default: A new Array or Buffer is used - * `offset` - (Number) Starting index in `buffer` at which to begin writing. Default: 0 - -Example parsing and unparsing a UUID string - -```javascript -var bytes = uuid.parse('797ff043-11eb-11e1-80d6-510998755d10'); // -> -var string = uuid.unparse(bytes); // -> '797ff043-11eb-11e1-80d6-510998755d10' -``` - -### uuid.noConflict() - -(Browsers only) Set `uuid` property back to it's previous value. - -Returns the node-uuid object. - -Example: - -```javascript -var myUuid = uuid.noConflict(); -myUuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a' -``` - -## Deprecated APIs - -Support for the following v1.2 APIs is available in v1.3, but is deprecated and will be removed in the next major version. - -### uuid([format [, buffer [, offset]]]) - -uuid() has become uuid.v4(), and the `format` argument is now implicit in the `buffer` argument. (i.e. if you specify a buffer, the format is assumed to be binary). - -### uuid.BufferClass - -The class of container created when generating binary uuid data if no buffer argument is specified. This is expected to go away, with no replacement API. - -## Testing - -In node.js - -``` -> cd test -> node test.js -``` - -In Browser - -``` -open test/test.html -``` - -### Benchmarking - -Requires node.js - -``` -npm install uuid uuid-js -node benchmark/benchmark.js -``` - -For a more complete discussion of node-uuid performance, please see the `benchmark/README.md` file, and the [benchmark wiki](https://github.com/broofa/node-uuid/wiki/Benchmark) - -For browser performance [checkout the JSPerf tests](http://jsperf.com/node-uuid-performance). - -## Release notes - -v1.4 -* Improved module context detection -* Removed public RNG functions - -v1.3.2: -* Improve tests and handling of v1() options (Issue #24) -* Expose RNG option to allow for perf testing with different generators - -v1.3: -* Support for version 1 ids, thanks to [@ctavan](https://github.com/ctavan)! -* Support for node.js crypto API -* De-emphasizing performance in favor of a) cryptographic quality PRNGs where available and b) more manageable code diff --git a/test/acceptance/workspaces/mono-repo-nested/level-1/node_modules/node-uuid/package.json b/test/acceptance/workspaces/mono-repo-nested/level-1/node_modules/node-uuid/package.json deleted file mode 100644 index fc6297d963..0000000000 --- a/test/acceptance/workspaces/mono-repo-nested/level-1/node_modules/node-uuid/package.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "_from": "node-uuid@1.4.0", - "_id": "node-uuid@1.4.0", - "_inBundle": false, - "_integrity": "sha1-B/myM3Vy/2J1x3Xh1IUT86RdemU=", - "_location": "/node-uuid", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "node-uuid@1.4.0", - "name": "node-uuid", - "escapedName": "node-uuid", - "rawSpec": "1.4.0", - "saveSpec": null, - "fetchSpec": "1.4.0" - }, - "_requiredBy": [ - "/" - ], - "_resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.0.tgz", - "_shasum": "07f9b2337572ff6275c775e1d48513f3a45d7a65", - "_spec": "node-uuid@1.4.0", - "_where": "/Users/orsagie/snyk-fixtures/monorepo-simple", - "author": { - "name": "Robert Kieffer", - "email": "robert@broofa.com" - }, - "bugs": { - "url": "https://github.com/broofa/node-uuid/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Christoph Tavan", - "email": "dev@tavan.de" - } - ], - "deprecated": "Use uuid module instead", - "description": "Rigorous implementation of RFC4122 (v1 and v4) UUIDs.", - "homepage": "https://github.com/broofa/node-uuid#readme", - "keywords": [ - "uuid", - "guid", - "rfc4122" - ], - "lib": ".", - "main": "./uuid.js", - "name": "node-uuid", - "repository": { - "type": "git", - "url": "git+https://github.com/broofa/node-uuid.git" - }, - "url": "http://github.com/broofa/node-uuid", - "version": "1.4.0" -} diff --git a/test/acceptance/workspaces/mono-repo-nested/level-1/node_modules/qs/Readme.md b/test/acceptance/workspaces/mono-repo-nested/level-1/node_modules/qs/Readme.md deleted file mode 100644 index 78cbe24bd4..0000000000 --- a/test/acceptance/workspaces/mono-repo-nested/level-1/node_modules/qs/Readme.md +++ /dev/null @@ -1,38 +0,0 @@ - -# node-querystring - - query string parser for node supporting nesting, as it was removed from `0.3.x`, so this library provides the previous and commonly desired behaviour (and twice as fast). Used by [express](http://expressjs.com), [connect](http://senchalabs.github.com/connect) and others. - -## Installation - - $ npm install qs - -## Examples - - require('querystring').parse('user[name][first]=tj&user[email]=tj'); - // => { user: { name: { first: 'tj' }}} - -## License - -(The MIT License) - -Copyright (c) 2010 TJ Holowaychuk <tj@vision-media.ca> - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/test/acceptance/workspaces/mono-repo-nested/level-1/node_modules/qs/package.json b/test/acceptance/workspaces/mono-repo-nested/level-1/node_modules/qs/package.json deleted file mode 100644 index a03148ff13..0000000000 --- a/test/acceptance/workspaces/mono-repo-nested/level-1/node_modules/qs/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "_from": "qs@0.0.6", - "_id": "qs@0.0.6", - "_inBundle": false, - "_integrity": "sha1-SBZZt+W/al6omAEN5a7TXrRp4SQ=", - "_location": "/qs", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "qs@0.0.6", - "name": "qs", - "escapedName": "qs", - "rawSpec": "0.0.6", - "saveSpec": null, - "fetchSpec": "0.0.6" - }, - "_requiredBy": [ - "/" - ], - "_resolved": "https://registry.npmjs.org/qs/-/qs-0.0.6.tgz", - "_shasum": "481659b7e5bf6a5ea898010de5aed35eb469e124", - "_spec": "qs@0.0.6", - "_where": "/Users/orsagie/snyk-fixtures/monorepo-simple", - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca", - "url": "http://tjholowaychuk.com" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "querystring parser", - "engines": { - "node": "*" - }, - "main": "index", - "name": "qs", - "repository": {}, - "version": "0.0.6" -} diff --git a/test/acceptance/workspaces/mono-repo-nested/level-1/package.json b/test/acceptance/workspaces/mono-repo-nested/level-1/package.json deleted file mode 100644 index 5211b26c8e..0000000000 --- a/test/acceptance/workspaces/mono-repo-nested/level-1/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "goof", - "version": "0.0.3", - "description": "A vulnerable todo demo application", - "homepage": "https://snyk.io/", - "repository": { - "type": "git", - "url": "https://github.com/Snyk/snyk-todo-list-demo-app/" - }, - "scripts": { - "start": "node app.js", - "cleanup": "mongo express-todo --eval 'db.todos.remove({});'" - }, - "dependencies": { - "body-parser": "1.9.0", - "cookie-parser": "1.3.3", - "ejs": "1.0.0", - "ejs-locals": "1.0.2", - "errorhandler": "1.2.0", - "express": "4.12.4", - "express-fileupload": "0.0.5", - "humanize-ms": "1.0.1", - "marked": "0.3.5", - "method-override": "latest", - "moment": "2.15.1", - "mongoose": "4.2.4", - "morgan": "latest", - "ms": "^0.7.1", - "npmconf": "0.0.24", - "optional": "^0.1.3", - "st": "0.2.4", - "stream-buffers": "^3.0.1", - "tap": "^5.7.0" - } -} diff --git a/test/acceptance/workspaces/mono-repo-nested/node_modules/node-uuid/README.md b/test/acceptance/workspaces/mono-repo-nested/node_modules/node-uuid/README.md deleted file mode 100644 index d62f7a14d4..0000000000 --- a/test/acceptance/workspaces/mono-repo-nested/node_modules/node-uuid/README.md +++ /dev/null @@ -1,203 +0,0 @@ -# node-uuid - -Simple, fast generation of [RFC4122](http://www.ietf.org/rfc/rfc4122.txt) UUIDS. - -Features: - -* Generate RFC4122 version 1 or version 4 UUIDs -* Runs in node.js and all browsers. -* Cryptographically strong random # generation on supporting platforms -* 1.1K minified and gzip'ed (Want something smaller? Check this [crazy shit](https://gist.github.com/982883) out! ) -* [Annotated source code](http://broofa.github.com/node-uuid/docs/uuid.html) - -## Getting Started - -Install it in your browser: - -```html - -``` - -Or in node.js: - -``` -npm install node-uuid -``` - -```javascript -var uuid = require('node-uuid'); -``` - -Then create some ids ... - -```javascript -// Generate a v1 (time-based) id -uuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a' - -// Generate a v4 (random) id -uuid.v4(); // -> '110ec58a-a0f2-4ac4-8393-c866d813b8d1' -``` - -## API - -### uuid.v1([`options` [, `buffer` [, `offset`]]]) - -Generate and return a RFC4122 v1 (timestamp-based) UUID. - -* `options` - (Object) Optional uuid state to apply. Properties may include: - - * `node` - (Array) Node id as Array of 6 bytes (per 4.1.6). Default: Randomly generated ID. See note 1. - * `clockseq` - (Number between 0 - 0x3fff) RFC clock sequence. Default: An internally maintained clockseq is used. - * `msecs` - (Number | Date) Time in milliseconds since unix Epoch. Default: The current time is used. - * `nsecs` - (Number between 0-9999) additional time, in 100-nanosecond units. Ignored if `msecs` is unspecified. Default: internal uuid counter is used, as per 4.2.1.2. - -* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. -* `offset` - (Number) Starting index in `buffer` at which to begin writing. - -Returns `buffer`, if specified, otherwise the string form of the UUID - -Notes: - -1. The randomly generated node id is only guaranteed to stay constant for the lifetime of the current JS runtime. (Future versions of this module may use persistent storage mechanisms to extend this guarantee.) - -Example: Generate string UUID with fully-specified options - -```javascript -uuid.v1({ - node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab], - clockseq: 0x1234, - msecs: new Date('2011-11-01').getTime(), - nsecs: 5678 -}); // -> "710b962e-041c-11e1-9234-0123456789ab" -``` - -Example: In-place generation of two binary IDs - -```javascript -// Generate two ids in an array -var arr = new Array(32); // -> [] -uuid.v1(null, arr, 0); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15] -uuid.v1(null, arr, 16); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15 02 a3 1c b0 14 32 11 e1 85 58 0b 48 8e 4f c1 15] - -// Optionally use uuid.unparse() to get stringify the ids -uuid.unparse(buffer); // -> '02a2ce90-1432-11e1-8558-0b488e4fc115' -uuid.unparse(buffer, 16) // -> '02a31cb0-1432-11e1-8558-0b488e4fc115' -``` - -### uuid.v4([`options` [, `buffer` [, `offset`]]]) - -Generate and return a RFC4122 v4 UUID. - -* `options` - (Object) Optional uuid state to apply. Properties may include: - - * `random` - (Number[16]) Array of 16 numbers (0-255) to use in place of randomly generated values - * `rng` - (Function) Random # generator to use. Set to one of the built-in generators - `uuid.mathRNG` (all platforms), `uuid.nodeRNG` (node.js only), `uuid.whatwgRNG` (WebKit only) - or a custom function that returns an array[16] of byte values. - -* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. -* `offset` - (Number) Starting index in `buffer` at which to begin writing. - -Returns `buffer`, if specified, otherwise the string form of the UUID - -Example: Generate string UUID with fully-specified options - -```javascript -uuid.v4({ - random: [ - 0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea, - 0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36 - ] -}); -// -> "109156be-c4fb-41ea-b1b4-efe1671c5836" -``` - -Example: Generate two IDs in a single buffer - -```javascript -var buffer = new Array(32); // (or 'new Buffer' in node.js) -uuid.v4(null, buffer, 0); -uuid.v4(null, buffer, 16); -``` - -### uuid.parse(id[, buffer[, offset]]) -### uuid.unparse(buffer[, offset]) - -Parse and unparse UUIDs - - * `id` - (String) UUID(-like) string - * `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. Default: A new Array or Buffer is used - * `offset` - (Number) Starting index in `buffer` at which to begin writing. Default: 0 - -Example parsing and unparsing a UUID string - -```javascript -var bytes = uuid.parse('797ff043-11eb-11e1-80d6-510998755d10'); // -> -var string = uuid.unparse(bytes); // -> '797ff043-11eb-11e1-80d6-510998755d10' -``` - -### uuid.noConflict() - -(Browsers only) Set `uuid` property back to it's previous value. - -Returns the node-uuid object. - -Example: - -```javascript -var myUuid = uuid.noConflict(); -myUuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a' -``` - -## Deprecated APIs - -Support for the following v1.2 APIs is available in v1.3, but is deprecated and will be removed in the next major version. - -### uuid([format [, buffer [, offset]]]) - -uuid() has become uuid.v4(), and the `format` argument is now implicit in the `buffer` argument. (i.e. if you specify a buffer, the format is assumed to be binary). - -### uuid.BufferClass - -The class of container created when generating binary uuid data if no buffer argument is specified. This is expected to go away, with no replacement API. - -## Testing - -In node.js - -``` -> cd test -> node test.js -``` - -In Browser - -``` -open test/test.html -``` - -### Benchmarking - -Requires node.js - -``` -npm install uuid uuid-js -node benchmark/benchmark.js -``` - -For a more complete discussion of node-uuid performance, please see the `benchmark/README.md` file, and the [benchmark wiki](https://github.com/broofa/node-uuid/wiki/Benchmark) - -For browser performance [checkout the JSPerf tests](http://jsperf.com/node-uuid-performance). - -## Release notes - -v1.4 -* Improved module context detection -* Removed public RNG functions - -v1.3.2: -* Improve tests and handling of v1() options (Issue #24) -* Expose RNG option to allow for perf testing with different generators - -v1.3: -* Support for version 1 ids, thanks to [@ctavan](https://github.com/ctavan)! -* Support for node.js crypto API -* De-emphasizing performance in favor of a) cryptographic quality PRNGs where available and b) more manageable code diff --git a/test/acceptance/workspaces/mono-repo-nested/node_modules/node-uuid/package.json b/test/acceptance/workspaces/mono-repo-nested/node_modules/node-uuid/package.json deleted file mode 100644 index fc6297d963..0000000000 --- a/test/acceptance/workspaces/mono-repo-nested/node_modules/node-uuid/package.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "_from": "node-uuid@1.4.0", - "_id": "node-uuid@1.4.0", - "_inBundle": false, - "_integrity": "sha1-B/myM3Vy/2J1x3Xh1IUT86RdemU=", - "_location": "/node-uuid", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "node-uuid@1.4.0", - "name": "node-uuid", - "escapedName": "node-uuid", - "rawSpec": "1.4.0", - "saveSpec": null, - "fetchSpec": "1.4.0" - }, - "_requiredBy": [ - "/" - ], - "_resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.0.tgz", - "_shasum": "07f9b2337572ff6275c775e1d48513f3a45d7a65", - "_spec": "node-uuid@1.4.0", - "_where": "/Users/orsagie/snyk-fixtures/monorepo-simple", - "author": { - "name": "Robert Kieffer", - "email": "robert@broofa.com" - }, - "bugs": { - "url": "https://github.com/broofa/node-uuid/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Christoph Tavan", - "email": "dev@tavan.de" - } - ], - "deprecated": "Use uuid module instead", - "description": "Rigorous implementation of RFC4122 (v1 and v4) UUIDs.", - "homepage": "https://github.com/broofa/node-uuid#readme", - "keywords": [ - "uuid", - "guid", - "rfc4122" - ], - "lib": ".", - "main": "./uuid.js", - "name": "node-uuid", - "repository": { - "type": "git", - "url": "git+https://github.com/broofa/node-uuid.git" - }, - "url": "http://github.com/broofa/node-uuid", - "version": "1.4.0" -} diff --git a/test/acceptance/workspaces/mono-repo-nested/node_modules/qs/Readme.md b/test/acceptance/workspaces/mono-repo-nested/node_modules/qs/Readme.md deleted file mode 100644 index 78cbe24bd4..0000000000 --- a/test/acceptance/workspaces/mono-repo-nested/node_modules/qs/Readme.md +++ /dev/null @@ -1,38 +0,0 @@ - -# node-querystring - - query string parser for node supporting nesting, as it was removed from `0.3.x`, so this library provides the previous and commonly desired behaviour (and twice as fast). Used by [express](http://expressjs.com), [connect](http://senchalabs.github.com/connect) and others. - -## Installation - - $ npm install qs - -## Examples - - require('querystring').parse('user[name][first]=tj&user[email]=tj'); - // => { user: { name: { first: 'tj' }}} - -## License - -(The MIT License) - -Copyright (c) 2010 TJ Holowaychuk <tj@vision-media.ca> - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/test/acceptance/workspaces/mono-repo-nested/node_modules/qs/package.json b/test/acceptance/workspaces/mono-repo-nested/node_modules/qs/package.json deleted file mode 100644 index a03148ff13..0000000000 --- a/test/acceptance/workspaces/mono-repo-nested/node_modules/qs/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "_from": "qs@0.0.6", - "_id": "qs@0.0.6", - "_inBundle": false, - "_integrity": "sha1-SBZZt+W/al6omAEN5a7TXrRp4SQ=", - "_location": "/qs", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "qs@0.0.6", - "name": "qs", - "escapedName": "qs", - "rawSpec": "0.0.6", - "saveSpec": null, - "fetchSpec": "0.0.6" - }, - "_requiredBy": [ - "/" - ], - "_resolved": "https://registry.npmjs.org/qs/-/qs-0.0.6.tgz", - "_shasum": "481659b7e5bf6a5ea898010de5aed35eb469e124", - "_spec": "qs@0.0.6", - "_where": "/Users/orsagie/snyk-fixtures/monorepo-simple", - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca", - "url": "http://tjholowaychuk.com" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "querystring parser", - "engines": { - "node": "*" - }, - "main": "index", - "name": "qs", - "repository": {}, - "version": "0.0.6" -} diff --git a/test/acceptance/workspaces/mono-repo-nested/package-lock.json b/test/acceptance/workspaces/mono-repo-nested/package-lock.json deleted file mode 100644 index fce7bf7f28..0000000000 --- a/test/acceptance/workspaces/mono-repo-nested/package-lock.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "shallow-goof", - "version": "0.0.1", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "node-uuid": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.0.tgz", - "integrity": "sha1-B/myM3Vy/2J1x3Xh1IUT86RdemU=" - }, - "qs": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/qs/-/qs-0.0.6.tgz", - "integrity": "sha1-SBZZt+W/al6omAEN5a7TXrRp4SQ=" - } - } -} diff --git a/test/acceptance/workspaces/mono-repo-nested/package.json b/test/acceptance/workspaces/mono-repo-nested/package.json deleted file mode 100644 index 4b2ecd8d3d..0000000000 --- a/test/acceptance/workspaces/mono-repo-nested/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "shallow-goof", - "version": "0.0.1", - "description": "A vulnerable demo application", - "homepage": "https://snyk.io/", - "repository": { - "type": "git", - "url": "https://github.com/Snyk/shallow-goof" - }, - "dependencies": { - "qs": "0.0.6", - "node-uuid": "1.4.0" - } -} diff --git a/test/jest/acceptance/snyk-sbom-test/all-projects.spec.ts b/test/jest/acceptance/snyk-sbom-test/all-projects.spec.ts index 0b935b29d9..3c7fb8c5a4 100644 --- a/test/jest/acceptance/snyk-sbom-test/all-projects.spec.ts +++ b/test/jest/acceptance/snyk-sbom-test/all-projects.spec.ts @@ -98,6 +98,7 @@ describe('snyk sbom test (mocked server only)', () => { expect(stdout).toContain('"version":"3.0.4",'); expect(stdout).toContain('"name":"minimatch"'); expect(stdout).toContain('"CWE":["CWE-1333"]'); + expect(stdout).toContain('"CVE":["CVE-2022-3517"]'); expect(stdout).toContain('"semver":{"vulnerable":["3.0.4"]}'); expect(code).toEqual(1); diff --git a/test/jest/acceptance/snyk-test/all-projects.spec.ts b/test/jest/acceptance/snyk-test/all-projects.spec.ts index 0a19fd9c39..fdc4fd6433 100644 --- a/test/jest/acceptance/snyk-test/all-projects.spec.ts +++ b/test/jest/acceptance/snyk-test/all-projects.spec.ts @@ -198,48 +198,6 @@ describe('snyk test --all-projects (mocked server only)', () => { expect(stderr).toEqual(''); }); - test('`test mono-repo-nested --all-projects` defaults to 4 max depth', async () => { - const project = await createProjectFromWorkspace('mono-repo-nested'); - - const { code, stdout, stderr } = await runSnykCLI('test --all-projects', { - cwd: project.path(), - env, - }); - - const backendRequests = server.getRequests().filter((req: any) => { - return req.url.includes('/api/v1/test'); - }); - - expect(backendRequests).toHaveLength(4); - backendRequests.forEach((req: any) => { - expect(req.method).toEqual('POST'); - expect(req.headers['x-snyk-cli-version']).not.toBeUndefined(); - expect(req.url).toMatch('/api/v1/test'); - }); - - expect(code).toEqual(0); - - const dirSeparator = process.platform === 'win32' ? '\\' : '/'; - - expect(stdout).toMatch('Target file: package-lock.json'); - expect(stdout).toMatch( - `Target file: level-1${dirSeparator}package.json`, - ); - expect(stdout).toMatch( - `Target file: level-1${dirSeparator}level-2${dirSeparator}Gemfile.lock`, - ); - expect(stdout).toMatch( - `Target file: level-1${dirSeparator}level-2${dirSeparator}level-3${dirSeparator}package-lock.json`, - ); - expect(stdout).not.toMatch( - `level-1${dirSeparator}level-2${dirSeparator}level-3${dirSeparator}level-4${dirSeparator}level-5${dirSeparator}package-lock.json`, - ); - expect(stdout).not.toMatch( - `level-1${dirSeparator}level-2${dirSeparator}level-3${dirSeparator}level-4${dirSeparator}level-5${dirSeparator}level-6${dirSeparator}Gemfile.lock`, - ); - expect(stderr).toBe(''); - }); - test('`test empty --all-projects`', async () => { const project = await createProjectFromWorkspace('empty'); diff --git a/test/tap/find-files.test.ts b/test/tap/find-files.test.ts index 131f4629cd..c2d2410631 100644 --- a/test/tap/find-files.test.ts +++ b/test/tap/find-files.test.ts @@ -2,13 +2,9 @@ import * as path from 'path'; import { test } from 'tap'; import { find } from '../../src/lib/find-files'; import { getFixturePath } from '../jest/util/getFixturePath'; -import { getWorkspacePath } from '../jest/util/getWorkspacePath'; const testFixture = getFixturePath('find-files'); -// eslint-disable-next-line @typescript-eslint/no-unused-vars -const skiptest = (name, _) => console.log(`Skipping ${name}`); - test('find all files in test fixture', async (t) => { // six levels deep to find all const { files: result, allFilesFound } = await find({ @@ -75,26 +71,6 @@ test('find all files in test fixture', async (t) => { ); }); -test('defaults to only detecting files up to 4 layers deep when undefined', async (t) => { - // - const { files: result } = await find({ - path: getWorkspacePath('mono-repo-nested'), - levelsDeep: undefined, - }); - - t.same(result.length, 4); -}); - -test('defaults to only detecting files up to 4 layers deep when null', async (t) => { - // - const { files: result } = await find({ - path: getWorkspacePath('mono-repo-nested'), - levelsDeep: NaN, - }); - - t.same(result.length, 4); -}); - test('find all files in test fixture ignoring node_modules', async (t) => { // six levels deep to ensure node_modules is tested const { files: result } = await find({