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.
alert-messages-for-hanami
Advanced tools
A helper to add alert messages (including flash ... aah! messages) to an Hanami application.
Add this line to your application's Gemfile:
gem 'alert-messages-for-hanami', '~> 0.1'
In your application.rb include
require 'alert-messages-for-hanami'
and then
# Configure the code that will yield each time Admin::Action is included
# This is useful for sharing common functionality
#
# See: http://www.rubydoc.info/gems/hanami-controller#Configuration
controller.prepare do
# include MyAuthentication # included in all the actions
# before :authenticate! # run an authentication before callback
include CabezaDeTermo::AlertMessages::Behaviour
end
To add a message to show in the current page, do
module Web::Controllers::Login
class Create
include Web::Action
def call(params)
alert_messages[:info] << 'You know nothing, John Snow'
end
end
end
To add a message to show in next request or redirect, first enable sessions in your application and then you can do
module Web::Controllers::Login
class Create
def call(params)
alert_messages.flash_at(:info) << 'Flash! aah ... king of the immmmpossible'
end
end
end
In your template do something like
- alert_messages[:success].each do |success_message|
.alert.alert-success role="alert"
= success_message
- alert_messages[:info].each do |info_message|
.alert.alert-info role="alert"
= info_message
- alert_messages[:warnings].each do |warning_message|
.alert.alert-warning role="alert"
= warning_message
- alert_messages[:errors].each do |error_message|
.alert.alert-danger role="alert"
= error_message
Bug reports and pull requests are welcome on GitHub at https://github.com/cabeza-de-termo/alert-messages.
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that alert-messages-for-hanami 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
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.