goma 0.0.1.beta → 0.0.1.gamma
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/Gemfile.lock +9 -1
- data/README.md +18 -15
- data/goma.gemspec +16 -0
- data/lib/generators/goma/erb/templates/confirmation/new.html.erb +2 -2
- data/lib/generators/goma/erb/templates/password/new.html.erb +2 -2
- data/lib/generators/goma/erb/templates/session/new.html.erb +3 -3
- data/lib/generators/goma/erb/templates/unlock/new.html.erb +2 -2
- data/lib/generators/goma/helpers/helpers.rb +5 -0
- data/lib/generators/goma/install/templates/goma.rb +38 -22
- data/lib/generators/goma/mailer/erb/templates/activation_needed_email.html.erb +1 -1
- data/lib/generators/goma/mailer/erb/templates/activation_needed_email.text.erb +1 -1
- data/lib/generators/goma/mailer/erb/templates/email_confirmation_needed_email.html.erb +1 -1
- data/lib/generators/goma/mailer/erb/templates/email_confirmation_needed_email.text.erb +1 -1
- data/lib/generators/goma/mailer/templates/mailer.rb +1 -1
- data/lib/generators/goma/model/active_record_generator.rb +11 -0
- data/lib/generators/goma/model/oauth/active_record_generator.rb +10 -1
- data/lib/generators/goma/model/oauth/templates/model.rb +5 -0
- data/lib/generators/goma/resource_route/resource_route_generator.rb +10 -12
- data/lib/generators/goma/scaffold_controller/templates/confirmation_controller.rb +5 -5
- data/lib/generators/goma/scaffold_controller/templates/oauth_controller.rb +1 -1
- data/lib/generators/goma/scaffold_controller/templates/password_controller.rb +2 -2
- data/lib/generators/goma/scaffold_controller/templates/session_controller.rb +2 -2
- data/lib/generators/goma/scaffold_controller/templates/unlock_controller.rb +1 -1
- data/lib/generators/goma/scaffold_controller/templates/user_controller.rb +6 -1
- data/lib/goma/config.rb +16 -19
- data/lib/goma/models/confirmable.rb +1 -1
- data/lib/goma/models/rememberable.rb +2 -2
- data/lib/goma/railtie.rb +0 -9
- data/lib/goma/version.rb +1 -1
- data/test/controllers/confirmations_controller_test.rb +14 -0
- data/test/controllers/lockable_controller_test.rb +8 -8
- data/test/controllers/sessions_controller_test.rb +8 -8
- data/test/controllers/users_controller_test.rb +2 -13
- data/test/fabricators/users_fabricator.rb +2 -2
- data/test/integration/{authenticatable_test.rb → authenticatable_integration_test.rb} +4 -4
- data/test/integration/omniauthable_integration_test.rb +26 -0
- data/test/integration/{rememberable_test.rb → rememberable_integration_test.rb} +7 -7
- data/test/integration/{routes_test.rb → routes_integration_test.rb} +8 -8
- data/test/integration/{timeoutable_test.rb → timeoutable_integration_test.rb} +3 -3
- data/test/integration/{trackable_test.rb → trackable_integration_test.rb} +3 -3
- data/test/models/confirmable_test.rb +1 -1
- data/test/models/validatable_test.rb +7 -7
- data/test/rails_app/app/assets/javascripts/{sessions.js → confirmations.js} +0 -0
- data/test/rails_app/app/assets/stylesheets/authentications.css +4 -0
- data/test/rails_app/app/assets/stylesheets/confirmations.css +4 -0
- data/test/rails_app/app/assets/stylesheets/passwords.css +4 -0
- data/test/rails_app/app/assets/stylesheets/unlocks.css +4 -0
- data/test/rails_app/app/controllers/authentications_controller.rb +15 -0
- data/test/rails_app/app/controllers/confirmations_controller.rb +52 -0
- data/test/rails_app/app/controllers/passwords_controller.rb +41 -0
- data/test/rails_app/app/controllers/sessions_controller.rb +13 -5
- data/test/rails_app/app/controllers/unlocks_controller.rb +32 -0
- data/test/rails_app/app/controllers/users_controller.rb +32 -15
- data/test/rails_app/app/helpers/authentications_helper.rb +2 -0
- data/test/rails_app/app/helpers/confirmations_helper.rb +2 -0
- data/test/rails_app/app/helpers/passwords_helper.rb +2 -0
- data/test/rails_app/app/helpers/unlocks_helper.rb +2 -0
- data/test/rails_app/app/mailers/user_mailer.rb +33 -20
- data/test/rails_app/app/views/confirmations/new.html.erb +12 -0
- data/test/rails_app/app/views/passwords/edit.html.erb +27 -0
- data/test/rails_app/app/views/passwords/new.html.erb +11 -0
- data/test/rails_app/app/views/sessions/new.html.erb +13 -5
- data/test/rails_app/app/views/unlocks/new.html.erb +11 -0
- data/test/rails_app/app/views/user_mailer/activation_needed_email.text.erb +5 -2
- data/test/rails_app/app/views/user_mailer/activation_success_email.text.erb +7 -2
- data/test/rails_app/app/views/user_mailer/email_confirmation_needed_email.text.erb +5 -2
- data/test/rails_app/app/views/user_mailer/email_confirmation_success_email.text.erb +4 -2
- data/test/rails_app/app/views/user_mailer/reset_password_email.text.erb +10 -0
- data/test/rails_app/app/views/user_mailer/unlock_token_email.text.erb +10 -0
- data/test/rails_app/app/views/users/_form.html.erb +33 -0
- data/test/rails_app/app/views/users/edit.html.erb +6 -2
- data/test/rails_app/app/views/users/index.html.erb +25 -2
- data/test/rails_app/app/views/users/new.html.erb +5 -2
- data/test/rails_app/app/views/users/show.html.erb +4 -2
- data/test/rails_app/config/environments/test.rb +2 -0
- data/test/rails_app/config/initializers/goma.rb +43 -29
- data/test/rails_app/config/initializers/omniauth.rb +4 -0
- data/test/rails_app/config/routes.rb +20 -5
- data/test/rails_app/db/migrate/20140512081308_create_users.rb +44 -0
- data/test/rails_app/db/migrate/{20140326043644_create_authentications.rb → 20140512081309_create_authentications.rb} +1 -0
- data/test/rails_app/db/schema.rb +9 -5
- data/test/test_helper.rb +10 -0
- metadata +72 -24
- data/test/rails_app/app/views/user_mailer/unlock_email.text.erb +0 -0
- data/test/rails_app/db/migrate/20131205013904_goma_create_users.rb +0 -46
@@ -1,29 +1,39 @@
|
|
1
1
|
Goma.configure do |config|
|
2
|
-
config.default_mailer_name = 'UserMailer'
|
2
|
+
# config.default_mailer_name = 'UserMailer'
|
3
3
|
config.mailer_sender = 'please-change-me-at-config-initializers-goma@example.com'
|
4
|
-
config.authentication_keys = [ :username, :email ]
|
5
|
-
# config.email_regexp = /\A[^@]+@[^@]+\z/
|
6
|
-
# config.password_length = 6..128
|
7
|
-
# config.case_insensitive_keys = [ :email ]
|
8
|
-
# config.strip_whitespace_keys = [ :email ]
|
9
4
|
# config.clean_up_csrf_token_on_authentication = true
|
10
|
-
config.secret_key = '
|
11
|
-
# config.encryptor = :bcrypt
|
12
|
-
config.stretches = Rails.env.test? ? 1 : 10
|
13
|
-
# config.pepper = '50d0f3afd793f67bb0a3cee4de47f4f147e7d096aa05f5d9571c0db5d39c85e6d4efb182937fb2d490a6d07f0e46fc007ed703f42f8037f88f60b8086198df5b'
|
5
|
+
config.secret_key = '35b9065416e971821b077ccb9466a98f3f3ef063e259bd48edf6e64bcb13cbebb19279678019ae62ca84e66b5b8214770750a1efa7f9a0cf4a0475a3283e8cfa'
|
14
6
|
# config.serialization_method = :goma
|
15
7
|
# config.scopes = [:user]
|
16
8
|
# config.default_scope = :user
|
17
|
-
|
9
|
+
#
|
10
|
+
# Select modules you need. All modules are included by default.
|
11
|
+
config.modules = [:password_authenticatable, :validatable, :confirmable, :rememberable, :timeoutable, :lockable, :recoverable, :trackable, :omniauthable]
|
12
|
+
# config.save_return_to_url = true
|
13
|
+
# config.not_authenticated_action = :not_authenticated
|
14
|
+
|
18
15
|
|
16
|
+
####################################################
|
17
|
+
# Password authenticatable
|
18
|
+
config.authentication_keys = [ :username, :email ]
|
19
|
+
# config.case_insensitive_keys = [ :email ]
|
20
|
+
# config.strip_whitespace_keys = [ :email ]
|
21
|
+
# config.encryptor = :bcrypt
|
22
|
+
# config.pepper = 'd7565a3070d7b7852de524f4c7b1159c8b58290e5427db80c4714f75da044a8f4af1e20d30c8af74cd21b90b3b9956b529bb805f95fac0ecda199e6ef5b62fac'
|
23
|
+
config.stretches = Rails.env.test? ? 1 : 10
|
19
24
|
# config.email_attribute_name = :email
|
20
25
|
# config.password_attribute_name = :password
|
21
26
|
# config.encrypted_password_attribute_name = :encrypted_password
|
22
27
|
|
28
|
+
####################################################
|
29
|
+
# Validatable
|
30
|
+
# config.password_length = 8..128
|
31
|
+
# config.email_regexp = /\A[^@]+@[^@]+\z/
|
32
|
+
|
23
33
|
####################################################
|
24
34
|
# Confirmable
|
25
|
-
# config.
|
26
|
-
# config.
|
35
|
+
# config.activation_mailer_name = nil
|
36
|
+
# config.email_confirmation_mailer_name = nil
|
27
37
|
# config.confirmation_keys = [ :email ]
|
28
38
|
# config.allow_unconfirmed_access_for = 0
|
29
39
|
# config.activate_within = 3.days
|
@@ -45,54 +55,58 @@ Goma.configure do |config|
|
|
45
55
|
# config.remember_for = 2.weeks
|
46
56
|
# config.extend_remember_period = false
|
47
57
|
# config.rememberable_options = {}
|
58
|
+
# config.remember_token_attribute_name = nil
|
59
|
+
# config.remember_created_at_attribute_name = :remember_created_at
|
48
60
|
|
49
61
|
|
50
62
|
####################################################
|
51
63
|
# Timeoutable
|
52
64
|
# config.timeout_in = 30.minutes
|
53
|
-
# config.
|
65
|
+
# config.logout_all_scopes = false
|
54
66
|
# config.validate_session_even_in_not_login_area = true
|
55
67
|
|
56
68
|
####################################################
|
57
69
|
# Lockable
|
58
|
-
# config.
|
70
|
+
# config.unlock_token_mailer_name = nil
|
71
|
+
# config.unlock_token_email_method_name = :unlock_email
|
59
72
|
# config.lock_strategy = :failed_attempts
|
60
73
|
# config.unlock_keys = [ :email ]
|
61
74
|
# config.unlock_strategies = [ :email, :time ]
|
62
75
|
# config.maximum_attempts = 20
|
76
|
+
# config.failed_attempts_attribute_name = :failed_attempts
|
77
|
+
# config.locked_at_attribute_name = :locked_at
|
63
78
|
# config.unlock_in = 1.hour
|
64
|
-
# config.last_attempt_warning = false
|
79
|
+
# config.last_attempt_warning = false # TODO not yet implemented
|
65
80
|
# config.unlock_token_attribute_name = :unlock_token
|
66
81
|
# config.unlock_token_sent_at_attribute_name = :unlock_token_sent_at
|
67
82
|
# config.unlock_token_to_send_attribute_name = :raw_unlock_token
|
68
83
|
|
69
84
|
####################################################
|
70
85
|
# Recoverable
|
71
|
-
# config.
|
86
|
+
# config.reset_password_mailer_name = nil
|
87
|
+
# config.reset_password_email_method_name = :reset_password_email
|
72
88
|
# config.reset_password_keys = [ :email ]
|
73
89
|
# config.reset_password_within = 6.hours
|
74
90
|
# config.reset_password_token_attribute_name = :reset_password_token
|
75
91
|
# config.reset_password_token_sent_at_attribute_name = :reset_password_token_sent_at
|
76
92
|
# config.reset_password_token_to_send_attribute_name = :raw_reset_password_token
|
77
93
|
|
94
|
+
####################################################
|
95
|
+
# Trackable
|
96
|
+
# config.login_count_attribute_name = :login_count
|
97
|
+
# config.current_login_at_attribute_name = :current_login_at
|
98
|
+
# config.last_login_at_attribute_name = :last_login_at
|
99
|
+
# config.current_login_ip_attribute_name = :current_login_ip
|
100
|
+
# config.last_login_ip_attribute_name = :last_login_ip
|
101
|
+
|
78
102
|
####################################################
|
79
103
|
# Omniauthable
|
80
|
-
#
|
81
|
-
# ex.)
|
82
|
-
config.omniauth :developer if Rails.env.in? ['development', 'test']
|
83
|
-
# config.omniauth :twitter, 'APP_ID', 'APP_SECRET'
|
84
|
-
#
|
85
|
-
config.oauth_authentication_class_name = 'Authentication'
|
104
|
+
# config.oauth_authentication_class_name = 'Authentication'
|
86
105
|
# config.oauth_provider_attribute_name = :provider
|
87
106
|
# config.oauth_uid_attribute_name = :uid
|
88
|
-
|
89
|
-
|
90
|
-
####################################################
|
91
|
-
# Attribute names settings
|
92
|
-
# config.salt_attribute_name = nil
|
93
|
-
# config.salt_join_token = ''
|
94
107
|
end
|
95
108
|
|
96
109
|
# Scope specific configuration
|
97
110
|
# Goma.configure_for(:user) do |config|
|
111
|
+
# -- scope specifig configurations goes here --
|
98
112
|
# end
|
@@ -1,13 +1,28 @@
|
|
1
1
|
RailsApp::Application.routes.draw do
|
2
|
-
|
2
|
+
resources :authentications, only: [:create]
|
3
|
+
get '/auth/:provider/callback', to: 'authentications#create'
|
4
|
+
|
5
|
+
resources :unlocks, only: [:show, :new, :create]
|
6
|
+
|
7
|
+
resources :passwords, only: [:new, :create, :edit, :update]
|
3
8
|
|
4
|
-
resources :
|
5
|
-
member
|
6
|
-
get 'activate'
|
7
|
-
end
|
9
|
+
resources :confirmations, only: [:show, :new, :create] do
|
10
|
+
get :email, on: :member
|
8
11
|
end
|
9
12
|
|
10
13
|
resource :session, only: [:new, :create, :destroy]
|
14
|
+
|
15
|
+
resources :users
|
16
|
+
|
17
|
+
resources :unlocks, only: [:show, :new, :create,]
|
18
|
+
|
19
|
+
resources :confirmations, only: [:new, :create] do
|
20
|
+
get :activate, on: :member
|
21
|
+
get :confirm, on: :member
|
22
|
+
end
|
23
|
+
|
24
|
+
root to: 'home#index'
|
25
|
+
|
11
26
|
get 'login' => 'sessions#new', as: :login
|
12
27
|
delete 'logout' => 'sessions#destroy', as: :logout
|
13
28
|
|
@@ -0,0 +1,44 @@
|
|
1
|
+
class CreateUsers < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :users do |t|
|
4
|
+
|
5
|
+
# Password authenticatable
|
6
|
+
t.string :username
|
7
|
+
t.string :email
|
8
|
+
t.string :encrypted_password
|
9
|
+
|
10
|
+
# Confirmable
|
11
|
+
t.string :unconfirmed_email
|
12
|
+
t.string :confirmation_token
|
13
|
+
t.datetime :confirmation_token_sent_at
|
14
|
+
t.string :activated_at
|
15
|
+
|
16
|
+
# Rememberable
|
17
|
+
t.datetime :remember_created_at
|
18
|
+
|
19
|
+
# Lockable
|
20
|
+
t.integer :failed_attempts, default: 0, null: false
|
21
|
+
t.datetime :locked_at
|
22
|
+
t.string :unlock_token
|
23
|
+
t.datetime :unlock_token_sent_at
|
24
|
+
|
25
|
+
# Recoverable
|
26
|
+
t.string :reset_password_token
|
27
|
+
t.datetime :reset_password_token_sent_at
|
28
|
+
|
29
|
+
# Trackable
|
30
|
+
t.integer :login_count, default: 0, null: false
|
31
|
+
t.datetime :current_login_at
|
32
|
+
t.datetime :last_login_at
|
33
|
+
t.string :current_login_ip
|
34
|
+
t.string :last_login_ip
|
35
|
+
|
36
|
+
t.timestamps
|
37
|
+
end
|
38
|
+
add_index :users, :username, unique: true
|
39
|
+
add_index :users, :email, unique: true
|
40
|
+
add_index :users, :confirmation_token, unique: true
|
41
|
+
add_index :users, :unlock_token, unique: true
|
42
|
+
add_index :users, :reset_password_token, unique: true
|
43
|
+
end
|
44
|
+
end
|
data/test/rails_app/db/schema.rb
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
#
|
12
12
|
# It's strongly recommended that you check this file into your version control system.
|
13
13
|
|
14
|
-
ActiveRecord::Schema.define(version:
|
14
|
+
ActiveRecord::Schema.define(version: 20140512081309) do
|
15
15
|
|
16
16
|
create_table "authentications", force: true do |t|
|
17
17
|
t.string "provider"
|
@@ -21,6 +21,7 @@ ActiveRecord::Schema.define(version: 20140326043644) do
|
|
21
21
|
t.datetime "updated_at"
|
22
22
|
end
|
23
23
|
|
24
|
+
add_index "authentications", ["provider", "uid"], name: "index_authentications_on_provider_and_uid", unique: true
|
24
25
|
add_index "authentications", ["user_id"], name: "index_authentications_on_user_id"
|
25
26
|
|
26
27
|
create_table "users", force: true do |t|
|
@@ -30,14 +31,15 @@ ActiveRecord::Schema.define(version: 20140326043644) do
|
|
30
31
|
t.string "unconfirmed_email"
|
31
32
|
t.string "confirmation_token"
|
32
33
|
t.datetime "confirmation_token_sent_at"
|
33
|
-
t.
|
34
|
-
t.string "remember_token"
|
34
|
+
t.string "activated_at"
|
35
35
|
t.datetime "remember_created_at"
|
36
|
-
t.integer "failed_attempts",
|
36
|
+
t.integer "failed_attempts", default: 0, null: false
|
37
37
|
t.datetime "locked_at"
|
38
38
|
t.string "unlock_token"
|
39
39
|
t.datetime "unlock_token_sent_at"
|
40
|
-
t.
|
40
|
+
t.string "reset_password_token"
|
41
|
+
t.datetime "reset_password_token_sent_at"
|
42
|
+
t.integer "login_count", default: 0, null: false
|
41
43
|
t.datetime "current_login_at"
|
42
44
|
t.datetime "last_login_at"
|
43
45
|
t.string "current_login_ip"
|
@@ -48,6 +50,8 @@ ActiveRecord::Schema.define(version: 20140326043644) do
|
|
48
50
|
|
49
51
|
add_index "users", ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true
|
50
52
|
add_index "users", ["email"], name: "index_users_on_email", unique: true
|
53
|
+
add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
|
51
54
|
add_index "users", ["unlock_token"], name: "index_users_on_unlock_token", unique: true
|
55
|
+
add_index "users", ["username"], name: "index_users_on_username", unique: true
|
52
56
|
|
53
57
|
end
|
data/test/test_helper.rb
CHANGED
@@ -61,4 +61,14 @@ class ActionDispatch::IntegrationTest
|
|
61
61
|
request.cookie_jar.signed['raw_cookie'] = raw_cookie
|
62
62
|
request.cookie_jar['raw_cookie']
|
63
63
|
end
|
64
|
+
|
65
|
+
def warden
|
66
|
+
request.env['warden']
|
67
|
+
end
|
68
|
+
|
69
|
+
def current_user
|
70
|
+
warden.user(scope: :user)
|
71
|
+
end
|
64
72
|
end
|
73
|
+
|
74
|
+
OmniAuth.config.test_mode = true
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: goma
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.1.
|
4
|
+
version: 0.0.1.gamma
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kentaro Imai
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -218,6 +218,7 @@ files:
|
|
218
218
|
- lib/generators/goma/model/model_generator.rb
|
219
219
|
- lib/generators/goma/model/oauth/active_record_generator.rb
|
220
220
|
- lib/generators/goma/model/oauth/oauth_generator.rb
|
221
|
+
- lib/generators/goma/model/oauth/templates/model.rb
|
221
222
|
- lib/generators/goma/model/templates/model.rb
|
222
223
|
- lib/generators/goma/resource_route/resource_route_generator.rb
|
223
224
|
- lib/generators/goma/scaffold/confirmation_generator.rb
|
@@ -266,17 +267,19 @@ files:
|
|
266
267
|
- lib/goma/warden.rb
|
267
268
|
- lib/tasks/goma_tasks.rake
|
268
269
|
- test/config_test.rb
|
270
|
+
- test/controllers/confirmations_controller_test.rb
|
269
271
|
- test/controllers/helpers_test.rb
|
270
272
|
- test/controllers/lockable_controller_test.rb
|
271
273
|
- test/controllers/sessions_controller_test.rb
|
272
274
|
- test/controllers/users_controller_test.rb
|
273
275
|
- test/fabricators/users_fabricator.rb
|
274
276
|
- test/goma_test.rb
|
275
|
-
- test/integration/
|
276
|
-
- test/integration/
|
277
|
-
- test/integration/
|
278
|
-
- test/integration/
|
279
|
-
- test/integration/
|
277
|
+
- test/integration/authenticatable_integration_test.rb
|
278
|
+
- test/integration/omniauthable_integration_test.rb
|
279
|
+
- test/integration/rememberable_integration_test.rb
|
280
|
+
- test/integration/routes_integration_test.rb
|
281
|
+
- test/integration/timeoutable_integration_test.rb
|
282
|
+
- test/integration/trackable_integration_test.rb
|
280
283
|
- test/models/authenticatable_test.rb
|
281
284
|
- test/models/confirmable_test.rb
|
282
285
|
- test/models/omniauthable_test.rb
|
@@ -287,26 +290,38 @@ files:
|
|
287
290
|
- test/rails_app/Rakefile
|
288
291
|
- test/rails_app/app/assets/images/.keep
|
289
292
|
- test/rails_app/app/assets/javascripts/application.js
|
293
|
+
- test/rails_app/app/assets/javascripts/confirmations.js
|
290
294
|
- test/rails_app/app/assets/javascripts/home.js
|
291
295
|
- test/rails_app/app/assets/javascripts/secret.js
|
292
|
-
- test/rails_app/app/assets/javascripts/sessions.js
|
293
296
|
- test/rails_app/app/assets/javascripts/users.js
|
294
297
|
- test/rails_app/app/assets/stylesheets/application.css
|
298
|
+
- test/rails_app/app/assets/stylesheets/authentications.css
|
299
|
+
- test/rails_app/app/assets/stylesheets/confirmations.css
|
295
300
|
- test/rails_app/app/assets/stylesheets/home.css
|
301
|
+
- test/rails_app/app/assets/stylesheets/passwords.css
|
296
302
|
- test/rails_app/app/assets/stylesheets/scaffold.css
|
297
303
|
- test/rails_app/app/assets/stylesheets/secret.css
|
298
304
|
- test/rails_app/app/assets/stylesheets/sessions.css
|
305
|
+
- test/rails_app/app/assets/stylesheets/unlocks.css
|
299
306
|
- test/rails_app/app/assets/stylesheets/users.css
|
300
307
|
- test/rails_app/app/controllers/application_controller.rb
|
308
|
+
- test/rails_app/app/controllers/authentications_controller.rb
|
301
309
|
- test/rails_app/app/controllers/concerns/.keep
|
310
|
+
- test/rails_app/app/controllers/confirmations_controller.rb
|
302
311
|
- test/rails_app/app/controllers/home_controller.rb
|
312
|
+
- test/rails_app/app/controllers/passwords_controller.rb
|
303
313
|
- test/rails_app/app/controllers/secret_controller.rb
|
304
314
|
- test/rails_app/app/controllers/sessions_controller.rb
|
315
|
+
- test/rails_app/app/controllers/unlocks_controller.rb
|
305
316
|
- test/rails_app/app/controllers/users_controller.rb
|
306
317
|
- test/rails_app/app/helpers/application_helper.rb
|
318
|
+
- test/rails_app/app/helpers/authentications_helper.rb
|
319
|
+
- test/rails_app/app/helpers/confirmations_helper.rb
|
307
320
|
- test/rails_app/app/helpers/home_helper.rb
|
321
|
+
- test/rails_app/app/helpers/passwords_helper.rb
|
308
322
|
- test/rails_app/app/helpers/secret_helper.rb
|
309
323
|
- test/rails_app/app/helpers/sessions_helper.rb
|
324
|
+
- test/rails_app/app/helpers/unlocks_helper.rb
|
310
325
|
- test/rails_app/app/helpers/users_helper.rb
|
311
326
|
- test/rails_app/app/mailers/.keep
|
312
327
|
- test/rails_app/app/mailers/user_mailer.rb
|
@@ -314,14 +329,20 @@ files:
|
|
314
329
|
- test/rails_app/app/models/authentication.rb
|
315
330
|
- test/rails_app/app/models/concerns/.keep
|
316
331
|
- test/rails_app/app/models/user.rb
|
332
|
+
- test/rails_app/app/views/confirmations/new.html.erb
|
317
333
|
- test/rails_app/app/views/home/index.html.erb
|
318
334
|
- test/rails_app/app/views/layouts/application.html.erb
|
335
|
+
- test/rails_app/app/views/passwords/edit.html.erb
|
336
|
+
- test/rails_app/app/views/passwords/new.html.erb
|
319
337
|
- test/rails_app/app/views/sessions/new.html.erb
|
338
|
+
- test/rails_app/app/views/unlocks/new.html.erb
|
320
339
|
- test/rails_app/app/views/user_mailer/activation_needed_email.text.erb
|
321
340
|
- test/rails_app/app/views/user_mailer/activation_success_email.text.erb
|
322
341
|
- test/rails_app/app/views/user_mailer/email_confirmation_needed_email.text.erb
|
323
342
|
- test/rails_app/app/views/user_mailer/email_confirmation_success_email.text.erb
|
324
|
-
- test/rails_app/app/views/user_mailer/
|
343
|
+
- test/rails_app/app/views/user_mailer/reset_password_email.text.erb
|
344
|
+
- test/rails_app/app/views/user_mailer/unlock_token_email.text.erb
|
345
|
+
- test/rails_app/app/views/users/_form.html.erb
|
325
346
|
- test/rails_app/app/views/users/edit.html.erb
|
326
347
|
- test/rails_app/app/views/users/index.html.erb
|
327
348
|
- test/rails_app/app/views/users/new.html.erb
|
@@ -342,13 +363,14 @@ files:
|
|
342
363
|
- test/rails_app/config/initializers/goma.rb
|
343
364
|
- test/rails_app/config/initializers/inflections.rb
|
344
365
|
- test/rails_app/config/initializers/mime_types.rb
|
366
|
+
- test/rails_app/config/initializers/omniauth.rb
|
345
367
|
- test/rails_app/config/initializers/secret_token.rb
|
346
368
|
- test/rails_app/config/initializers/session_store.rb
|
347
369
|
- test/rails_app/config/initializers/wrap_parameters.rb
|
348
370
|
- test/rails_app/config/locales/en.yml
|
349
371
|
- test/rails_app/config/routes.rb
|
350
|
-
- test/rails_app/db/migrate/
|
351
|
-
- test/rails_app/db/migrate/
|
372
|
+
- test/rails_app/db/migrate/20140512081308_create_users.rb
|
373
|
+
- test/rails_app/db/migrate/20140512081309_create_authentications.rb
|
352
374
|
- test/rails_app/db/schema.rb
|
353
375
|
- test/rails_app/lib/assets/.keep
|
354
376
|
- test/rails_app/log/.keep
|
@@ -361,11 +383,16 @@ homepage: https://github.com/kentaroi/goma
|
|
361
383
|
licenses:
|
362
384
|
- MIT
|
363
385
|
metadata: {}
|
364
|
-
post_install_message: "\e[32mThank you for installing!\n\nYou can use this gem as
|
386
|
+
post_install_message: "\n\e[32mThank you for installing!\n\nYou can use this gem as
|
365
387
|
follows:\n\n\e[0mrails g goma:install\e[32m\n\nEdit config/initializers/goma.rb
|
366
|
-
to fit your needs.\n\n\e[0mrails g goma:scaffold User\e[32m\n\
|
367
|
-
|
368
|
-
|
388
|
+
to fit your needs.\n\n\e[0mrails g goma:scaffold User\e[32m\n\n\n===========================================================================\nSome
|
389
|
+
setup you must do manually if you heven't yet:\n\n- Ensure you have defined default
|
390
|
+
url options in your environments files.\n Here is an example of default_url_options
|
391
|
+
appropriate for a development\n environment in config/environments/development.rb\n\n
|
392
|
+
\ \e[0mconfig.action_mailer.default_url_options = { host: 'localhost:3000' }\e[32m\n\n
|
393
|
+
\ in production, :host should be set to the actual host of your application.\n\n===========================================================================\n\n\nThat's
|
394
|
+
it.\n\nThis gem is in early development phase and I do not recommend you to use
|
395
|
+
this for production for a while.\nBug reports and pull requests are welcome.\n\nEnjoy!\e[0m\n"
|
369
396
|
rdoc_options: []
|
370
397
|
require_paths:
|
371
398
|
- lib
|
@@ -387,17 +414,19 @@ specification_version: 4
|
|
387
414
|
summary: An authentication solution for Rails 4
|
388
415
|
test_files:
|
389
416
|
- test/config_test.rb
|
417
|
+
- test/controllers/confirmations_controller_test.rb
|
390
418
|
- test/controllers/helpers_test.rb
|
391
419
|
- test/controllers/lockable_controller_test.rb
|
392
420
|
- test/controllers/sessions_controller_test.rb
|
393
421
|
- test/controllers/users_controller_test.rb
|
394
422
|
- test/fabricators/users_fabricator.rb
|
395
423
|
- test/goma_test.rb
|
396
|
-
- test/integration/
|
397
|
-
- test/integration/
|
398
|
-
- test/integration/
|
399
|
-
- test/integration/
|
400
|
-
- test/integration/
|
424
|
+
- test/integration/authenticatable_integration_test.rb
|
425
|
+
- test/integration/omniauthable_integration_test.rb
|
426
|
+
- test/integration/rememberable_integration_test.rb
|
427
|
+
- test/integration/routes_integration_test.rb
|
428
|
+
- test/integration/timeoutable_integration_test.rb
|
429
|
+
- test/integration/trackable_integration_test.rb
|
401
430
|
- test/models/authenticatable_test.rb
|
402
431
|
- test/models/confirmable_test.rb
|
403
432
|
- test/models/omniauthable_test.rb
|
@@ -408,26 +437,38 @@ test_files:
|
|
408
437
|
- test/rails_app/Rakefile
|
409
438
|
- test/rails_app/app/assets/images/.keep
|
410
439
|
- test/rails_app/app/assets/javascripts/application.js
|
440
|
+
- test/rails_app/app/assets/javascripts/confirmations.js
|
411
441
|
- test/rails_app/app/assets/javascripts/home.js
|
412
442
|
- test/rails_app/app/assets/javascripts/secret.js
|
413
|
-
- test/rails_app/app/assets/javascripts/sessions.js
|
414
443
|
- test/rails_app/app/assets/javascripts/users.js
|
415
444
|
- test/rails_app/app/assets/stylesheets/application.css
|
445
|
+
- test/rails_app/app/assets/stylesheets/authentications.css
|
446
|
+
- test/rails_app/app/assets/stylesheets/confirmations.css
|
416
447
|
- test/rails_app/app/assets/stylesheets/home.css
|
448
|
+
- test/rails_app/app/assets/stylesheets/passwords.css
|
417
449
|
- test/rails_app/app/assets/stylesheets/scaffold.css
|
418
450
|
- test/rails_app/app/assets/stylesheets/secret.css
|
419
451
|
- test/rails_app/app/assets/stylesheets/sessions.css
|
452
|
+
- test/rails_app/app/assets/stylesheets/unlocks.css
|
420
453
|
- test/rails_app/app/assets/stylesheets/users.css
|
421
454
|
- test/rails_app/app/controllers/application_controller.rb
|
455
|
+
- test/rails_app/app/controllers/authentications_controller.rb
|
422
456
|
- test/rails_app/app/controllers/concerns/.keep
|
457
|
+
- test/rails_app/app/controllers/confirmations_controller.rb
|
423
458
|
- test/rails_app/app/controllers/home_controller.rb
|
459
|
+
- test/rails_app/app/controllers/passwords_controller.rb
|
424
460
|
- test/rails_app/app/controllers/secret_controller.rb
|
425
461
|
- test/rails_app/app/controllers/sessions_controller.rb
|
462
|
+
- test/rails_app/app/controllers/unlocks_controller.rb
|
426
463
|
- test/rails_app/app/controllers/users_controller.rb
|
427
464
|
- test/rails_app/app/helpers/application_helper.rb
|
465
|
+
- test/rails_app/app/helpers/authentications_helper.rb
|
466
|
+
- test/rails_app/app/helpers/confirmations_helper.rb
|
428
467
|
- test/rails_app/app/helpers/home_helper.rb
|
468
|
+
- test/rails_app/app/helpers/passwords_helper.rb
|
429
469
|
- test/rails_app/app/helpers/secret_helper.rb
|
430
470
|
- test/rails_app/app/helpers/sessions_helper.rb
|
471
|
+
- test/rails_app/app/helpers/unlocks_helper.rb
|
431
472
|
- test/rails_app/app/helpers/users_helper.rb
|
432
473
|
- test/rails_app/app/mailers/.keep
|
433
474
|
- test/rails_app/app/mailers/user_mailer.rb
|
@@ -435,14 +476,20 @@ test_files:
|
|
435
476
|
- test/rails_app/app/models/authentication.rb
|
436
477
|
- test/rails_app/app/models/concerns/.keep
|
437
478
|
- test/rails_app/app/models/user.rb
|
479
|
+
- test/rails_app/app/views/confirmations/new.html.erb
|
438
480
|
- test/rails_app/app/views/home/index.html.erb
|
439
481
|
- test/rails_app/app/views/layouts/application.html.erb
|
482
|
+
- test/rails_app/app/views/passwords/edit.html.erb
|
483
|
+
- test/rails_app/app/views/passwords/new.html.erb
|
440
484
|
- test/rails_app/app/views/sessions/new.html.erb
|
485
|
+
- test/rails_app/app/views/unlocks/new.html.erb
|
441
486
|
- test/rails_app/app/views/user_mailer/activation_needed_email.text.erb
|
442
487
|
- test/rails_app/app/views/user_mailer/activation_success_email.text.erb
|
443
488
|
- test/rails_app/app/views/user_mailer/email_confirmation_needed_email.text.erb
|
444
489
|
- test/rails_app/app/views/user_mailer/email_confirmation_success_email.text.erb
|
445
|
-
- test/rails_app/app/views/user_mailer/
|
490
|
+
- test/rails_app/app/views/user_mailer/reset_password_email.text.erb
|
491
|
+
- test/rails_app/app/views/user_mailer/unlock_token_email.text.erb
|
492
|
+
- test/rails_app/app/views/users/_form.html.erb
|
446
493
|
- test/rails_app/app/views/users/edit.html.erb
|
447
494
|
- test/rails_app/app/views/users/index.html.erb
|
448
495
|
- test/rails_app/app/views/users/new.html.erb
|
@@ -463,13 +510,14 @@ test_files:
|
|
463
510
|
- test/rails_app/config/initializers/goma.rb
|
464
511
|
- test/rails_app/config/initializers/inflections.rb
|
465
512
|
- test/rails_app/config/initializers/mime_types.rb
|
513
|
+
- test/rails_app/config/initializers/omniauth.rb
|
466
514
|
- test/rails_app/config/initializers/secret_token.rb
|
467
515
|
- test/rails_app/config/initializers/session_store.rb
|
468
516
|
- test/rails_app/config/initializers/wrap_parameters.rb
|
469
517
|
- test/rails_app/config/locales/en.yml
|
470
518
|
- test/rails_app/config/routes.rb
|
471
|
-
- test/rails_app/db/migrate/
|
472
|
-
- test/rails_app/db/migrate/
|
519
|
+
- test/rails_app/db/migrate/20140512081308_create_users.rb
|
520
|
+
- test/rails_app/db/migrate/20140512081309_create_authentications.rb
|
473
521
|
- test/rails_app/db/schema.rb
|
474
522
|
- test/rails_app/lib/assets/.keep
|
475
523
|
- test/rails_app/log/.keep
|
File without changes
|
@@ -1,46 +0,0 @@
|
|
1
|
-
class GomaCreateUsers < ActiveRecord::Migration
|
2
|
-
def change
|
3
|
-
create_table(:users) do |t|
|
4
|
-
## Password authenticatable
|
5
|
-
t.string :username
|
6
|
-
t.string :email
|
7
|
-
t.string :encrypted_password
|
8
|
-
|
9
|
-
## Confirmable
|
10
|
-
t.string :unconfirmed_email
|
11
|
-
t.string :confirmation_token
|
12
|
-
t.datetime :confirmation_token_sent_at
|
13
|
-
t.datetime :activated_at
|
14
|
-
# config.email_confirmed_at_attribute_name is not defined.
|
15
|
-
|
16
|
-
|
17
|
-
## Rememberable
|
18
|
-
t.string :remember_token
|
19
|
-
t.datetime :remember_created_at
|
20
|
-
|
21
|
-
## Lockable
|
22
|
-
t.integer :failed_attempts, default: 0, null: false
|
23
|
-
t.datetime :locked_at
|
24
|
-
t.string :unlock_token
|
25
|
-
t.datetime :unlock_token_sent_at
|
26
|
-
|
27
|
-
## Recoverable
|
28
|
-
# t.string :reset_password_token
|
29
|
-
# t.datetime :reset_password_token_sent_at
|
30
|
-
|
31
|
-
## Trackable
|
32
|
-
t.integer :login_count, default: 0, null: false
|
33
|
-
t.datetime :current_login_at
|
34
|
-
t.datetime :last_login_at
|
35
|
-
t.string :current_login_ip
|
36
|
-
t.string :last_login_ip
|
37
|
-
|
38
|
-
|
39
|
-
t.timestamps
|
40
|
-
end
|
41
|
-
|
42
|
-
add_index :users, :email, unique: true
|
43
|
-
add_index :users, :confirmation_token, unique: true
|
44
|
-
add_index :users, :unlock_token, unique: true
|
45
|
-
end
|
46
|
-
end
|