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.
merb-auth-slice-password
Advanced tools
MerbAuthSlicePassword ==================
A slice for the Merb framework that uses the merb-auth-core authentication framework. This slice provides a basic login and logout function. By default it also include the form based password logins and basic authentication.
To see how to customize it see the merb-auth-core
To use this slice setup some strategies and make sure you have everything required there. Usually a "User" model of some kind.
To overwrite the login form, you should just create a view file in app/views/exceptions/unauthenticated.html.erb in the host app.
By default the slice will load the password_form and the basic_auth strategies.
To prevent the slice from loading strategeis use:
MerbAutheSliceDefault[:no_default_strategies] = true
------------------------------------------------------------------------------ |-- LICENSE |-- README.textile |-- Rakefile |-- TODO |-- app | |-- controllers | | |-- application.rb | | |-- exceptions.rb | | `-- sessions.rb | |-- helpers | | `-- application_helper.rb | `-- views | |-- exceptions | | `-- unauthenticated.html.erb | `-- layout | `-- mauth_password_slice.html.erb |-- lib | |-- merb-auth-slice-password | | |-- merbtasks.rb | | |-- slicetasks.rb | | `-- spectasks.rb | `-- merb-auth-slice-password.rb |-- public | |-- javascripts | | `-- master.js | `-- stylesheets | `-- master.css |-- spec | |-- controllers | | `-- main_spec.rb | |-- mauth_password_slice_spec.rb | `-- spec_helper.rb `-- stubs `-- app `-- controllers |-- application.rb `-- main.rb
To see all available tasks for MerbAuthSlicePassword run:
rake -T slices:mauth_password_slice
Instructions for installation:
file: config/init.rb
dependency 'merb-auth-slice-password'
Merb::Plugins.config[:merb_slices] = { :queue => ["MerbAuthSlicePassword", ...] }
Set Merb::Plugin.config[:"merb-auth"][:login_param] Merb::Plugin.config[:"merb-auth"][:password_param]
These are used to setup the login and password fields and the labels that are shown. The defaults are shown
h3. Included Strategies
By default the password slice loads the :default_password_form strategy from merb-auth-more. If you don't want to use this you should set the MerbAutheSlicePassword[:no_default_strategies] = true
This will prevent it from loading any strategies.
file: config/router.rb
slice(:MerbAuthSlicePassword, :name_prefix => nil, :path_prefix => "auth", :default_routes => false )
Normally you should also run the following rake task:
rake slices:merb-auth-slice-password:install
You can put your application-level overrides in:
host-app/slices/merb-auth-slice-password/app - controllers, models, views ...
Templates are located in this order:
To customize the login form, create a view in your host-app
host-app/app/views/exceptions/unauthenticated.html.haml
The host-app's application layout is used by default
You can use the host application's layout by configuring the merb-auth-slice-password slice in a before_app_loads block:
You'll need to setup the Merb::Authentication::Manager#fetch_user and store_user methods for your given user model.
About Slices ============
Merb-Slices is a Merb plugin for using and creating application 'slices' which help you modularize your application. Usually these are reuseable extractions from your main app. In effect, a Slice is just like a regular Merb MVC application, both in functionality as well as in structure.
When you generate a Slice stub structure, a module is setup to serve as a namespace for your controller, models, helpers etc. This ensures maximum encapsulation. You could say a Slice is a mixture between a Merb plugin (a Gem) and a Merb application, reaping the benefits of both.
A host application can 'mount' a Slice inside the router, which means you have full over control how it integrates. By default a Slice's routes are prefixed by its name (a router :namespace), but you can easily provide your own prefix or leave it out, mounting it at the root of your url-schema. You can even mount a Slice multiple times and give extra parameters to customize an instance's behaviour.
A Slice's Application controller uses controller_for_slice to setup slice specific behaviour, which mainly affects cascaded view handling. Additionaly, this method is available to any kind of controller, so it can be used for Merb Mailer too for example.
There are many ways which let you customize a Slice's functionality and appearance without ever touching the Gem-level code itself. It's not only easy to add template/layout overrides, you can also add/modify controllers, models and other runtime code from within the host application.
To create your own Slice run this (somewhere outside of your merb app):
$ merb-gen slice
FAQs
Unknown package
We found that merb-auth-slice-password 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.