← All reportsPublic report

heartcombo/devise

Flexible authentication solution for Rails with Warden.

24k stars Ruby View on GitHubprofiled 11d ago
Try GitZoid
0PRs this week
0Contributors
0Deps scanned
0Issues found
01 · Repo overview

How devise is put together

Devise is a Ruby gem providing flexible, modular authentication for Rails applications, built on top of the Warden Rack middleware. It is implemented as a Rails engine exposing controllers (sessions, registrations, passwords, confirmations, unlocks, omniauth callbacks), mailers, views, routes, and model modules that host applications mix into their own models via `devise_for` route mappings. Each `devise_for` call creates a Devise::Mapping that wires a resource class to Warden strategies, controllers, and a FailureApp for failed authentication. Data flow: HTTP request -> Rails router (devise_for) -> Devise controller -> model module logic (e.g., DatabaseAuthenticatable password verification) -> Warden session management -> FailureApp redirect/recall on failure. The codebase supports both ActiveRecord and Mongoid ORMs and multiple Rails versions (7.0 through 8.x) via per-version Gemfiles.

Languages

RubyERB (HTML templates)

Frameworks

Rails (~> 8.1.0 in dev Gemfile; supports 7.0-8.x)Warden (Rack authentication middleware)OmniAuthRack

Datastores

SQLite3 (test)MongoDB via Mongoid ~9.0 (test, DEVISE_ORM=mongoid)

Infrastructure

.devcontainer/devcontainer.jsonbin/test runner script

Major components

Devise core (lib/devise.rb, models.rb, modules.rb)

Global configuration, module registry, mapping storage, and loading of the 10 pluggable model modules.

Mappings & routing (lib/devise/mapping.rb, lib/devise/rails/routes.rb)

Translates `devise_for` declarations into Mapping objects binding scopes to classes, controllers, paths, strategies, and the FailureApp.

Controllers (app/controllers/devise/*.rb)

Handle sign-in/out, registration, password reset, confirmation, unlock, and OmniAuth callback flows on top of the shared DeviseController base.

Model modules (lib/devise/models/*.rb)

Provide the 10 opt-in behaviors (database_authenticatable, confirmable, recoverable, registerable, rememberable, trackable, timeoutable, validatable, lockable, omniauthable) mixed into host application models.

Warden integration (lib/devise/strategies/, lib/devise/hooks/, lib/devise/rails/warden_compat.rb)

Implement Warden authentication strategies (database_authenticatable, rememberable) and after-authentication hooks (timeoutable, lockable, rememberable, csrf_cleaner, etc.).

FailureApp (lib/devise/failure_app.rb)

Rack endpoint invoked when Warden throws :warden, deciding between HTTP Basic 401, recall to a controller action, or redirect with flash messages and stored location.

Parameter sanitization & token generation (lib/devise/parameter_sanitizer.rb, lib/devise/token_generator.rb, lib/devise/encryptor.rb)

Filter permitted parameters per action, generate/digest time-limited tokens (confirmation/reset/unlock), and hash passwords (bcrypt-based Encryptor).

Generators & mailer/views (lib/generators/, app/mailers/devise/mailer.rb, app/views/devise/)

Install/model/controller/view generators for ActiveRecord and Mongoid, plus default ERB email and page templates.

02 · Weekly changes

No digest this week

1 weeksWeek of

03 · Security check

Dependencies and code review

0 dependencies scanned

Dependency advisories

Security Watch

No known advisories across 0 scanned dependencies.

No known advisories in the scanned dependencies.

Code review

No concrete code-level issues confirmed.

Get this report every week for your repos.

GitZoid learns each repo, reports what changed, and flags what needs attention. One flat price for the whole team.

$19 a month, flat · First 10 outputs free · No card required