Skip to content
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

Inso-third-pass #7588

Merged
merged 12 commits into from
Jun 26, 2024
Merged

Inso-third-pass #7588

merged 12 commits into from
Jun 26, 2024

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 Warning

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 Warning

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 Warning

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
@@ -33,7 +32,8 @@ export async function exportSpecification(
const specFromDb = identifier ? loadApiSpec(db, identifier) : await promptApiSpec(db, !!ci);

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
6 checks passed
@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.

None yet

2 participants