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.
Ruby Library to send notification on android via Firebase Cloud Messaging API (V1)
This library is based on Firebase Cloud Messaging API (V1) to send notification on android devices.
Version 0.1.6 requires at least Ruby 3.0.0, This library dependents on googleauth, redis, json and http gem.
Install the gem and add to the application's Gemfile by executing:
$ gem 'snm-fcm', '~> 0.1.5'
If bundler is not being used to manage dependencies, install the gem by executing:
$ gem install snm-fcm
Create an initializer file for ex rails-project/config/initializers/snm_fcm.rb
Snm::Fcm::Notification.configure do |config|
config.credentails_file_path = 'path/to/my-fcm-e65a9915e042.json'
config.redis_endpoint = 'redis://localhost:6379/1'
end
Snm::Fcm::Notification.setup
msg_data = {
'message'=> {
'token'=> 'android-device-fcm-token',
'notification'=>
{
'title'=> 'Lorem ipsum',
'body'=> 'Lorem ipsum dolor sit amet, consectetur adipiscing elit',
'image'=> 'https://www.snmmaurya.com/images/me.jpg'
},
'data'=> {
'key1'=> 'value1',
'key2'=> 'value2'
}
}
}
respoonse = Snm::Fcm::Notification.deliver(msg_data)
# Success response:
{"name"=>"projects/my-fcm/messages/0:1715935676674045%f570bc3bf570bc3b"}
Go to the project click on settings icon next to Project Overview top left cornor.
3.1 in the general tab you will find 'project id' copy this id and put somewhere in your system.
3.2 Click on Cloud Messging tab -
3.3 In side Firebase Cloud Messaging API (V1) panel.
3.4 Click on Manage Service Accounts On the next page a service already be there click on the name of that serive name for ex 'firebase-adminsdk-4apop@my-fcm.iam.gserviceaccount.com'
3.5 Click on advanced settings - choose 'keys' tab.
3.6 Now create a new key type json download it (automatically downloaded) put this file somewhere in your system. this file is your my-fcm-e65a9915e042.json
Bug reports and pull requests are welcome on GitHub at https://github.com/snmmaurya/snm-fcm. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.
The gem is available as open source under the terms of the MIT License.
Everyone interacting in the Snm::Fcm project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.
FAQs
Unknown package
We found that snm-fcm demonstrated a healthy version release cadence and project activity because the last version was released less than 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.