
Security News
Free Certified Patch for Critical Rails Active Storage Vulnerability
Socket has released a free Certified Patch for a critical Rails Active Storage vulnerability, giving developers time to upgrade to a secure Rails version.
semaphore-map
Advanced tools
An easy way to lock on a dynamic set of keys without having to worry about resource management. If the list of named locks is fixed then a simple Map could be used and each semaphore could be created on demand. If the list of locks is dynamic, possibly by userId, then you might want to cleanup unused locks to avoid running out of memory.
Here is an example where you might want to restrict the amount of parallel requests for each user down to 1. Imagine that there are thousands or millions of users in the system, so leaving the locks in memory is not feasible.
// Initialize the map of locks
var SemaphoreMap = require('semaphore-map');
var userLocks = new SemaphoreMap();
// For each request from a user
var userId = <some-user-id-lookup>
userLocks.take(userId, function() {
// Do some work for the user
userLocks.leave(userId);
});
The semaphore-map project will take care of cleaning up unused locks even if a wide range of users perform actions against the server.
FAQs
A map of semaphores for easy tracking many semaphores by key
We found that semaphore-map 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.

Security News
Socket has released a free Certified Patch for a critical Rails Active Storage vulnerability, giving developers time to upgrade to a secure Rails version.

Security News
/Threat Research
A malicious Ruby gem runs a credential-stealing worm during installation, poisons AI coding tools, and can wipe files when a stolen GitHub token is revoked.

Security News
GitHub is tightening GitHub Actions security with new restrictions on privileged pull request workflows. Here's what changes and how maintainers are affected.