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

Update NodeJS backend dependencies. #214

Merged
merged 45 commits into from
Nov 28, 2024
Merged

Update NodeJS backend dependencies. #214

merged 45 commits into from
Nov 28, 2024

Conversation

trev-dev
Copy link
Contributor

@trev-dev trev-dev commented Jun 17, 2024

Jira: HD-26946

The goal of this pull request is to update the NodeJS backend and its dependencies. Due to some of the updates being incompatible with CommonJS modules, I opted to refactor the backend into the ESM (EcmaScript Module) format. This is the standard for JavaScript, whereas CJS was more of a node/webpack/bundler thing.

Breaking changes for nats and passport have been addressed as well. Check the commit messages, I tried to keep things granular.

Jest was also dropped in favor of Vitest. Vitest is actually prepared to test ESM files. This change removed a great deal of bloat from the dependency tree and sped up tests a great deal.

Copy link

Quality Gate Passed Quality Gate passed

Issues
3 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@trev-dev trev-dev marked this pull request as draft June 18, 2024 21:20
backend/src/routes/user.js Fixed Show fixed Hide fixed
backend/tests/unit/components/requestStatus.spec.js Dismissed Show dismissed Hide dismissed
backend/tests/unit/components/requestStatus.spec.js Dismissed Show dismissed Hide dismissed
backend/tests/unit/components/requestStatus.spec.js Dismissed Show dismissed Hide dismissed
backend/tests/unit/components/email.spec.js Dismissed Show dismissed Hide dismissed
backend/tests/unit/components/email.spec.js Dismissed Show dismissed Hide dismissed
backend/tests/unit/components/request.spec.js Dismissed Show dismissed Hide dismissed
backend/tests/unit/components/request.spec.js Dismissed Show dismissed Hide dismissed
backend/tests/unit/components/request.spec.js Dismissed Show dismissed Hide dismissed
backend/tests/unit/components/request.spec.js Dismissed Show dismissed Hide dismissed
backend/tests/unit/components/identityTypeCodes.spec.js Dismissed Show dismissed Hide dismissed
backend/tests/unit/components/identityTypeCodes.spec.js Dismissed Show dismissed Hide dismissed
backend/tests/unit/components/identityTypeCodes.spec.js Dismissed Show dismissed Hide dismissed
backend/tests/unit/components/request.spec.js Dismissed Show dismissed Hide dismissed
backend/tests/unit/components/request.spec.js Dismissed Show dismissed Hide dismissed
backend/tests/unit/components/request.spec.js Dismissed Show dismissed Hide dismissed
backend/tests/unit/components/request.spec.js Dismissed Show dismissed Hide dismissed
backend/tests/unit/components/request.spec.js Dismissed Show dismissed Hide dismissed
backend/tests/unit/components/request.spec.js Dismissed Show dismissed Hide dismissed
backend/tests/unit/components/request.spec.js Dismissed Show dismissed Hide dismissed
@trev-dev trev-dev marked this pull request as ready for review September 3, 2024 23:58
Copy link

const user = getSessionUser(req);
return user && user.jwt;
}

async function deleteData(token, url, correlationID) {
export async function deleteData(token, url, correlationID) {

Check failure

Code scanning / CodeQL

Server-side request forgery Critical

The
URL
of this request depends on a
user-provided value
.
The
URL
of this request depends on a
user-provided value
.
The
URL
of this request depends on a
user-provided value
.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@arcshiftsolutions SO I made a check to validate the user supplied params. The super-duper smart AI assistant can't understand that it's inside of a try block, that when caught, returns a bad request already.

Copy link
Contributor

Choose a reason for hiding this comment

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

@trev-dev - Yeah we ran into the same thing - the CodeQL engine isn't always smart enough to see what we're doing in middleware.

@@ -88,7 +98,7 @@
}
}

async function getData(token, url, correlationID) {
export async function getData(token, url, correlationID) {

Check failure

Code scanning / CodeQL

Server-side request forgery Critical

The
URL
of this request depends on a
user-provided value
.
The
URL
of this request depends on a
user-provided value
.
The
URL
of this request depends on a
user-provided value
.
The
URL
of this request depends on a
user-provided value
.
The
URL
of this request depends on a
user-provided value
.
The
URL
of this request depends on a
user-provided value
.
The
URL
of this request depends on a
user-provided value
.
The
URL
of this request depends on a
user-provided value
.
The
URL
of this request depends on a
user-provided value
.
The
URL
of this request depends on a
user-provided value
.
The
URL
of this request depends on a
user-provided value
.
The
URL
of this request depends on a
user-provided value
.
@trev-dev trev-dev merged commit 8aeebed into master Nov 28, 2024
6 of 7 checks passed
@trev-dev trev-dev deleted the fix/HD-26946 branch November 28, 2024 15:42
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