Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
In Gemfile
gem 'rails-i18nterface'
In routes.rb
mount RailsI18nterface::Engine => "/translate", :as => "translate_engine"
You may want to protect the translation engine to admin and create a constraint in your routes (note that you don't want to mount it when you launch tests):
constraints AdminConstraint.new do
unless Rails.env.test?
mount RailsI18nterface::Engine => "/translate", :as => "translate_engine"
end
end
# this second route will be then used if the user is not an admin
get 'translate' => redirect do |p, req|
req.flash['error'] = I18n.t('errors.permission_denied')
"/signin"
end
Then create a config/initializers/admin_constraint.rb
containing:
class AdminConstraint
def matches?(request)
current_user && current_user.is_admin?
end
end
(this example is for devise users, but you can adjust it to return true or false according to your own context).
You can configure from_locales
and to_locales
explicitly in your
environments/development.rb
by adding
config.from_locales = [:en]
config.to_locales = [:ja, :es, :fr]
Where [:en]
and [:ja, :es, :fr]
could be replaced by locale list of your choice.
The database is not used anymore, back to the good old way. So you can remove the table rails_i18nterface_translations (v0.1.7) or translations (< 0.1.7).
This is a fork of an overhaul of a fork of a fork of rails-translate.
It was originally created by Peter Marklund and Joakim Westerlund @ mynewsdesk and later adapted to rails 3.0 by Claudius Coenen. This version is a spin-off of Claudius Coenen's version by Larry Sprock. It was renamed, refactored and prepared for rails 3.1 as an Engine. Over this work Michal Hantl made a bunch of nice UI modifications on his fork. Since then it was more or less abandoned.
I took over the evolution with some new features:
Check the Changelog for details about further changes.
Copyright 2009-2011 Peter Marklund, Joakim Westerlund, Claudius Coenen
Copyright 2011-2013 Larry Sprock, Artin Boghosain, Michal Hantl
Copyright 2013-2016 Mose
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
Unknown package
We found that rails-i18nterface 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.