
Security News
Astral Launches pyx: A Python-Native Package Registry
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
h1. MerbAuth - Merb Merb::Authentication
h2. An extensible architecture for authentication
h2. Principles
h2. What is it
The merb-auth gem is the default implementation of merb-auth-core and merb-auth-more for the default Merb Stack. Included are:
merb-auth-slice-password # A basic slice that provides login and logout functionality
Strategies: :default_password_form # Form based login via a "login" field and "password" field :default_basic_auth # Basic authentication
Mixins: redirect_back # For redirect_back_or functionality salted_user # Automtaically provides the required methods on your user model
h3. Get merb-auth
merb-auth is bundled with the merb gem. To get it as stand alone you can get it two ways.
Gem Style @sudo gem install merb-auth@
From Source
git clone http://github.com/wycats/merb.git
cd merb/merb-auth
sudo rake install
h2. Basic Setup
h3. Application Setup (Stack)
When you generate your application with @merb-gen app my_app@ your almost ready to go.
You'll need something to protect @merb-gen resource foos@
You'll need to make your database: @rake db:automigrate@
Also you need a user
$ merb -i
>> u = User.new(:login => "homer")
>> u.password = u.password_confirmation = "sekrit"
>> u.save
No you should setup authentication for the things you want to protect:
# config/router.rb
authenticate do
resources :foos
end
You can protect your controller at an action level also
# app/controllers/foos.rb
before :ensure_authenticated
Fire It Up!
@merb@
h3. Customize your setup
In the Merb.root/merb/merb-auth directory there are a couple of files that are generated for you by the stack generator. These are @setup.rb@ and @strategies.rb@
By default these setup merb-auth to work with the default stack. To customize it, modify these two files to get the results you want. Serialize in and out of the session, change the user model for use with the default strategies.
You can of course not use the default strategies and declare your own, or mix and match them.
Configure your routes in the config/router.rb file.
FAQs
Unknown package
We found that merb-auth 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
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.