Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
An authentication ticket store designed to allow using an express app to do auth for a socket.io app
A ticket store designed to allow an application to use an express app to do auth for a socket.io app. compatible with Express 4
npm install scalper
authenticate
- Function that checks if current request is authenticated. It is passed the request object, and should return the value that will be stored in the ticket. (default checks req.user._id
and req.user.id
)genTicket
- Function that returns the ticket. (default uses the node-uuid
v4
method)route
- String that represents the GET route that will serve tickets. (default is '/socket-ticket')store
- an instance of a ticket store. (default is a memory-store instance)Note: The default memory store should not be used in production.
A store should expose a get
and a set
method.
set
should take three arguments. A key, a value, and a callback. The store implementation should ensure the uniqueness of tickets
get
should take two arguments. A key and a callback.
Important get
should delete the ticket as soon as its retrieved, so that tickets can not be used twice.
Look at redis-ticket for an example implementation with mongodb.
There are many advantages for token based authentication when using websockets. Heroku docs have a nice article outlining some of the details of securing websockets. authO.com has a blog post that also goes over the details of token based auth with socket.io
FAQs
An authentication ticket store designed to allow using an express app to do auth for a socket.io app
The npm package scalper receives a total of 5 weekly downloads. As such, scalper popularity was classified as not popular.
We found that scalper demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.