makeopensource / devU

Autograder version 4
10 stars 13 forks source link

Fix npm vulnerabilites (Update dependancies) #59 #113

Closed SantarinX closed 3 months ago

SantarinX commented 4 months ago

Proposed changes


This PR updated most of the packages that have critical vulnerable modules for both API and client. and related to the issue #59 Specific Updates:

  1. TypeOrm: a. ConnectionOptions updated to DataSourceOptions and removed cli section in the database.ts b. createConnection updated to DataSource and needed to use new DataSource('DataSourceOptions').initialize() to create a connection to the Database c. migration: run and migration: generated are updated, the specific command is updated in the documentation
  2. Minio: Updated from 7.0.18 to 8.0.0 to have better performance and more advanced data protection
  3. Multer: Updated from 1.4.2 to 1.4.5-lts.1 to avoid high vulnerability of the dependency package
  4. Webpack: For this package update, I used the npm audit fix to auto-update versions, for the specific update it's mainly in the webpack.config.js file, it updated contentBase to static and nodeEnv in the optimization. and fixed

Error: error:0308010C: digital envelope routines::unsupported

issue where Node must downgrade to 16 in order to run locally.

Types of changes


What types of changes does your code introduce? Put an x in the boxes that apply

Checklist


Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. This is simply a reminder of what we are going to look for before merging your code.

Further comments


The client package now has 0 vulnerabilities The API Still has 2 moderate severity vulnerabilities due to the passport-saml. The current package passport-saml is deprecated, the new one is @node-saml/passport-saml. However, the current config does not fit in at all, the whole saml-config file needs to be modified, but I have no idea where to start. Therefore, I left it for others to update this.

After Updated All of the packages, I tested API by npm run test, they all passed except one grade 200 OK test, but this is the old issue before updating packages. I also tested the whole program by running docker compose up and separating run API and client in the local environment, both are functional.