devise_oam 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/MIT-LICENSE +20 -0
- data/README.md +67 -0
- data/Rakefile +38 -0
- data/lib/devise_oam/authenticatable_entity.rb +15 -0
- data/lib/devise_oam/strategies/header_authenticatable.rb +50 -0
- data/lib/devise_oam/version.rb +3 -0
- data/lib/devise_oam.rb +23 -0
- data/lib/tasks/devise_oam_tasks.rake +4 -0
- data/test/devise_oam_test.rb +96 -0
- data/test/dummy/README.rdoc +261 -0
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/assets/javascripts/application.js +15 -0
- data/test/dummy/app/assets/stylesheets/application.css +13 -0
- data/test/dummy/app/controllers/application_controller.rb +4 -0
- data/test/dummy/app/controllers/users_controller.rb +2 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/models/user.rb +35 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/app/views/users/index.html.erb +3 -0
- data/test/dummy/config/application.rb +56 -0
- data/test/dummy/config/boot.rb +10 -0
- data/test/dummy/config/database.yml +16 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +37 -0
- data/test/dummy/config/environments/production.rb +67 -0
- data/test/dummy/config/environments/test.rb +37 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/devise.rb +229 -0
- data/test/dummy/config/initializers/devise_oam.rb +5 -0
- data/test/dummy/config/initializers/inflections.rb +15 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +7 -0
- data/test/dummy/config/initializers/session_store.rb +8 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/devise.en.yml +57 -0
- data/test/dummy/config/locales/en.yml +5 -0
- data/test/dummy/config/routes.rb +63 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/db/migrate/20120514070218_devise_create_users.rb +49 -0
- data/test/dummy/db/migrate/20120521064519_add_roles_mask_to_users.rb +5 -0
- data/test/dummy/db/schema.rb +35 -0
- data/test/dummy/log/test.log +65 -0
- data/test/dummy/public/404.html +26 -0
- data/test/dummy/public/422.html +26 -0
- data/test/dummy/public/500.html +25 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/script/rails +6 -0
- data/test/dummy/test/fixtures/users.yml +11 -0
- data/test/dummy/test/unit/user_test.rb +7 -0
- data/test/support/helpers.rb +19 -0
- data/test/test_helper.rb +18 -0
- metadata +194 -0
@@ -0,0 +1,63 @@
|
|
1
|
+
Dummy::Application.routes.draw do
|
2
|
+
devise_for :users
|
3
|
+
resources :users
|
4
|
+
|
5
|
+
root :to => 'users#index'
|
6
|
+
|
7
|
+
# The priority is based upon order of creation:
|
8
|
+
# first created -> highest priority.
|
9
|
+
|
10
|
+
# Sample of regular route:
|
11
|
+
# match 'products/:id' => 'catalog#view'
|
12
|
+
# Keep in mind you can assign values other than :controller and :action
|
13
|
+
|
14
|
+
# Sample of named route:
|
15
|
+
# match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
|
16
|
+
# This route can be invoked with purchase_url(:id => product.id)
|
17
|
+
|
18
|
+
# Sample resource route (maps HTTP verbs to controller actions automatically):
|
19
|
+
# resources :products
|
20
|
+
|
21
|
+
# Sample resource route with options:
|
22
|
+
# resources :products do
|
23
|
+
# member do
|
24
|
+
# get 'short'
|
25
|
+
# post 'toggle'
|
26
|
+
# end
|
27
|
+
#
|
28
|
+
# collection do
|
29
|
+
# get 'sold'
|
30
|
+
# end
|
31
|
+
# end
|
32
|
+
|
33
|
+
# Sample resource route with sub-resources:
|
34
|
+
# resources :products do
|
35
|
+
# resources :comments, :sales
|
36
|
+
# resource :seller
|
37
|
+
# end
|
38
|
+
|
39
|
+
# Sample resource route with more complex sub-resources
|
40
|
+
# resources :products do
|
41
|
+
# resources :comments
|
42
|
+
# resources :sales do
|
43
|
+
# get 'recent', :on => :collection
|
44
|
+
# end
|
45
|
+
# end
|
46
|
+
|
47
|
+
# Sample resource route within a namespace:
|
48
|
+
# namespace :admin do
|
49
|
+
# # Directs /admin/products/* to Admin::ProductsController
|
50
|
+
# # (app/controllers/admin/products_controller.rb)
|
51
|
+
# resources :products
|
52
|
+
# end
|
53
|
+
|
54
|
+
# You can have the root of your site routed with "root"
|
55
|
+
# just remember to delete public/index.html.
|
56
|
+
# root :to => 'welcome#index'
|
57
|
+
|
58
|
+
# See how all your routes lay out with "rake routes"
|
59
|
+
|
60
|
+
# This is a legacy wild controller route that's not recommended for RESTful applications.
|
61
|
+
# Note: This route will make all actions in every controller accessible via GET requests.
|
62
|
+
# match ':controller(/:action(/:id))(.:format)'
|
63
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
class DeviseCreateUsers < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table(:users) do |t|
|
4
|
+
## Database authenticatable
|
5
|
+
t.string :email, :null => false, :default => ""
|
6
|
+
t.string :encrypted_password, :null => false, :default => ""
|
7
|
+
|
8
|
+
## Recoverable
|
9
|
+
t.string :reset_password_token
|
10
|
+
t.datetime :reset_password_sent_at
|
11
|
+
|
12
|
+
## Rememberable
|
13
|
+
t.datetime :remember_created_at
|
14
|
+
|
15
|
+
## Trackable
|
16
|
+
t.integer :sign_in_count, :default => 0
|
17
|
+
t.datetime :current_sign_in_at
|
18
|
+
t.datetime :last_sign_in_at
|
19
|
+
t.string :current_sign_in_ip
|
20
|
+
t.string :last_sign_in_ip
|
21
|
+
|
22
|
+
## Encryptable
|
23
|
+
# t.string :password_salt
|
24
|
+
|
25
|
+
## Confirmable
|
26
|
+
# t.string :confirmation_token
|
27
|
+
# t.datetime :confirmed_at
|
28
|
+
# t.datetime :confirmation_sent_at
|
29
|
+
# t.string :unconfirmed_email # Only if using reconfirmable
|
30
|
+
|
31
|
+
## Lockable
|
32
|
+
# t.integer :failed_attempts, :default => 0 # Only if lock strategy is :failed_attempts
|
33
|
+
# t.string :unlock_token # Only if unlock strategy is :email or :both
|
34
|
+
# t.datetime :locked_at
|
35
|
+
|
36
|
+
## Token authenticatable
|
37
|
+
# t.string :authentication_token
|
38
|
+
|
39
|
+
|
40
|
+
t.timestamps
|
41
|
+
end
|
42
|
+
|
43
|
+
add_index :users, :email, :unique => true
|
44
|
+
add_index :users, :reset_password_token, :unique => true
|
45
|
+
# add_index :users, :confirmation_token, :unique => true
|
46
|
+
# add_index :users, :unlock_token, :unique => true
|
47
|
+
# add_index :users, :authentication_token, :unique => true
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
# This file is auto-generated from the current state of the database. Instead
|
3
|
+
# of editing this file, please use the migrations feature of Active Record to
|
4
|
+
# incrementally modify your database, and then regenerate this schema definition.
|
5
|
+
#
|
6
|
+
# Note that this schema.rb definition is the authoritative source for your
|
7
|
+
# database schema. If you need to create the application database on another
|
8
|
+
# system, you should be using db:schema:load, not running all the migrations
|
9
|
+
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
10
|
+
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
11
|
+
#
|
12
|
+
# It's strongly recommended to check this file into your version control system.
|
13
|
+
|
14
|
+
ActiveRecord::Schema.define(:version => 20120521064519) do
|
15
|
+
|
16
|
+
create_table "users", :force => true do |t|
|
17
|
+
t.string "email", :default => "", :null => false
|
18
|
+
t.string "encrypted_password", :default => "", :null => false
|
19
|
+
t.string "reset_password_token"
|
20
|
+
t.datetime "reset_password_sent_at"
|
21
|
+
t.datetime "remember_created_at"
|
22
|
+
t.integer "sign_in_count", :default => 0
|
23
|
+
t.datetime "current_sign_in_at"
|
24
|
+
t.datetime "last_sign_in_at"
|
25
|
+
t.string "current_sign_in_ip"
|
26
|
+
t.string "last_sign_in_ip"
|
27
|
+
t.datetime "created_at", :null => false
|
28
|
+
t.datetime "updated_at", :null => false
|
29
|
+
t.integer "roles_mask"
|
30
|
+
end
|
31
|
+
|
32
|
+
add_index "users", ["email"], :name => "index_users_on_email", :unique => true
|
33
|
+
add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true
|
34
|
+
|
35
|
+
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
Connecting to database specified by database.yml
|
2
|
+
[1m[36m (0.1ms)[0m [1mselect sqlite_version(*)[0m
|
3
|
+
[1m[35m (1.3ms)[0m CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
|
4
|
+
[1m[36m (0.0ms)[0m [1mPRAGMA index_list("schema_migrations")[0m
|
5
|
+
[1m[35m (0.1ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
6
|
+
[1m[36m (0.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
7
|
+
Migrating to DeviseCreateUsers (20120514070218)
|
8
|
+
[1m[35m (0.0ms)[0m begin transaction
|
9
|
+
[1m[36m (0.3ms)[0m [1mCREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar(255) DEFAULT '' NOT NULL, "encrypted_password" varchar(255) DEFAULT '' NOT NULL, "reset_password_token" varchar(255), "reset_password_sent_at" datetime, "remember_created_at" datetime, "sign_in_count" integer DEFAULT 0, "current_sign_in_at" datetime, "last_sign_in_at" datetime, "current_sign_in_ip" varchar(255), "last_sign_in_ip" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
10
|
+
[1m[35m (0.0ms)[0m PRAGMA index_list("users")
|
11
|
+
[1m[36m (0.1ms)[0m [1mCREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")[0m
|
12
|
+
[1m[35m (0.0ms)[0m PRAGMA index_list("users")
|
13
|
+
[1m[36m (0.0ms)[0m [1mPRAGMA index_info('index_users_on_email')[0m
|
14
|
+
[1m[35m (0.1ms)[0m CREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token")
|
15
|
+
[1m[36m (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ('20120514070218')[0m
|
16
|
+
[1m[35m (0.0ms)[0m commit transaction
|
17
|
+
Migrating to AddRolesMaskToUsers (20120521064519)
|
18
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
19
|
+
[1m[35m (0.2ms)[0m ALTER TABLE "users" ADD "roles_mask" integer
|
20
|
+
[1m[36m (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ('20120521064519')[0m
|
21
|
+
[1m[35m (0.0ms)[0m commit transaction
|
22
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
23
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
24
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
25
|
+
[1m[35m (0.6ms)[0m SAVEPOINT active_record_1
|
26
|
+
[1m[36mSQL (2.3ms)[0m [1mINSERT INTO "users" ("created_at", "current_sign_in_at", "current_sign_in_ip", "email", "encrypted_password", "last_sign_in_at", "last_sign_in_ip", "remember_created_at", "reset_password_sent_at", "reset_password_token", "roles_mask", "sign_in_count", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)[0m [["created_at", Sat, 09 Jun 2012 13:22:37 UTC +00:00], ["current_sign_in_at", nil], ["current_sign_in_ip", nil], ["email", "foo"], ["encrypted_password", ""], ["last_sign_in_at", nil], ["last_sign_in_ip", nil], ["remember_created_at", nil], ["reset_password_sent_at", nil], ["reset_password_token", nil], ["roles_mask", nil], ["sign_in_count", 0], ["updated_at", Sat, 09 Jun 2012 13:22:37 UTC +00:00]]
|
27
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
28
|
+
[1m[36mUser Load (0.2ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."email" = 'foo' LIMIT 1[0m
|
29
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
30
|
+
[1m[36m (0.1ms)[0m [1mUPDATE "users" SET "roles_mask" = 0, "updated_at" = '2012-06-09 13:22:37.549617' WHERE "users"."id" = 1[0m
|
31
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
32
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
33
|
+
[1m[35m (0.0ms)[0m begin transaction
|
34
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
35
|
+
[1m[35m (0.1ms)[0m begin transaction
|
36
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."email" = 'foo' LIMIT 1[0m
|
37
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
38
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "users" ("created_at", "current_sign_in_at", "current_sign_in_ip", "email", "encrypted_password", "last_sign_in_at", "last_sign_in_ip", "remember_created_at", "reset_password_sent_at", "reset_password_token", "roles_mask", "sign_in_count", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)[0m [["created_at", Sat, 09 Jun 2012 13:22:37 UTC +00:00], ["current_sign_in_at", nil], ["current_sign_in_ip", nil], ["email", "foo"], ["encrypted_password", ""], ["last_sign_in_at", nil], ["last_sign_in_ip", nil], ["remember_created_at", nil], ["reset_password_sent_at", nil], ["reset_password_token", nil], ["roles_mask", 0], ["sign_in_count", 0], ["updated_at", Sat, 09 Jun 2012 13:22:37 UTC +00:00]]
|
39
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
40
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
41
|
+
[1m[35m (0.0ms)[0m begin transaction
|
42
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."email" = 'foo' LIMIT 1[0m
|
43
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
44
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "users" ("created_at", "current_sign_in_at", "current_sign_in_ip", "email", "encrypted_password", "last_sign_in_at", "last_sign_in_ip", "remember_created_at", "reset_password_sent_at", "reset_password_token", "roles_mask", "sign_in_count", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)[0m [["created_at", Sat, 09 Jun 2012 13:22:37 UTC +00:00], ["current_sign_in_at", nil], ["current_sign_in_ip", nil], ["email", "foo"], ["encrypted_password", ""], ["last_sign_in_at", nil], ["last_sign_in_ip", nil], ["remember_created_at", nil], ["reset_password_sent_at", nil], ["reset_password_token", nil], ["roles_mask", 6], ["sign_in_count", 0], ["updated_at", Sat, 09 Jun 2012 13:22:37 UTC +00:00]]
|
45
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
46
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."email" = 'foo' LIMIT 1[0m
|
47
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
48
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
49
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
50
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
51
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
52
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
53
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
54
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
55
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
56
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
57
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
58
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "users" ("created_at", "current_sign_in_at", "current_sign_in_ip", "email", "encrypted_password", "last_sign_in_at", "last_sign_in_ip", "remember_created_at", "reset_password_sent_at", "reset_password_token", "roles_mask", "sign_in_count", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)[0m [["created_at", Sat, 09 Jun 2012 13:22:37 UTC +00:00], ["current_sign_in_at", nil], ["current_sign_in_ip", nil], ["email", "foo"], ["encrypted_password", ""], ["last_sign_in_at", nil], ["last_sign_in_ip", nil], ["remember_created_at", nil], ["reset_password_sent_at", nil], ["reset_password_token", nil], ["roles_mask", 6], ["sign_in_count", 0], ["updated_at", Sat, 09 Jun 2012 13:22:37 UTC +00:00]]
|
59
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
60
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."email" = 'foo' LIMIT 1[0m
|
61
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
62
|
+
[1m[36m (0.1ms)[0m [1mUPDATE "users" SET "roles_mask" = 12, "updated_at" = '2012-06-09 13:22:37.560931' WHERE "users"."id" = 1[0m
|
63
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
64
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1[0m [["id", 1]]
|
65
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
@@ -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,25 @@
|
|
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
|
+
</div>
|
24
|
+
</body>
|
25
|
+
</html>
|
File without changes
|
@@ -0,0 +1,6 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
3
|
+
|
4
|
+
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
5
|
+
require File.expand_path('../../config/boot', __FILE__)
|
6
|
+
require 'rails/commands'
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
|
2
|
+
|
3
|
+
# This model initially had no columns defined. If you add columns to the
|
4
|
+
# model remove the '{}' from the fixture names and add the columns immediately
|
5
|
+
# below each fixture, per the syntax in the comments below
|
6
|
+
#
|
7
|
+
one: {}
|
8
|
+
# column: value
|
9
|
+
#
|
10
|
+
two: {}
|
11
|
+
# column: value
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module TestHelpers
|
2
|
+
def env_with_params(path = "/", params = {}, env = {})
|
3
|
+
method = params.delete(:method) || "GET"
|
4
|
+
env = { 'HTTP_VERSION' => '1.1', 'REQUEST_METHOD' => "#{method}" }.merge(env)
|
5
|
+
Rack::MockRequest.env_for("#{path}?#{Rack::Utils.build_query(params)}", env)
|
6
|
+
end
|
7
|
+
|
8
|
+
def set_default_settings
|
9
|
+
DeviseOam.setup do |config|
|
10
|
+
config.oam_header = "OAM_REMOTE_USER"
|
11
|
+
config.ldap_header = "ROLE_INFO"
|
12
|
+
config.user_class = "User"
|
13
|
+
config.user_login_field = "email"
|
14
|
+
config.create_user_if_not_found = false
|
15
|
+
config.create_user_method = "create_oam_user"
|
16
|
+
config.roles_setter = "update_roles"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# Configure Rails Environment
|
2
|
+
ENV["RAILS_ENV"] = "test"
|
3
|
+
|
4
|
+
require File.expand_path("../dummy/config/environment.rb", __FILE__)
|
5
|
+
require "rails/test_help"
|
6
|
+
|
7
|
+
Rails.backtrace_cleaner.remove_silencers!
|
8
|
+
|
9
|
+
# Load support files
|
10
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
11
|
+
|
12
|
+
# Load fixtures from the engine
|
13
|
+
if ActiveSupport::TestCase.method_defined?(:fixture_path=)
|
14
|
+
ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
|
15
|
+
end
|
16
|
+
|
17
|
+
# Run migrations
|
18
|
+
ActiveRecord::Migrator.migrate File.expand_path("../dummy/db/migrate/", __FILE__)
|
metadata
ADDED
@@ -0,0 +1,194 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: devise_oam
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Mikhail Topolskiy
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-07-06 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rails
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 3.1.0
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 3.1.0
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: devise
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '2.0'
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '2.0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: sqlite3
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
description: Authentication strategy for devise based on headers, passed by Oracle
|
63
|
+
Access Manager.
|
64
|
+
email:
|
65
|
+
- mikhail.topolskiy@gmail.com
|
66
|
+
executables: []
|
67
|
+
extensions: []
|
68
|
+
extra_rdoc_files: []
|
69
|
+
files:
|
70
|
+
- lib/devise_oam/authenticatable_entity.rb
|
71
|
+
- lib/devise_oam/strategies/header_authenticatable.rb
|
72
|
+
- lib/devise_oam/version.rb
|
73
|
+
- lib/devise_oam.rb
|
74
|
+
- lib/tasks/devise_oam_tasks.rake
|
75
|
+
- MIT-LICENSE
|
76
|
+
- Rakefile
|
77
|
+
- README.md
|
78
|
+
- test/devise_oam_test.rb
|
79
|
+
- test/dummy/app/assets/javascripts/application.js
|
80
|
+
- test/dummy/app/assets/stylesheets/application.css
|
81
|
+
- test/dummy/app/controllers/application_controller.rb
|
82
|
+
- test/dummy/app/controllers/users_controller.rb
|
83
|
+
- test/dummy/app/helpers/application_helper.rb
|
84
|
+
- test/dummy/app/models/user.rb
|
85
|
+
- test/dummy/app/views/layouts/application.html.erb
|
86
|
+
- test/dummy/app/views/users/index.html.erb
|
87
|
+
- test/dummy/config/application.rb
|
88
|
+
- test/dummy/config/boot.rb
|
89
|
+
- test/dummy/config/database.yml
|
90
|
+
- test/dummy/config/environment.rb
|
91
|
+
- test/dummy/config/environments/development.rb
|
92
|
+
- test/dummy/config/environments/production.rb
|
93
|
+
- test/dummy/config/environments/test.rb
|
94
|
+
- test/dummy/config/initializers/backtrace_silencers.rb
|
95
|
+
- test/dummy/config/initializers/devise.rb
|
96
|
+
- test/dummy/config/initializers/devise_oam.rb
|
97
|
+
- test/dummy/config/initializers/inflections.rb
|
98
|
+
- test/dummy/config/initializers/mime_types.rb
|
99
|
+
- test/dummy/config/initializers/secret_token.rb
|
100
|
+
- test/dummy/config/initializers/session_store.rb
|
101
|
+
- test/dummy/config/initializers/wrap_parameters.rb
|
102
|
+
- test/dummy/config/locales/devise.en.yml
|
103
|
+
- test/dummy/config/locales/en.yml
|
104
|
+
- test/dummy/config/routes.rb
|
105
|
+
- test/dummy/config.ru
|
106
|
+
- test/dummy/db/migrate/20120514070218_devise_create_users.rb
|
107
|
+
- test/dummy/db/migrate/20120521064519_add_roles_mask_to_users.rb
|
108
|
+
- test/dummy/db/schema.rb
|
109
|
+
- test/dummy/log/test.log
|
110
|
+
- test/dummy/public/404.html
|
111
|
+
- test/dummy/public/422.html
|
112
|
+
- test/dummy/public/500.html
|
113
|
+
- test/dummy/public/favicon.ico
|
114
|
+
- test/dummy/Rakefile
|
115
|
+
- test/dummy/README.rdoc
|
116
|
+
- test/dummy/script/rails
|
117
|
+
- test/dummy/test/fixtures/users.yml
|
118
|
+
- test/dummy/test/unit/user_test.rb
|
119
|
+
- test/support/helpers.rb
|
120
|
+
- test/test_helper.rb
|
121
|
+
homepage: https://github.com/whatthewhat/devise_oam
|
122
|
+
licenses: []
|
123
|
+
post_install_message:
|
124
|
+
rdoc_options: []
|
125
|
+
require_paths:
|
126
|
+
- lib
|
127
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
128
|
+
none: false
|
129
|
+
requirements:
|
130
|
+
- - ! '>='
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: '0'
|
133
|
+
segments:
|
134
|
+
- 0
|
135
|
+
hash: -265183574716958172
|
136
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
138
|
+
requirements:
|
139
|
+
- - ! '>='
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: '0'
|
142
|
+
segments:
|
143
|
+
- 0
|
144
|
+
hash: -265183574716958172
|
145
|
+
requirements: []
|
146
|
+
rubyforge_project:
|
147
|
+
rubygems_version: 1.8.24
|
148
|
+
signing_key:
|
149
|
+
specification_version: 3
|
150
|
+
summary: OAM authentication strategy for devise.
|
151
|
+
test_files:
|
152
|
+
- test/devise_oam_test.rb
|
153
|
+
- test/dummy/app/assets/javascripts/application.js
|
154
|
+
- test/dummy/app/assets/stylesheets/application.css
|
155
|
+
- test/dummy/app/controllers/application_controller.rb
|
156
|
+
- test/dummy/app/controllers/users_controller.rb
|
157
|
+
- test/dummy/app/helpers/application_helper.rb
|
158
|
+
- test/dummy/app/models/user.rb
|
159
|
+
- test/dummy/app/views/layouts/application.html.erb
|
160
|
+
- test/dummy/app/views/users/index.html.erb
|
161
|
+
- test/dummy/config/application.rb
|
162
|
+
- test/dummy/config/boot.rb
|
163
|
+
- test/dummy/config/database.yml
|
164
|
+
- test/dummy/config/environment.rb
|
165
|
+
- test/dummy/config/environments/development.rb
|
166
|
+
- test/dummy/config/environments/production.rb
|
167
|
+
- test/dummy/config/environments/test.rb
|
168
|
+
- test/dummy/config/initializers/backtrace_silencers.rb
|
169
|
+
- test/dummy/config/initializers/devise.rb
|
170
|
+
- test/dummy/config/initializers/devise_oam.rb
|
171
|
+
- test/dummy/config/initializers/inflections.rb
|
172
|
+
- test/dummy/config/initializers/mime_types.rb
|
173
|
+
- test/dummy/config/initializers/secret_token.rb
|
174
|
+
- test/dummy/config/initializers/session_store.rb
|
175
|
+
- test/dummy/config/initializers/wrap_parameters.rb
|
176
|
+
- test/dummy/config/locales/devise.en.yml
|
177
|
+
- test/dummy/config/locales/en.yml
|
178
|
+
- test/dummy/config/routes.rb
|
179
|
+
- test/dummy/config.ru
|
180
|
+
- test/dummy/db/migrate/20120514070218_devise_create_users.rb
|
181
|
+
- test/dummy/db/migrate/20120521064519_add_roles_mask_to_users.rb
|
182
|
+
- test/dummy/db/schema.rb
|
183
|
+
- test/dummy/log/test.log
|
184
|
+
- test/dummy/public/404.html
|
185
|
+
- test/dummy/public/422.html
|
186
|
+
- test/dummy/public/500.html
|
187
|
+
- test/dummy/public/favicon.ico
|
188
|
+
- test/dummy/Rakefile
|
189
|
+
- test/dummy/README.rdoc
|
190
|
+
- test/dummy/script/rails
|
191
|
+
- test/dummy/test/fixtures/users.yml
|
192
|
+
- test/dummy/test/unit/user_test.rb
|
193
|
+
- test/support/helpers.rb
|
194
|
+
- test/test_helper.rb
|