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

Socket.io server code to TS and adds unit testing #418

Merged
merged 17 commits into from
Oct 30, 2023

Conversation

andreahaku
Copy link
Contributor

@andreahaku andreahaku commented Oct 20, 2023

Refactors Socket.io server code to typescript.
Adds unit tests to the code.

@andreahaku andreahaku self-assigned this Oct 20, 2023
@socket-security
Copy link

socket-security bot commented Oct 20, 2023

New and updated dependencies detected. Learn more about Socket for GitHub ↗︎

Packages Version New capabilities Transitives Size Publisher
@types/socket.io 3.0.2 None +4 2.96 MB types
@types/helmet 4.0.0 None +2 204 kB types
@types/dotenv 8.2.0 None +0 1.72 kB types
@types/uuid 8.3.4 None +0 6.67 kB types
ts-node-dev 2.0.0 filesystem, shell, environment +10 154 kB whitecolor
@types/analytics-node 3.1.13 None +0 6.9 kB types
supertest 6.3.3 network +10 1.34 MB titanism
@typescript-eslint/eslint-plugin 6.9.0 None +2 2.84 MB jameshenry
@types/cors 2.8.15 None +0 5.9 kB types
@types/supertest 2.0.15 None +4 44.6 kB types
@types/uuid 9.0.2...9.0.6 None +0/-0 6.65 kB types
socket.io 4.7.1...4.7.2 None +2/-2 1.64 MB darrachequesne

@socket-security
Copy link

socket-security bot commented Oct 20, 2023

🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎

To accept the risk, merge this PR and you will not be notified again.

Issue Package Version Note Source
Deprecated @types/dotenv 8.2.0
  • Reason: This is a stub types definition. dotenv provides its own type definitions, so you do not need this installed.
Deprecated @types/socket.io 3.0.2
  • Reason: This is a stub types definition. socket.io provides its own type definitions, so you do not need this installed.
Deprecated @types/helmet 4.0.0
  • Reason: This is a stub types definition. helmet provides its own type definitions, so you do not need this installed.
Network access supertest 6.3.3
New author dezalgo 1.0.4
Shell access ts-node-dev 2.0.0

Next steps

What is a deprecated package?

The maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.

Research the state of the package and determine if there are non-deprecated versions that can be used, or if it should be replaced with a new, supported solution.

What is network access?

This module accesses the network.

Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use.

What is new author?

A new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.

Scrutinize new collaborator additions to packages because they now have the ability to publish code into your dependency tree. Packages should avoid frequent or unnecessary additions or changes to publishing rights.

What is shell access?

This module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.

Packages should avoid accessing the shell which can reduce portability, and make it easier for malicious shell access to be introduced.

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of package-name@version specifiers. e.g. @SocketSecurity ignore [email protected] bar@* or ignore all packages with @SocketSecurity ignore-all

@codecov
Copy link

codecov bot commented Oct 20, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (3c1a617) 84.32% compared to head (8739152) 84.32%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #418   +/-   ##
=======================================
  Coverage   84.32%   84.32%           
=======================================
  Files         168      168           
  Lines        3240     3240           
  Branches      915      915           
=======================================
  Hits         2732     2732           
  Misses        508      508           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@andreahaku andreahaku marked this pull request as ready for review October 25, 2023 10:13
@andreahaku andreahaku requested a review from a team as a code owner October 25, 2023 10:13
@andreahaku andreahaku changed the title Socket.io server code to typescript Socket.io server code to TS and adds unit testing Oct 25, 2023
Copy link
Collaborator

@abretonc7s abretonc7s left a comment

Choose a reason for hiding this comment

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

LGTM

@andreahaku andreahaku added the Need QA Any New Features that needs a full manual QA prior to being added to a release. label Oct 27, 2023
@andreahaku andreahaku merged commit dc7e024 into main Oct 30, 2023
24 of 25 checks passed
@andreahaku andreahaku deleted the feature/socketio_code_typescript branch October 30, 2023 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Need QA Any New Features that needs a full manual QA prior to being added to a release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants