double_auth_engine 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +7 -0
- data/.rvmrc +1 -0
- data/Gemfile +9 -0
- data/Gemfile.lock +136 -0
- data/MIT-LICENSE +20 -0
- data/README.md +59 -0
- data/Rakefile +25 -0
- data/app/controllers/password_resets_controller.rb +3 -0
- data/app/controllers/user_sessions_controller.rb +3 -0
- data/app/controllers/users_controller.rb +3 -0
- data/app/mailers/notifier.rb +8 -0
- data/app/models/assignment.rb +3 -0
- data/app/models/role.rb +3 -0
- data/app/models/user.rb +3 -0
- data/app/models/user_session.rb +3 -0
- data/app/views/notifier/password_reset_instructions.text.erb +8 -0
- data/app/views/password_resets/edit.html.erb +5 -0
- data/app/views/password_resets/new.html.erb +5 -0
- data/app/views/user_sessions/new.html.erb +17 -0
- data/app/views/users/edit.html.erb +0 -0
- data/app/views/users/index.html.erb +0 -0
- data/app/views/users/new.html.erb +20 -0
- data/app/views/users/show.html.erb +2 -0
- data/config/routes.rb +11 -0
- data/double_auth_engine.gemspec +26 -0
- data/lib/double_auth_engine/controllers/application_controller_mixin.rb +42 -0
- data/lib/double_auth_engine/controllers/password_resets_controller_mixin.rb +49 -0
- data/lib/double_auth_engine/controllers/user_sessions_controller_mixin.rb +34 -0
- data/lib/double_auth_engine/controllers/users_controller_mixin.rb +63 -0
- data/lib/double_auth_engine/generators/double_auth_engine/install_generator.rb +48 -0
- data/lib/double_auth_engine/generators/double_auth_engine/templates/assignment_migration.rb +13 -0
- data/lib/double_auth_engine/generators/double_auth_engine/templates/authorization_rules.rb +19 -0
- data/lib/double_auth_engine/generators/double_auth_engine/templates/role_migration.rb +12 -0
- data/lib/double_auth_engine/generators/double_auth_engine/templates/setup_mail_initializer.rb +7 -0
- data/lib/double_auth_engine/generators/double_auth_engine/templates/user_migration.rb +28 -0
- data/lib/double_auth_engine/models/assignment_mixin.rb +10 -0
- data/lib/double_auth_engine/models/role_mixin.rb +10 -0
- data/lib/double_auth_engine/models/user_mixin.rb +38 -0
- data/lib/double_auth_engine/models/user_session_mixin.rb +15 -0
- data/lib/double_auth_engine/tasks/migrate_seed.rake +9 -0
- data/lib/double_auth_engine/version.rb +3 -0
- data/lib/double_auth_engine.rb +15 -0
- data/lib/engine.rb +23 -0
- data/spec/double_auth_engine_spec.rb +7 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/controllers/application_controller.rb +4 -0
- data/spec/dummy/app/controllers/dashboard_controller.rb +3 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/views/dashboard/index.html.erb +0 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/config/application.rb +48 -0
- data/spec/dummy/config/authorization_rules.rb +20 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/database.yml +22 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +29 -0
- data/spec/dummy/config/environments/production.rb +52 -0
- data/spec/dummy/config/environments/test.rb +35 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/inflections.rb +10 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/initializers/setup_mail.rb +9 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/routes.rb +3 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/db/migrate/20110408030355_create_users.rb +28 -0
- data/spec/dummy/db/migrate/20110408030356_create_roles.rb +12 -0
- data/spec/dummy/db/migrate/20110408030357_create_assignments.rb +13 -0
- data/spec/dummy/db/schema.rb +51 -0
- data/spec/dummy/db/seeds.rb +3 -0
- data/spec/dummy/lib/development_mail_interceptor.rb +6 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +26 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/public/javascripts/application.js +2 -0
- data/spec/dummy/public/javascripts/controls.js +965 -0
- data/spec/dummy/public/javascripts/dragdrop.js +974 -0
- data/spec/dummy/public/javascripts/effects.js +1123 -0
- data/spec/dummy/public/javascripts/prototype.js +6001 -0
- data/spec/dummy/public/javascripts/rails.js +175 -0
- data/spec/dummy/public/stylesheets/.gitkeep +0 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/dummy/spec/authorizations/user_spec.rb +104 -0
- data/spec/dummy/spec/controllers/user_sessions_controller_spec.rb +48 -0
- data/spec/dummy/spec/controllers/users_controller_spec.rb +125 -0
- data/spec/dummy/spec/models/user_spec.rb +65 -0
- data/spec/integration/navigation_spec.rb +9 -0
- data/spec/spec_helper.rb +42 -0
- data/spec/support/user_authentication.rb +14 -0
- data/spec/support/user_authorization.rb +17 -0
- metadata +218 -0
@@ -0,0 +1,51 @@
|
|
1
|
+
# This file is auto-generated from the current state of the database. Instead
|
2
|
+
# of editing this file, please use the migrations feature of Active Record to
|
3
|
+
# incrementally modify your database, and then regenerate this schema definition.
|
4
|
+
#
|
5
|
+
# Note that this schema.rb definition is the authoritative source for your
|
6
|
+
# database schema. If you need to create the application database on another
|
7
|
+
# system, you should be using db:schema:load, not running all the migrations
|
8
|
+
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
9
|
+
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
10
|
+
#
|
11
|
+
# It's strongly recommended to check this file into your version control system.
|
12
|
+
|
13
|
+
ActiveRecord::Schema.define(:version => 20110408030357) do
|
14
|
+
|
15
|
+
create_table "assignments", :force => true do |t|
|
16
|
+
t.integer "user_id"
|
17
|
+
t.integer "role_id"
|
18
|
+
t.datetime "created_at"
|
19
|
+
t.datetime "updated_at"
|
20
|
+
end
|
21
|
+
|
22
|
+
create_table "roles", :force => true do |t|
|
23
|
+
t.string "name"
|
24
|
+
t.datetime "created_at"
|
25
|
+
t.datetime "updated_at"
|
26
|
+
end
|
27
|
+
|
28
|
+
create_table "users", :force => true do |t|
|
29
|
+
t.string "email", :null => false
|
30
|
+
t.string "name", :limit => 100, :null => false
|
31
|
+
t.string "location", :limit => 150
|
32
|
+
t.string "crypted_password", :null => false
|
33
|
+
t.string "password_salt", :null => false
|
34
|
+
t.string "persistence_token", :null => false
|
35
|
+
t.string "single_access_token", :null => false
|
36
|
+
t.string "perishable_token", :null => false
|
37
|
+
t.integer "login_count", :default => 0, :null => false
|
38
|
+
t.integer "failed_login_count", :default => 0, :null => false
|
39
|
+
t.datetime "last_request_at"
|
40
|
+
t.datetime "current_login_at"
|
41
|
+
t.datetime "last_login_at"
|
42
|
+
t.string "current_login_ip"
|
43
|
+
t.string "last_login_ip"
|
44
|
+
t.datetime "created_at"
|
45
|
+
t.datetime "updated_at"
|
46
|
+
end
|
47
|
+
|
48
|
+
add_index "users", ["email"], :name => "index_users_on_email", :unique => true
|
49
|
+
add_index "users", ["perishable_token"], :name => "index_users_on_perishable_token"
|
50
|
+
|
51
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The page you were looking for doesn't exist (404)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/404.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>The page you were looking for doesn't exist.</h1>
|
23
|
+
<p>You may have mistyped the address or the page may have moved.</p>
|
24
|
+
</div>
|
25
|
+
</body>
|
26
|
+
</html>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The change you wanted was rejected (422)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/422.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>The change you wanted was rejected.</h1>
|
23
|
+
<p>Maybe you tried to change something you didn't have access to.</p>
|
24
|
+
</div>
|
25
|
+
</body>
|
26
|
+
</html>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>We're sorry, but something went wrong (500)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/500.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>We're sorry, but something went wrong.</h1>
|
23
|
+
<p>We've been notified about this issue and we'll take a look at it shortly.</p>
|
24
|
+
</div>
|
25
|
+
</body>
|
26
|
+
</html>
|
File without changes
|