rails-auth-with-devise — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited rails-auth-with-devise (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Devise is the most popular authentication solution for Rails, providing a complete MVC solution with 10 modular components.
# Add to Gemfile
bundle add devise
# Install Devise
rails generate devise:install
# Generate User model with authentication
rails generate devise User
# Run migrations
rails db:migrateAfter devise:install, configure in config/environments/development.rb:
config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }Set root route in config/routes.rb:
root to: 'home#index'Enable modules in the model (e.g., app/models/user.rb):
| Module | Purpose | Migration Columns |
|---|---|---|
:database_authenticatable | Password hashing/storage | email, encrypted_password |
:registerable | Sign up, edit, destroy account | - |
:recoverable | Password reset via email | reset_password_token, reset_password_sent_at |
:rememberable | "Remember me" cookie | remember_created_at |
:trackable | Sign in stats | sign_in_count, current_sign_in_at, last_sign_in_at, current_sign_in_ip, last_sign_in_ip |
:validatable | Email/password validations | - |
:confirmable | Email confirmation | confirmation_token, confirmed_at, confirmation_sent_at, unconfirmed_email |
:lockable | Lock after failed attempts | failed_attempts, unlock_token, locked_at |
:timeoutable | Session expiration | - |
:omniauthable | OAuth provider support | - |
# Require authentication
before_action :authenticate_user!
# Check if signed in
user_signed_in?
# Get current user
current_user
# Access session
user_sessionFor other models (e.g., Admin):
before_action :authenticate_admin!
admin_signed_in?
current_admin
admin_sessionrails g migration AddUsernameToUsers username:string:uniq
rails db:migrateApplicationController:class ApplicationController < ActionController::Base
before_action :configure_permitted_parameters, if: :devise_controller?
protected
def configure_permitted_parameters
devise_parameter_sanitizer.permit(:sign_up, keys: [:username])
devise_parameter_sanitizer.permit(:account_update, keys: [:username])
end
end# Generate all views
rails generate devise:views
# Scoped views for specific model
rails generate devise:views users
# Specific modules only
rails generate devise:views -v registrations confirmations# Generate controllers
rails generate devise:controllers users
# Or specific controller
rails generate devise:controllers users -c sessions registrationsUpdate routes:
devise_for :users, controllers: {
sessions: 'users/sessions',
registrations: 'users/registrations'
}In ApplicationController:
def after_sign_in_path_for(resource)
stored_location_for(resource) || dashboard_path
end
def after_sign_out_path_for(resource_or_scope)
root_path
endIn config/initializers/devise.rb:
Devise.setup do |config|
config.responder.error_status = :unprocessable_entity
config.responder.redirect_status = :see_other
endEnsure responders gem version >= 3.1.0.
In spec/support/devise.rb:
RSpec.configure do |config|
config.include Devise::Test::ControllerHelpers, type: :controller
config.include Devise::Test::ControllerHelpers, type: :view
config.include Devise::Test::IntegrationHelpers, type: :feature
config.include Devise::Test::IntegrationHelpers, type: :request
endUsage:
sign_in user
sign_out userclass ActionDispatch::IntegrationTest
include Devise::Test::IntegrationHelpers
end~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.