Skip to content

Inso-third-pass#7588

Merged
gatzjames merged 12 commits intoKong:developfrom
jackkav:ins-third-pass
Jun 26, 2024
Merged

Inso-third-pass#7588
gatzjames merged 12 commits intoKong:developfrom
jackkav:ins-third-pass

Conversation

@jackkav
Copy link
Contributor

@jackkav jackkav commented Jun 26, 2024

  • flatten code paths
  • improve cli output
  • improve developer experience

notes

  • npm run inso-start is better
  • docs is better
  • cli output is clearer
  • most of the complexity is in cli.ts instead of 10 files

next steps

  • upgrade libs

ref INS-4021

export function getAppDataDir(app: string): string {
switch (process.platform) {
case 'darwin':
return path.join(homedir(), 'Library', 'Application Support', app);

Check warning

Code scanning / Semgrep OSS

Semgrep Finding: javascript.lang.security.audit.path-traversal.path-join-resolve-traversal.path-join-resolve-traversal

Detected possible user input going into a `path.join` or `path.resolve` function. This could possibly lead to a path traversal vulnerability, where the attacker can access arbitrary files stored in the file system. Instead, be sure to sanitize or validate user input first.
case 'darwin':
return path.join(homedir(), 'Library', 'Application Support', app);
case 'win32':
return path.join(process.env.APPDATA || path.join(homedir(), 'AppData', 'Roaming'), app);

Check warning

Code scanning / Semgrep OSS

Semgrep Finding: javascript.lang.security.audit.path-traversal.path-join-resolve-traversal.path-join-resolve-traversal

Detected possible user input going into a `path.join` or `path.resolve` function. This could possibly lead to a path traversal vulnerability, where the attacker can access arbitrary files stored in the file system. Instead, be sure to sanitize or validate user input first.
case 'win32':
return path.join(process.env.APPDATA || path.join(homedir(), 'AppData', 'Roaming'), app);
case 'linux':
return path.join(process.env.XDG_DATA_HOME || path.join(homedir(), '.config'), app);

Check warning

Code scanning / Semgrep OSS

Semgrep Finding: javascript.lang.security.audit.path-traversal.path-join-resolve-traversal.path-join-resolve-traversal

Detected possible user input going into a `path.join` or `path.resolve` function. This could possibly lead to a path traversal vulnerability, where the attacker can access arbitrary files stored in the file system. Instead, be sure to sanitize or validate user input first.
@jackkav jackkav marked this pull request as ready for review June 26, 2024 09:34
if (!specFromDb) {
logger.fatal('Specification not found.');
const pathToSearch = getAbsolutePath({ workingDir, src });
logger.fatal('Specification not found at: ' + pathToSearch);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@gatzjames gatzjames merged commit 72edb6a into Kong:develop Jun 26, 2024
@jackkav jackkav deleted the ins-third-pass branch June 26, 2024 09:52
stefancruz pushed a commit to stefancruz/insomnia that referenced this pull request Jun 30, 2024
* inline utils and clean outputs

* improving the log output

* dx

* fix tests abstract path

* return early

* flatten options and utils

* flatten logger

* add export file and git examples

* flatten cli.ts

* use await api and flatten

* flatten cli

* fix test
CurryYangxx pushed a commit that referenced this pull request Jul 5, 2024
* inline utils and clean outputs

* improving the log output

* dx

* fix tests abstract path

* return early

* flatten options and utils

* flatten logger

* add export file and git examples

* flatten cli.ts

* use await api and flatten

* flatten cli

* fix test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants