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

fix: jobs vulnerability #1799

Merged
merged 11 commits into from Mar 6, 2024
Merged

fix: jobs vulnerability #1799

merged 11 commits into from Mar 6, 2024

Conversation

TBonnin
Copy link
Collaborator

@TBonnin TBonnin commented Mar 5, 2024

jobs depends on the api package to make request to render api This package suffers from a vulnerability of one of its dependency, specifically the lodash.setWith package which is actually deprecated.
There is a PR open for api to use full lodash instead of per method packages (which are deprecated) but it has not been merged yet. readmeio/api#859

This commit replaces the api package used to generate a render sdk from their openapi spec by a home-made RenderAPI class (40 lines of code)

Issue ticket number and link

https://linear.app/nango/issue/NAN-453/[credal]-fix-jobs-vulnerability

Checklist before requesting a review (skip if just adding/editing APIs & templates)

  • I added tests, otherwise the reason is:
  • I added observability, otherwise the reason is:
  • I added analytics, otherwise the reason is:

Copy link

linear bot commented Mar 5, 2024

@TBonnin TBonnin force-pushed the tbonnin/NAN-453/api-package-vuln branch 3 times, most recently from 17ac8cd to f60677e Compare March 5, 2024 13:53
jobs depends on the api package to make request to render api This
package suffers from a vulnerability of one of its dependency,
specifically the lodash.setWith package which is actually deprecated.
There is a PR open for api to use full lodash instead of per method
packages (which are deprecated) but it has not been merged yet.
readmeio/api#859

This commit replaces the api package used to generate a render sdk from
their openapi spec by a home-made RenderAPI class (40 lines of code)
@TBonnin TBonnin force-pushed the tbonnin/NAN-453/api-package-vuln branch from f60677e to 16b93cc Compare March 5, 2024 14:14
@TBonnin
Copy link
Collaborator Author

TBonnin commented Mar 5, 2024

Screenshot 2024-03-05 at 15 21 01

@@ -31,6 +31,7 @@
"ajv-errors": "^3.0.0",
"axios": "^1.2.0",
"byots": "^5.0.0-dev.20221103.1.34",
"chalk": "^5.3.0",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

unrelated but chalk was not declared as CLI dependency

Copy link
Contributor

@bodinsamuel bodinsamuel left a comment

Choose a reason for hiding this comment

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

Nice 🚀 Few comments but overall good!
I guess you already have tested this in staging?

@@ -31,6 +31,7 @@
"ajv-errors": "^3.0.0",
"axios": "^1.2.0",
"byots": "^5.0.0-dev.20221103.1.34",
Copy link
Contributor

Choose a reason for hiding this comment

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

unrelated, do we use this byots package? it seems not, or at least not imported 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good question. It is a bit out of the scope of this PR. I only happen to touch CLI package.json because it wouldn't compile without explicitly set chalk as a dependency but I am sure there is a some more cleanup to do

Copy link
Member

Choose a reason for hiding this comment

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

Agree of out of scope but we used byots in an earlier iteration of the compilation of the typescript files for the cli, but now use ts-node instead.

packages/jobs/lib/runner/render.runner.ts Show resolved Hide resolved
packages/jobs/lib/runner/render.runner.ts Outdated Show resolved Hide resolved
@TBonnin TBonnin force-pushed the tbonnin/NAN-453/api-package-vuln branch from 215ddf1 to 38fae7d Compare March 5, 2024 15:25
@TBonnin TBonnin merged commit 5950e95 into master Mar 6, 2024
20 checks passed
@TBonnin TBonnin deleted the tbonnin/NAN-453/api-package-vuln branch March 6, 2024 07:10
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

3 participants