Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Gem for Rails application - provides you list of online users (for authentication gem 'devise') for ActiveRecord ou Mongoid.
Add this line to your application's Gemfile:
gem 'onlineable'
And then execute:
$ bundle install
Next you have to run this to make it install the initializer
$ rails g onlineable:install
*Note: if you are doing this on a Heroku server run the following command:
$ heroku run rails g onlineable:install
Do not do a run:detached as it prompts you and you will have to manually terminate the process if you run:detached.
For using functionality add to ApplicationControler:
before_action { |c| current_usuario.track_online unless current_usuario.nil?}
This will make the app consider the online user while they interact with the application.
and In your template, add: onlineable-by-todd for the current device line at the end, and if you want to change the time (in seconds or minutes) that a user is considered online add below: time seconds: n or time minutes: n, the default is seconds: 30.
class User < ActiveRecord::Base
devise ..., :onlineable
time seconds:30 #or
time minutes:2
end
Helper for online users list (for the whole list, not just an individual):
Model.who_online, e.g. User.who_online, Admin.who_online
To see if a user is online you would run something like this:
User.who_online.include?(user)
Now you can override the default time to check for user activity. It defaults to 15 seconds (i.e. if the user hasn't done anything for 15 seconds they are not considered online). To override this with say 30 seconds you would do the following:
User.who_online(30).include?(user)
I have also modified the code to work more easily with RedisToGo on Heroku. It now works with RedisToGo on Heroku, it needed the password to be parsed, now it is.
Redis; this gem will make sure the dependencies get installed but you have to make sure you have it on your server, for Heroku I recommend RedisToGo.
Devise;
FAQs
Unknown package
We found that onlineable demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.