sorcery 0.7.7 → 0.7.10
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/Gemfile.lock +20 -16
- data/README.rdoc +5 -5
- data/Rakefile +2 -0
- data/VERSION +1 -1
- data/lib/generators/sorcery/install_generator.rb +3 -3
- data/lib/generators/sorcery/templates/initializer.rb +20 -0
- data/lib/generators/sorcery/templates/migration/brute_force_protection.rb +2 -0
- data/lib/sorcery/controller.rb +1 -0
- data/lib/sorcery/model/adapters/mongoid.rb +2 -2
- data/lib/sorcery/model/submodules/brute_force_protection.rb +38 -9
- data/sorcery.gemspec +12 -128
- data/spec/Gemfile.lock +3 -1
- data/spec/README.md +8 -8
- data/spec/rails3/Gemfile.lock +3 -1
- data/spec/rails3/app/mailers/sorcery_mailer.rb +7 -0
- data/spec/rails3/app/views/sorcery_mailer/send_unlock_token_email.text.erb +1 -0
- data/spec/rails3/db/migrate/brute_force_protection/20101224223626_add_brute_force_protection_to_users.rb +2 -0
- data/spec/rails3/spec/controller_brute_force_protection_spec.rb +23 -1
- data/spec/rails3_mongo_mapper/Gemfile +1 -1
- data/spec/rails3_mongo_mapper/Gemfile.lock +4 -2
- data/spec/rails3_mongoid/Gemfile.lock +3 -1
- data/spec/rails3_mongoid/config/mongoid.yml +1 -1
- data/spec/rails3_mongoid/spec/controller_activity_logging_spec.rb +11 -11
- metadata +54 -160
data/Gemfile.lock
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
sorcery (0.7.
|
|
4
|
+
sorcery (0.7.8)
|
|
5
|
+
bcrypt-ruby (~> 3.0.0)
|
|
6
|
+
bundler (>= 1.1.0)
|
|
5
7
|
oauth (~> 0.4.4)
|
|
6
8
|
oauth2 (~> 0.5.1)
|
|
9
|
+
sorcery
|
|
7
10
|
|
|
8
11
|
GEM
|
|
9
12
|
remote: http://rubygems.org/
|
|
@@ -39,7 +42,7 @@ GEM
|
|
|
39
42
|
archive-tar-minitar (0.5.2)
|
|
40
43
|
arel (3.0.2)
|
|
41
44
|
bcrypt-ruby (3.0.1)
|
|
42
|
-
bson (1.6.
|
|
45
|
+
bson (1.6.1)
|
|
43
46
|
builder (3.0.0)
|
|
44
47
|
capybara (1.1.2)
|
|
45
48
|
mime-types (>= 1.16)
|
|
@@ -61,35 +64,36 @@ GEM
|
|
|
61
64
|
git (1.2.5)
|
|
62
65
|
hike (1.2.1)
|
|
63
66
|
i18n (0.6.0)
|
|
64
|
-
jeweler (1.
|
|
65
|
-
bundler (~> 1.0
|
|
67
|
+
jeweler (1.8.3)
|
|
68
|
+
bundler (~> 1.0)
|
|
66
69
|
git (>= 1.2.5)
|
|
67
70
|
rake
|
|
71
|
+
rdoc
|
|
68
72
|
journey (1.0.3)
|
|
69
|
-
json (1.6.
|
|
73
|
+
json (1.6.6)
|
|
70
74
|
linecache19 (0.5.12)
|
|
71
75
|
ruby_core_source (>= 0.1.4)
|
|
72
|
-
mail (2.4.
|
|
76
|
+
mail (2.4.4)
|
|
73
77
|
i18n (>= 0.4.0)
|
|
74
78
|
mime-types (~> 1.16)
|
|
75
79
|
treetop (~> 1.4.8)
|
|
76
|
-
mime-types (1.
|
|
77
|
-
mongo (1.6.
|
|
78
|
-
bson (
|
|
79
|
-
mongoid (2.4.
|
|
80
|
+
mime-types (1.18)
|
|
81
|
+
mongo (1.6.1)
|
|
82
|
+
bson (~> 1.6.1)
|
|
83
|
+
mongoid (2.4.7)
|
|
80
84
|
activemodel (~> 3.1)
|
|
81
85
|
mongo (~> 1.3)
|
|
82
86
|
tzinfo (~> 0.3.22)
|
|
83
|
-
multi_json (1.
|
|
87
|
+
multi_json (1.2.0)
|
|
84
88
|
multipart-post (1.1.5)
|
|
85
|
-
nokogiri (1.5.
|
|
89
|
+
nokogiri (1.5.2)
|
|
86
90
|
oauth (0.4.5)
|
|
87
91
|
oauth2 (0.5.2)
|
|
88
92
|
faraday (~> 0.7)
|
|
89
93
|
multi_json (~> 1.0)
|
|
90
94
|
polyglot (0.3.3)
|
|
91
95
|
rack (1.4.1)
|
|
92
|
-
rack-cache (1.
|
|
96
|
+
rack-cache (1.2)
|
|
93
97
|
rack (>= 0.4)
|
|
94
98
|
rack-ssl (1.3.2)
|
|
95
99
|
rack
|
|
@@ -159,7 +163,7 @@ GEM
|
|
|
159
163
|
treetop (1.4.10)
|
|
160
164
|
polyglot
|
|
161
165
|
polyglot (>= 0.3.1)
|
|
162
|
-
tzinfo (0.3.
|
|
166
|
+
tzinfo (0.3.32)
|
|
163
167
|
xpath (0.1.4)
|
|
164
168
|
nokogiri (~> 1.3)
|
|
165
169
|
yard (0.6.8)
|
|
@@ -169,9 +173,9 @@ PLATFORMS
|
|
|
169
173
|
|
|
170
174
|
DEPENDENCIES
|
|
171
175
|
bcrypt-ruby (~> 3.0.0)
|
|
172
|
-
bundler (
|
|
176
|
+
bundler (>= 1.1.0)
|
|
173
177
|
capybara (>= 1.1.2)
|
|
174
|
-
jeweler (~> 1.
|
|
178
|
+
jeweler (~> 1.8.3)
|
|
175
179
|
json (>= 1.5.1)
|
|
176
180
|
mongoid (~> 2.4.4)
|
|
177
181
|
rails (>= 3.0.0)
|
data/README.rdoc
CHANGED
|
@@ -29,7 +29,7 @@ Railscast: http://railscasts.com/episodes/283-authentication-with-sorcery
|
|
|
29
29
|
|
|
30
30
|
Example Rails 3 app using sorcery: https://github.com/NoamB/sorcery-example-app
|
|
31
31
|
|
|
32
|
-
Documentation: http://rubydoc.info/gems/sorcery/0.7.
|
|
32
|
+
Documentation: http://rubydoc.info/gems/sorcery/0.7.10/frames
|
|
33
33
|
|
|
34
34
|
Check out the tutorials in the github wiki!
|
|
35
35
|
|
|
@@ -83,15 +83,15 @@ Please see the tutorials in the github wiki for detailed usage information.
|
|
|
83
83
|
|
|
84
84
|
If using bundler, first add 'sorcery' to your Gemfile:
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
gem "sorcery"
|
|
87
87
|
|
|
88
88
|
And run
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
|
|
90
|
+
bundle install
|
|
91
91
|
|
|
92
92
|
Otherwise simply
|
|
93
93
|
|
|
94
|
-
|
|
94
|
+
gem install sorcery
|
|
95
95
|
|
|
96
96
|
|
|
97
97
|
== Rails 3 Configuration:
|
data/Rakefile
CHANGED
|
@@ -25,6 +25,7 @@ Jeweler::Tasks.new do |gem|
|
|
|
25
25
|
# and development dependencies are only needed for development (ie running rake tasks, tests, etc)
|
|
26
26
|
# gem.add_runtime_dependency 'jabber4r', '> 0.1'
|
|
27
27
|
# gem.add_development_dependency 'rspec', '> 1.2.3'
|
|
28
|
+
gem.add_runtime_dependency 'bundler', '1.1.0'
|
|
28
29
|
gem.add_runtime_dependency 'bcrypt-ruby', '~> 3.0.0'
|
|
29
30
|
gem.add_runtime_dependency 'oauth', '~> 0.4.4'
|
|
30
31
|
gem.add_runtime_dependency 'oauth2', '~> 0.5.1'
|
|
@@ -50,6 +51,7 @@ task :all_sorcery_specs do
|
|
|
50
51
|
directory_name = File.dirname(rakefile)
|
|
51
52
|
sh <<-CMD
|
|
52
53
|
cd #{directory_name}
|
|
54
|
+
bundle
|
|
53
55
|
bundle exec rake
|
|
54
56
|
CMD
|
|
55
57
|
end
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.7.
|
|
1
|
+
0.7.10
|
|
@@ -35,7 +35,7 @@ module Sorcery
|
|
|
35
35
|
# Generate the model and add 'authenticates_with_sorcery!' unless you passed --migrations
|
|
36
36
|
unless options[:migrations]
|
|
37
37
|
generate "model #{model_class_name} --skip-migration"
|
|
38
|
-
insert_into_file "app/models/#{model_class_name.
|
|
38
|
+
insert_into_file "app/models/#{model_class_name.underscore}.rb", " authenticates_with_sorcery!\n", :after => "class #{model_class_name} < ActiveRecord::Base\n"
|
|
39
39
|
end
|
|
40
40
|
end
|
|
41
41
|
|
|
@@ -68,9 +68,9 @@ module Sorcery
|
|
|
68
68
|
|
|
69
69
|
private
|
|
70
70
|
|
|
71
|
-
# Either return the model passed in a
|
|
71
|
+
# Either return the model passed in a classified form or return the default "User".
|
|
72
72
|
def model_class_name
|
|
73
|
-
options[:model] ? options[:model].
|
|
73
|
+
options[:model] ? options[:model].classify : "User"
|
|
74
74
|
end
|
|
75
75
|
end
|
|
76
76
|
end
|
|
@@ -329,6 +329,26 @@ Rails.application.config.sorcery.configure do |config|
|
|
|
329
329
|
#
|
|
330
330
|
# user.login_lock_time_period =
|
|
331
331
|
|
|
332
|
+
# Unlock token attribute name
|
|
333
|
+
# Default: `:unlock_token`
|
|
334
|
+
#
|
|
335
|
+
# user.unlock_token_attribute_name =
|
|
336
|
+
|
|
337
|
+
# Unlock token mailer method
|
|
338
|
+
# Default: `:send_unlock_token_email`
|
|
339
|
+
#
|
|
340
|
+
# user.unlock_token_email_method_name =
|
|
341
|
+
|
|
342
|
+
# when true sorcery will not automatically
|
|
343
|
+
# send email with unlock token
|
|
344
|
+
# Default: `false`
|
|
345
|
+
#
|
|
346
|
+
# user.unlock_token_mailer_disabled = true
|
|
347
|
+
|
|
348
|
+
# Unlock token mailer class
|
|
349
|
+
# Default: `nil`
|
|
350
|
+
#
|
|
351
|
+
# user.unlock_token_mailer = UserMailer
|
|
332
352
|
|
|
333
353
|
# -- activity logging --
|
|
334
354
|
# Last login attribute name.
|
|
@@ -2,10 +2,12 @@ class SorceryBruteForceProtection < ActiveRecord::Migration
|
|
|
2
2
|
def self.up
|
|
3
3
|
add_column :<%= model_class_name.tableize %>, :failed_logins_count, :integer, :default => 0
|
|
4
4
|
add_column :<%= model_class_name.tableize %>, :lock_expires_at, :datetime, :default => nil
|
|
5
|
+
add_column :<%= model_class_name.tableize %>, :unlock_token, :string, :default => nil
|
|
5
6
|
end
|
|
6
7
|
|
|
7
8
|
def self.down
|
|
8
9
|
remove_column :<%= model_class_name.tableize %>, :lock_expires_at
|
|
9
10
|
remove_column :<%= model_class_name.tableize %>, :failed_logins_count
|
|
11
|
+
remove_column :<%= model_class_name.tableize %>, :unlock_token
|
|
10
12
|
end
|
|
11
13
|
end
|
data/lib/sorcery/controller.rb
CHANGED
|
@@ -29,6 +29,7 @@ module Sorcery
|
|
|
29
29
|
# Takes credentials and returns a user on successful authentication.
|
|
30
30
|
# Runs hooks after login or failed login.
|
|
31
31
|
def login(*credentials)
|
|
32
|
+
@current_user = nil
|
|
32
33
|
user = user_class.authenticate(*credentials)
|
|
33
34
|
if user
|
|
34
35
|
return_to_url = session[:return_to_url]
|
|
@@ -72,8 +72,8 @@ module Sorcery
|
|
|
72
72
|
def get_current_users
|
|
73
73
|
config = sorcery_config
|
|
74
74
|
where(config.last_activity_at_attribute_name.ne => nil) \
|
|
75
|
-
.
|
|
76
|
-
.
|
|
75
|
+
.where("this.#{config.last_logout_at_attribute_name} == null || this.#{config.last_activity_at_attribute_name} > this.#{config.last_logout_at_attribute_name}") \
|
|
76
|
+
.where(config.last_activity_at_attribute_name.gt => config.activity_timeout.seconds.ago.utc).order_by([:_id,:asc])
|
|
77
77
|
end
|
|
78
78
|
end
|
|
79
79
|
end
|
|
@@ -12,15 +12,25 @@ module Sorcery
|
|
|
12
12
|
:lock_expires_at_attribute_name, # this field indicates whether user
|
|
13
13
|
# is banned and when it will be active again.
|
|
14
14
|
:consecutive_login_retries_amount_limit, # how many failed logins allowed.
|
|
15
|
-
:login_lock_time_period
|
|
15
|
+
:login_lock_time_period, # how long the user should be banned.
|
|
16
16
|
# in seconds. 0 for permanent.
|
|
17
|
+
|
|
18
|
+
:unlock_token_attribute_name, # Unlock token attribute name
|
|
19
|
+
:unlock_token_email_method_name, # Mailer method name
|
|
20
|
+
:unlock_token_mailer_disabled, # When true, dont send unlock token via email
|
|
21
|
+
:unlock_token_mailer # Mailer class
|
|
17
22
|
end
|
|
18
23
|
|
|
19
24
|
base.sorcery_config.instance_eval do
|
|
20
25
|
@defaults.merge!(:@failed_logins_count_attribute_name => :failed_logins_count,
|
|
21
26
|
:@lock_expires_at_attribute_name => :lock_expires_at,
|
|
22
27
|
:@consecutive_login_retries_amount_limit => 50,
|
|
23
|
-
:@login_lock_time_period => 60 * 60
|
|
28
|
+
:@login_lock_time_period => 60 * 60,
|
|
29
|
+
|
|
30
|
+
:@unlock_token_attribute_name => :unlock_token,
|
|
31
|
+
:@unlock_token_email_method_name => :send_unlock_token_email,
|
|
32
|
+
:@unlock_token_mailer_disabled => false,
|
|
33
|
+
:@unlock_token_mailer => nil)
|
|
24
34
|
reset!
|
|
25
35
|
end
|
|
26
36
|
|
|
@@ -31,9 +41,19 @@ module Sorcery
|
|
|
31
41
|
end
|
|
32
42
|
base.extend(ClassMethods)
|
|
33
43
|
base.send(:include, InstanceMethods)
|
|
44
|
+
|
|
45
|
+
base.class_eval do
|
|
46
|
+
after_update :send_unlock_token_email!, :if => Proc.new { |user| user.send(sorcery_config.unlock_token_attribute_name).present? }
|
|
47
|
+
end
|
|
34
48
|
end
|
|
35
49
|
|
|
36
50
|
module ClassMethods
|
|
51
|
+
def load_from_unlock_token(token)
|
|
52
|
+
return nil if token.blank?
|
|
53
|
+
user = find_by_sorcery_token(sorcery_config.unlock_token_attribute_name,token)
|
|
54
|
+
user
|
|
55
|
+
end
|
|
56
|
+
|
|
37
57
|
protected
|
|
38
58
|
|
|
39
59
|
def define_brute_force_protection_mongoid_fields
|
|
@@ -58,18 +78,23 @@ module Sorcery
|
|
|
58
78
|
self.lock! if self.send(config.failed_logins_count_attribute_name) >= config.consecutive_login_retries_amount_limit
|
|
59
79
|
end
|
|
60
80
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
81
|
+
# /!\
|
|
82
|
+
# Moved out of protected for use like activate! in controller
|
|
83
|
+
# /!\
|
|
84
|
+
def unlock!
|
|
64
85
|
config = sorcery_config
|
|
65
|
-
self.send(:"#{config.lock_expires_at_attribute_name}=",
|
|
86
|
+
self.send(:"#{config.lock_expires_at_attribute_name}=", nil)
|
|
87
|
+
self.send(:"#{config.failed_logins_count_attribute_name}=", 0)
|
|
88
|
+
self.send(:"#{config.unlock_token_attribute_name}=", nil) unless config.unlock_token_mailer_disabled or config.unlock_token_mailer.nil?
|
|
66
89
|
self.save!(:validate => false)
|
|
67
90
|
end
|
|
68
91
|
|
|
69
|
-
|
|
92
|
+
protected
|
|
93
|
+
|
|
94
|
+
def lock!
|
|
70
95
|
config = sorcery_config
|
|
71
|
-
self.send(:"#{config.lock_expires_at_attribute_name}=",
|
|
72
|
-
self.send(:"#{config.
|
|
96
|
+
self.send(:"#{config.lock_expires_at_attribute_name}=", Time.now.in_time_zone + config.login_lock_time_period)
|
|
97
|
+
self.send(:"#{config.unlock_token_attribute_name}=", TemporaryToken.generate_random_token) unless config.unlock_token_mailer_disabled or config.unlock_token_mailer.nil?
|
|
73
98
|
self.save!(:validate => false)
|
|
74
99
|
end
|
|
75
100
|
|
|
@@ -77,6 +102,10 @@ module Sorcery
|
|
|
77
102
|
config = sorcery_config
|
|
78
103
|
self.send(config.lock_expires_at_attribute_name).nil?
|
|
79
104
|
end
|
|
105
|
+
|
|
106
|
+
def send_unlock_token_email!
|
|
107
|
+
generic_send_email(:unlock_token_email_method_name, :unlock_token_mailer) unless sorcery_config.unlock_token_email_method_name.nil? or sorcery_config.unlock_token_mailer_disabled == true
|
|
108
|
+
end
|
|
80
109
|
|
|
81
110
|
# Prevents a locked user from logging in, and unlocks users that expired their lock time.
|
|
82
111
|
# Runs as a hook before authenticate.
|
data/sorcery.gemspec
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
Gem::Specification.new do |s|
|
|
7
7
|
s.name = "sorcery"
|
|
8
|
-
s.version = "0.7.
|
|
8
|
+
s.version = "0.7.10"
|
|
9
9
|
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
11
11
|
s.authors = ["Noam Ben Ari"]
|
|
12
|
-
s.date = "2012-
|
|
12
|
+
s.date = "2012-04-17"
|
|
13
13
|
s.description = "Provides common authentication needs such as signing in/out, activating by email and resetting password."
|
|
14
14
|
s.email = "nbenari@gmail.com"
|
|
15
15
|
s.extra_rdoc_files = [
|
|
@@ -100,6 +100,7 @@ Gem::Specification.new do |s|
|
|
|
100
100
|
"spec/rails3/app/views/sorcery_mailer/activation_success_email.text.erb",
|
|
101
101
|
"spec/rails3/app/views/sorcery_mailer/reset_password_email.html.erb",
|
|
102
102
|
"spec/rails3/app/views/sorcery_mailer/reset_password_email.text.erb",
|
|
103
|
+
"spec/rails3/app/views/sorcery_mailer/send_unlock_token_email.text.erb",
|
|
103
104
|
"spec/rails3/config.ru",
|
|
104
105
|
"spec/rails3/config/application.rb",
|
|
105
106
|
"spec/rails3/config/boot.rb",
|
|
@@ -303,126 +304,6 @@ Gem::Specification.new do |s|
|
|
|
303
304
|
s.require_paths = ["lib"]
|
|
304
305
|
s.rubygems_version = "1.8.10"
|
|
305
306
|
s.summary = "Magical authentication for Rails 3 applications"
|
|
306
|
-
s.test_files = [
|
|
307
|
-
"spec/rails3/app/controllers/application_controller.rb",
|
|
308
|
-
"spec/rails3/app/helpers/application_helper.rb",
|
|
309
|
-
"spec/rails3/app/mailers/sorcery_mailer.rb",
|
|
310
|
-
"spec/rails3/app/models/authentication.rb",
|
|
311
|
-
"spec/rails3/app/models/user.rb",
|
|
312
|
-
"spec/rails3/config/application.rb",
|
|
313
|
-
"spec/rails3/config/boot.rb",
|
|
314
|
-
"spec/rails3/config/environment.rb",
|
|
315
|
-
"spec/rails3/config/environments/development.rb",
|
|
316
|
-
"spec/rails3/config/environments/in_memory.rb",
|
|
317
|
-
"spec/rails3/config/environments/production.rb",
|
|
318
|
-
"spec/rails3/config/environments/test.rb",
|
|
319
|
-
"spec/rails3/config/initializers/backtrace_silencers.rb",
|
|
320
|
-
"spec/rails3/config/initializers/inflections.rb",
|
|
321
|
-
"spec/rails3/config/initializers/mime_types.rb",
|
|
322
|
-
"spec/rails3/config/initializers/secret_token.rb",
|
|
323
|
-
"spec/rails3/config/initializers/session_store.rb",
|
|
324
|
-
"spec/rails3/config/routes.rb",
|
|
325
|
-
"spec/rails3/db/migrate/activation/20101224223622_add_activation_to_users.rb",
|
|
326
|
-
"spec/rails3/db/migrate/activity_logging/20101224223624_add_activity_logging_to_users.rb",
|
|
327
|
-
"spec/rails3/db/migrate/brute_force_protection/20101224223626_add_brute_force_protection_to_users.rb",
|
|
328
|
-
"spec/rails3/db/migrate/core/20101224223620_create_users.rb",
|
|
329
|
-
"spec/rails3/db/migrate/external/20101224223628_create_authentications.rb",
|
|
330
|
-
"spec/rails3/db/migrate/remember_me/20101224223623_add_remember_me_token_to_users.rb",
|
|
331
|
-
"spec/rails3/db/migrate/reset_password/20101224223622_add_reset_password_to_users.rb",
|
|
332
|
-
"spec/rails3/db/schema.rb",
|
|
333
|
-
"spec/rails3/db/seeds.rb",
|
|
334
|
-
"spec/rails3/spec/controller_activity_logging_spec.rb",
|
|
335
|
-
"spec/rails3/spec/controller_brute_force_protection_spec.rb",
|
|
336
|
-
"spec/rails3/spec/controller_http_basic_auth_spec.rb",
|
|
337
|
-
"spec/rails3/spec/controller_oauth2_spec.rb",
|
|
338
|
-
"spec/rails3/spec/controller_oauth_spec.rb",
|
|
339
|
-
"spec/rails3/spec/controller_remember_me_spec.rb",
|
|
340
|
-
"spec/rails3/spec/controller_session_timeout_spec.rb",
|
|
341
|
-
"spec/rails3/spec/controller_spec.rb",
|
|
342
|
-
"spec/rails3/spec/integration_spec.rb",
|
|
343
|
-
"spec/rails3/spec/spec_helper.orig.rb",
|
|
344
|
-
"spec/rails3/spec/spec_helper.rb",
|
|
345
|
-
"spec/rails3/spec/user_activation_spec.rb",
|
|
346
|
-
"spec/rails3/spec/user_activity_logging_spec.rb",
|
|
347
|
-
"spec/rails3/spec/user_brute_force_protection_spec.rb",
|
|
348
|
-
"spec/rails3/spec/user_oauth_spec.rb",
|
|
349
|
-
"spec/rails3/spec/user_remember_me_spec.rb",
|
|
350
|
-
"spec/rails3/spec/user_reset_password_spec.rb",
|
|
351
|
-
"spec/rails3/spec/user_spec.rb",
|
|
352
|
-
"spec/rails3_mongo_mapper/app/controllers/application_controller.rb",
|
|
353
|
-
"spec/rails3_mongo_mapper/app/helpers/application_helper.rb",
|
|
354
|
-
"spec/rails3_mongo_mapper/app/mailers/sorcery_mailer.rb",
|
|
355
|
-
"spec/rails3_mongo_mapper/app/models/authentication.rb",
|
|
356
|
-
"spec/rails3_mongo_mapper/app/models/user.rb",
|
|
357
|
-
"spec/rails3_mongo_mapper/config/application.rb",
|
|
358
|
-
"spec/rails3_mongo_mapper/config/boot.rb",
|
|
359
|
-
"spec/rails3_mongo_mapper/config/environment.rb",
|
|
360
|
-
"spec/rails3_mongo_mapper/config/environments/development.rb",
|
|
361
|
-
"spec/rails3_mongo_mapper/config/environments/in_memory.rb",
|
|
362
|
-
"spec/rails3_mongo_mapper/config/environments/production.rb",
|
|
363
|
-
"spec/rails3_mongo_mapper/config/environments/test.rb",
|
|
364
|
-
"spec/rails3_mongo_mapper/config/initializers/backtrace_silencers.rb",
|
|
365
|
-
"spec/rails3_mongo_mapper/config/initializers/inflections.rb",
|
|
366
|
-
"spec/rails3_mongo_mapper/config/initializers/mime_types.rb",
|
|
367
|
-
"spec/rails3_mongo_mapper/config/initializers/mongo.rb",
|
|
368
|
-
"spec/rails3_mongo_mapper/config/initializers/secret_token.rb",
|
|
369
|
-
"spec/rails3_mongo_mapper/config/initializers/session_store.rb",
|
|
370
|
-
"spec/rails3_mongo_mapper/config/routes.rb",
|
|
371
|
-
"spec/rails3_mongo_mapper/db/schema.rb",
|
|
372
|
-
"spec/rails3_mongo_mapper/db/seeds.rb",
|
|
373
|
-
"spec/rails3_mongo_mapper/spec/controller_spec.rb",
|
|
374
|
-
"spec/rails3_mongo_mapper/spec/spec_helper.orig.rb",
|
|
375
|
-
"spec/rails3_mongo_mapper/spec/spec_helper.rb",
|
|
376
|
-
"spec/rails3_mongo_mapper/spec/user_activation_spec.rb",
|
|
377
|
-
"spec/rails3_mongo_mapper/spec/user_activity_logging_spec.rb",
|
|
378
|
-
"spec/rails3_mongo_mapper/spec/user_brute_force_protection_spec.rb",
|
|
379
|
-
"spec/rails3_mongo_mapper/spec/user_oauth_spec.rb",
|
|
380
|
-
"spec/rails3_mongo_mapper/spec/user_remember_me_spec.rb",
|
|
381
|
-
"spec/rails3_mongo_mapper/spec/user_reset_password_spec.rb",
|
|
382
|
-
"spec/rails3_mongo_mapper/spec/user_spec.rb",
|
|
383
|
-
"spec/rails3_mongoid/app/controllers/application_controller.rb",
|
|
384
|
-
"spec/rails3_mongoid/app/helpers/application_helper.rb",
|
|
385
|
-
"spec/rails3_mongoid/app/mailers/sorcery_mailer.rb",
|
|
386
|
-
"spec/rails3_mongoid/app/models/authentication.rb",
|
|
387
|
-
"spec/rails3_mongoid/app/models/user.rb",
|
|
388
|
-
"spec/rails3_mongoid/config/application.rb",
|
|
389
|
-
"spec/rails3_mongoid/config/boot.rb",
|
|
390
|
-
"spec/rails3_mongoid/config/environment.rb",
|
|
391
|
-
"spec/rails3_mongoid/config/environments/development.rb",
|
|
392
|
-
"spec/rails3_mongoid/config/environments/in_memory.rb",
|
|
393
|
-
"spec/rails3_mongoid/config/environments/production.rb",
|
|
394
|
-
"spec/rails3_mongoid/config/environments/test.rb",
|
|
395
|
-
"spec/rails3_mongoid/config/initializers/backtrace_silencers.rb",
|
|
396
|
-
"spec/rails3_mongoid/config/initializers/inflections.rb",
|
|
397
|
-
"spec/rails3_mongoid/config/initializers/mime_types.rb",
|
|
398
|
-
"spec/rails3_mongoid/config/initializers/secret_token.rb",
|
|
399
|
-
"spec/rails3_mongoid/config/initializers/session_store.rb",
|
|
400
|
-
"spec/rails3_mongoid/config/routes.rb",
|
|
401
|
-
"spec/rails3_mongoid/db/schema.rb",
|
|
402
|
-
"spec/rails3_mongoid/db/seeds.rb",
|
|
403
|
-
"spec/rails3_mongoid/spec/controller_activity_logging_spec.rb",
|
|
404
|
-
"spec/rails3_mongoid/spec/controller_spec.rb",
|
|
405
|
-
"spec/rails3_mongoid/spec/spec_helper.orig.rb",
|
|
406
|
-
"spec/rails3_mongoid/spec/spec_helper.rb",
|
|
407
|
-
"spec/rails3_mongoid/spec/user_activation_spec.rb",
|
|
408
|
-
"spec/rails3_mongoid/spec/user_activity_logging_spec.rb",
|
|
409
|
-
"spec/rails3_mongoid/spec/user_brute_force_protection_spec.rb",
|
|
410
|
-
"spec/rails3_mongoid/spec/user_oauth_spec.rb",
|
|
411
|
-
"spec/rails3_mongoid/spec/user_remember_me_spec.rb",
|
|
412
|
-
"spec/rails3_mongoid/spec/user_reset_password_spec.rb",
|
|
413
|
-
"spec/rails3_mongoid/spec/user_spec.rb",
|
|
414
|
-
"spec/shared_examples/controller_oauth2_shared_examples.rb",
|
|
415
|
-
"spec/shared_examples/controller_oauth_shared_examples.rb",
|
|
416
|
-
"spec/shared_examples/user_activation_shared_examples.rb",
|
|
417
|
-
"spec/shared_examples/user_activity_logging_shared_examples.rb",
|
|
418
|
-
"spec/shared_examples/user_brute_force_protection_shared_examples.rb",
|
|
419
|
-
"spec/shared_examples/user_oauth_shared_examples.rb",
|
|
420
|
-
"spec/shared_examples/user_remember_me_shared_examples.rb",
|
|
421
|
-
"spec/shared_examples/user_reset_password_shared_examples.rb",
|
|
422
|
-
"spec/shared_examples/user_shared_examples.rb",
|
|
423
|
-
"spec/sorcery_crypto_providers_spec.rb",
|
|
424
|
-
"spec/spec_helper.rb"
|
|
425
|
-
]
|
|
426
307
|
|
|
427
308
|
if s.respond_to? :specification_version then
|
|
428
309
|
s.specification_version = 3
|
|
@@ -437,12 +318,13 @@ Gem::Specification.new do |s|
|
|
|
437
318
|
s.add_development_dependency(%q<ruby-debug19>, [">= 0"])
|
|
438
319
|
s.add_development_dependency(%q<sqlite3-ruby>, [">= 0"])
|
|
439
320
|
s.add_development_dependency(%q<yard>, ["~> 0.6.0"])
|
|
440
|
-
s.add_development_dependency(%q<bundler>, ["
|
|
441
|
-
s.add_development_dependency(%q<jeweler>, ["~> 1.
|
|
321
|
+
s.add_development_dependency(%q<bundler>, [">= 1.1.0"])
|
|
322
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.8.3"])
|
|
442
323
|
s.add_development_dependency(%q<simplecov>, [">= 0.3.8"])
|
|
443
324
|
s.add_development_dependency(%q<capybara>, [">= 1.1.2"])
|
|
444
325
|
s.add_development_dependency(%q<mongoid>, ["~> 2.4.4"])
|
|
445
326
|
s.add_development_dependency(%q<timecop>, [">= 0"])
|
|
327
|
+
s.add_runtime_dependency(%q<bundler>, ["= 1.1.0"])
|
|
446
328
|
s.add_runtime_dependency(%q<bcrypt-ruby>, ["~> 3.0.0"])
|
|
447
329
|
s.add_runtime_dependency(%q<oauth>, ["~> 0.4.4"])
|
|
448
330
|
s.add_runtime_dependency(%q<oauth2>, ["~> 0.5.1"])
|
|
@@ -456,12 +338,13 @@ Gem::Specification.new do |s|
|
|
|
456
338
|
s.add_dependency(%q<ruby-debug19>, [">= 0"])
|
|
457
339
|
s.add_dependency(%q<sqlite3-ruby>, [">= 0"])
|
|
458
340
|
s.add_dependency(%q<yard>, ["~> 0.6.0"])
|
|
459
|
-
s.add_dependency(%q<bundler>, ["
|
|
460
|
-
s.add_dependency(%q<jeweler>, ["~> 1.
|
|
341
|
+
s.add_dependency(%q<bundler>, [">= 1.1.0"])
|
|
342
|
+
s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
|
|
461
343
|
s.add_dependency(%q<simplecov>, [">= 0.3.8"])
|
|
462
344
|
s.add_dependency(%q<capybara>, [">= 1.1.2"])
|
|
463
345
|
s.add_dependency(%q<mongoid>, ["~> 2.4.4"])
|
|
464
346
|
s.add_dependency(%q<timecop>, [">= 0"])
|
|
347
|
+
s.add_dependency(%q<bundler>, ["= 1.1.0"])
|
|
465
348
|
s.add_dependency(%q<bcrypt-ruby>, ["~> 3.0.0"])
|
|
466
349
|
s.add_dependency(%q<oauth>, ["~> 0.4.4"])
|
|
467
350
|
s.add_dependency(%q<oauth2>, ["~> 0.5.1"])
|
|
@@ -476,12 +359,13 @@ Gem::Specification.new do |s|
|
|
|
476
359
|
s.add_dependency(%q<ruby-debug19>, [">= 0"])
|
|
477
360
|
s.add_dependency(%q<sqlite3-ruby>, [">= 0"])
|
|
478
361
|
s.add_dependency(%q<yard>, ["~> 0.6.0"])
|
|
479
|
-
s.add_dependency(%q<bundler>, ["
|
|
480
|
-
s.add_dependency(%q<jeweler>, ["~> 1.
|
|
362
|
+
s.add_dependency(%q<bundler>, [">= 1.1.0"])
|
|
363
|
+
s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
|
|
481
364
|
s.add_dependency(%q<simplecov>, [">= 0.3.8"])
|
|
482
365
|
s.add_dependency(%q<capybara>, [">= 1.1.2"])
|
|
483
366
|
s.add_dependency(%q<mongoid>, ["~> 2.4.4"])
|
|
484
367
|
s.add_dependency(%q<timecop>, [">= 0"])
|
|
368
|
+
s.add_dependency(%q<bundler>, ["= 1.1.0"])
|
|
485
369
|
s.add_dependency(%q<bcrypt-ruby>, ["~> 3.0.0"])
|
|
486
370
|
s.add_dependency(%q<oauth>, ["~> 0.4.4"])
|
|
487
371
|
s.add_dependency(%q<oauth2>, ["~> 0.5.1"])
|
data/spec/Gemfile.lock
CHANGED
data/spec/README.md
CHANGED
|
@@ -7,25 +7,25 @@ Each sample app runs a set of shared specs ( `spec/shared_examples/*_example.rb`
|
|
|
7
7
|
Sorcery has one set of specs (`sorcery_crypto_providers_spec.rb`) that can be run outside of any of the frameworks. To run it simply:
|
|
8
8
|
|
|
9
9
|
cd spec/
|
|
10
|
-
bundle
|
|
11
|
-
rake spec
|
|
10
|
+
bundle
|
|
11
|
+
bundle exec rake spec
|
|
12
12
|
|
|
13
13
|
Running Framework Specs
|
|
14
14
|
-----------------------
|
|
15
15
|
To run framework specs, cd into each directory, bundle, and run the specs. For example, to run the rails3 specs you would:
|
|
16
16
|
|
|
17
17
|
cd spec/rails3/
|
|
18
|
-
bundle
|
|
19
|
-
rake spec
|
|
18
|
+
bundle
|
|
19
|
+
bundle exec rake spec
|
|
20
20
|
|
|
21
21
|
**Note:** the rails3_mongoid and rails3_mongo_mapper sample apps do require, well, MongoDB. Installing MongoDB on mac osx is easy with homebrew. Seeing as you're reading the readme for running specs, I'll assume you can install MongoDB on your machine. For the purpose of running these tests, I put mongod in verbose mode and in the background so I can see it log to stdout.
|
|
22
22
|
|
|
23
23
|
cd spec/rails3_mongoid
|
|
24
|
-
bundle
|
|
24
|
+
bundle
|
|
25
25
|
mongod -v &
|
|
26
|
-
rake spec
|
|
26
|
+
bundle exec rake spec
|
|
27
27
|
|
|
28
28
|
cd spec/rails3_mongo_mapper
|
|
29
|
-
bundle
|
|
29
|
+
bundle
|
|
30
30
|
mongod -v &
|
|
31
|
-
rake spec
|
|
31
|
+
bundle exec rake spec
|
data/spec/rails3/Gemfile.lock
CHANGED
|
@@ -22,4 +22,11 @@ class SorceryMailer < ActionMailer::Base
|
|
|
22
22
|
mail(:to => user.email,
|
|
23
23
|
:subject => "Your password has been reset")
|
|
24
24
|
end
|
|
25
|
+
|
|
26
|
+
def send_unlock_token_email(user)
|
|
27
|
+
@user = user
|
|
28
|
+
@url = "http://example.com/unlock/#{user.unlock_token}"
|
|
29
|
+
mail(:to => user.email,
|
|
30
|
+
:subject => "Your account has been locked due to many wrong logins")
|
|
31
|
+
end
|
|
25
32
|
end
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Please visit <% @url %> for unlock your account.
|
|
@@ -2,9 +2,11 @@ class AddBruteForceProtectionToUsers < ActiveRecord::Migration
|
|
|
2
2
|
def self.up
|
|
3
3
|
add_column :users, :failed_logins_count, :integer, :default => 0
|
|
4
4
|
add_column :users, :lock_expires_at, :datetime, :default => nil
|
|
5
|
+
add_column :users, :unlock_token, :string, :default => nil
|
|
5
6
|
end
|
|
6
7
|
|
|
7
8
|
def self.down
|
|
9
|
+
remove_column :users, :unlock_token
|
|
8
10
|
remove_column :users, :lock_expires_at
|
|
9
11
|
remove_column :users, :failed_logins_count
|
|
10
12
|
end
|
|
@@ -21,12 +21,34 @@ describe ApplicationController do
|
|
|
21
21
|
sorcery_controller_property_set(:user_class, User)
|
|
22
22
|
Timecop.return
|
|
23
23
|
end
|
|
24
|
-
|
|
24
|
+
|
|
25
25
|
it "should count login retries" do
|
|
26
26
|
3.times {get :test_login, :username => 'gizmo', :password => 'blabla'}
|
|
27
27
|
User.find_by_username('gizmo').failed_logins_count.should == 3
|
|
28
28
|
end
|
|
29
29
|
|
|
30
|
+
it "should generate unlock token after user locked" do
|
|
31
|
+
sorcery_model_property_set(:consecutive_login_retries_amount_limit, 2)
|
|
32
|
+
sorcery_model_property_set(:login_lock_time_period, 0)
|
|
33
|
+
sorcery_model_property_set(:unlock_token_mailer, SorceryMailer)
|
|
34
|
+
3.times {get :test_login, :username => "gizmo", :password => "blabla"}
|
|
35
|
+
User.find_by_username('gizmo').unlock_token.should_not be_nil
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
it "should unlock after entering unlock token" do
|
|
39
|
+
sorcery_model_property_set(:consecutive_login_retries_amount_limit, 2)
|
|
40
|
+
sorcery_model_property_set(:login_lock_time_period, 0)
|
|
41
|
+
sorcery_model_property_set(:unlock_token_mailer, SorceryMailer)
|
|
42
|
+
3.times {get :test_login, :username => "gizmo", :password => "blabla"}
|
|
43
|
+
User.find_by_username('gizmo').unlock_token.should_not be_nil
|
|
44
|
+
token = User.find_by_username('gizmo').unlock_token
|
|
45
|
+
user = User.load_from_unlock_token(token)
|
|
46
|
+
user.should_not be_nil
|
|
47
|
+
user.unlock!
|
|
48
|
+
User.load_from_unlock_token(token).should be_nil
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
|
|
30
52
|
it "should reset the counter on a good login" do
|
|
31
53
|
sorcery_model_property_set(:consecutive_login_retries_amount_limit, 5)
|
|
32
54
|
3.times {get :test_login, :username => 'gizmo', :password => 'blabla'}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: ../../
|
|
3
3
|
specs:
|
|
4
|
-
sorcery (0.7.
|
|
4
|
+
sorcery (0.7.8)
|
|
5
|
+
bcrypt-ruby (~> 3.0.0)
|
|
6
|
+
bundler (>= 1.1.0)
|
|
5
7
|
oauth (~> 0.4.4)
|
|
6
8
|
oauth2 (~> 0.5.1)
|
|
7
9
|
|
|
@@ -141,7 +143,7 @@ PLATFORMS
|
|
|
141
143
|
DEPENDENCIES
|
|
142
144
|
bcrypt-ruby (~> 3.0.0)
|
|
143
145
|
bson_ext (~> 1.3)
|
|
144
|
-
mongo_mapper
|
|
146
|
+
mongo_mapper (~> 0.11.0)
|
|
145
147
|
pry
|
|
146
148
|
rails (= 3.0.3)
|
|
147
149
|
rspec (~> 2.5.0)
|
|
@@ -23,28 +23,28 @@ describe ApplicationController do
|
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
it "should log login time on login" do
|
|
26
|
-
now = Time.now
|
|
26
|
+
now = Time.now.utc
|
|
27
27
|
login_user
|
|
28
28
|
@user.last_login_at.should_not be_nil
|
|
29
|
-
@user.last_login_at.to_s
|
|
30
|
-
@user.last_login_at.to_s
|
|
29
|
+
@user.last_login_at.utc.to_s.should >= now.utc.to_s
|
|
30
|
+
@user.last_login_at.utc.to_s.should <= (now.utc+2).to_s
|
|
31
31
|
end
|
|
32
32
|
|
|
33
33
|
it "should log logout time on logout" do
|
|
34
34
|
login_user
|
|
35
|
-
now = Time.now
|
|
35
|
+
now = Time.now.utc
|
|
36
36
|
logout_user
|
|
37
|
-
User.first.last_logout_at.should_not be_nil
|
|
38
|
-
User.first.last_logout_at.to_s
|
|
39
|
-
User.first.last_logout_at.to_s
|
|
37
|
+
User.first.last_logout_at.utc.should_not be_nil
|
|
38
|
+
User.first.last_logout_at.utc.to_s.should >= now.utc.to_s
|
|
39
|
+
User.first.last_logout_at.utc.to_s.should <= (now.utc+2).to_s
|
|
40
40
|
end
|
|
41
41
|
|
|
42
42
|
it "should log last activity time when logged in" do
|
|
43
43
|
login_user
|
|
44
|
-
now = Time.now
|
|
44
|
+
now = Time.now.utc
|
|
45
45
|
get :some_action
|
|
46
|
-
User.first.last_activity_at.
|
|
47
|
-
User.first.last_activity_at.
|
|
46
|
+
User.first.last_activity_at.utc.should >= now.utc
|
|
47
|
+
User.first.last_activity_at.utc.should <= (now.utc+2)
|
|
48
48
|
end
|
|
49
49
|
|
|
50
50
|
it "should update nothing but activity fields" do
|
|
@@ -102,4 +102,4 @@ describe ApplicationController do
|
|
|
102
102
|
@user.last_activity_at.should be_nil
|
|
103
103
|
end
|
|
104
104
|
end
|
|
105
|
-
end
|
|
105
|
+
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sorcery
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.7.
|
|
4
|
+
version: 0.7.10
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -9,11 +9,11 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2012-
|
|
12
|
+
date: 2012-04-17 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: sorcery
|
|
16
|
-
requirement: &
|
|
16
|
+
requirement: &2154680860 !ruby/object:Gem::Requirement
|
|
17
17
|
none: false
|
|
18
18
|
requirements:
|
|
19
19
|
- - ! '>='
|
|
@@ -21,10 +21,10 @@ dependencies:
|
|
|
21
21
|
version: '0'
|
|
22
22
|
type: :runtime
|
|
23
23
|
prerelease: false
|
|
24
|
-
version_requirements: *
|
|
24
|
+
version_requirements: *2154680860
|
|
25
25
|
- !ruby/object:Gem::Dependency
|
|
26
26
|
name: bcrypt-ruby
|
|
27
|
-
requirement: &
|
|
27
|
+
requirement: &2154680280 !ruby/object:Gem::Requirement
|
|
28
28
|
none: false
|
|
29
29
|
requirements:
|
|
30
30
|
- - ~>
|
|
@@ -32,10 +32,10 @@ dependencies:
|
|
|
32
32
|
version: 3.0.0
|
|
33
33
|
type: :development
|
|
34
34
|
prerelease: false
|
|
35
|
-
version_requirements: *
|
|
35
|
+
version_requirements: *2154680280
|
|
36
36
|
- !ruby/object:Gem::Dependency
|
|
37
37
|
name: rails
|
|
38
|
-
requirement: &
|
|
38
|
+
requirement: &2154679780 !ruby/object:Gem::Requirement
|
|
39
39
|
none: false
|
|
40
40
|
requirements:
|
|
41
41
|
- - ! '>='
|
|
@@ -43,10 +43,10 @@ dependencies:
|
|
|
43
43
|
version: 3.0.0
|
|
44
44
|
type: :development
|
|
45
45
|
prerelease: false
|
|
46
|
-
version_requirements: *
|
|
46
|
+
version_requirements: *2154679780
|
|
47
47
|
- !ruby/object:Gem::Dependency
|
|
48
48
|
name: json
|
|
49
|
-
requirement: &
|
|
49
|
+
requirement: &2154679280 !ruby/object:Gem::Requirement
|
|
50
50
|
none: false
|
|
51
51
|
requirements:
|
|
52
52
|
- - ! '>='
|
|
@@ -54,10 +54,10 @@ dependencies:
|
|
|
54
54
|
version: 1.5.1
|
|
55
55
|
type: :development
|
|
56
56
|
prerelease: false
|
|
57
|
-
version_requirements: *
|
|
57
|
+
version_requirements: *2154679280
|
|
58
58
|
- !ruby/object:Gem::Dependency
|
|
59
59
|
name: rspec
|
|
60
|
-
requirement: &
|
|
60
|
+
requirement: &2154678800 !ruby/object:Gem::Requirement
|
|
61
61
|
none: false
|
|
62
62
|
requirements:
|
|
63
63
|
- - ~>
|
|
@@ -65,10 +65,10 @@ dependencies:
|
|
|
65
65
|
version: 2.5.0
|
|
66
66
|
type: :development
|
|
67
67
|
prerelease: false
|
|
68
|
-
version_requirements: *
|
|
68
|
+
version_requirements: *2154678800
|
|
69
69
|
- !ruby/object:Gem::Dependency
|
|
70
70
|
name: rspec-rails
|
|
71
|
-
requirement: &
|
|
71
|
+
requirement: &2154606100 !ruby/object:Gem::Requirement
|
|
72
72
|
none: false
|
|
73
73
|
requirements:
|
|
74
74
|
- - ~>
|
|
@@ -76,10 +76,10 @@ dependencies:
|
|
|
76
76
|
version: 2.5.0
|
|
77
77
|
type: :development
|
|
78
78
|
prerelease: false
|
|
79
|
-
version_requirements: *
|
|
79
|
+
version_requirements: *2154606100
|
|
80
80
|
- !ruby/object:Gem::Dependency
|
|
81
81
|
name: ruby-debug19
|
|
82
|
-
requirement: &
|
|
82
|
+
requirement: &2154605480 !ruby/object:Gem::Requirement
|
|
83
83
|
none: false
|
|
84
84
|
requirements:
|
|
85
85
|
- - ! '>='
|
|
@@ -87,10 +87,10 @@ dependencies:
|
|
|
87
87
|
version: '0'
|
|
88
88
|
type: :development
|
|
89
89
|
prerelease: false
|
|
90
|
-
version_requirements: *
|
|
90
|
+
version_requirements: *2154605480
|
|
91
91
|
- !ruby/object:Gem::Dependency
|
|
92
92
|
name: sqlite3-ruby
|
|
93
|
-
requirement: &
|
|
93
|
+
requirement: &2154604900 !ruby/object:Gem::Requirement
|
|
94
94
|
none: false
|
|
95
95
|
requirements:
|
|
96
96
|
- - ! '>='
|
|
@@ -98,10 +98,10 @@ dependencies:
|
|
|
98
98
|
version: '0'
|
|
99
99
|
type: :development
|
|
100
100
|
prerelease: false
|
|
101
|
-
version_requirements: *
|
|
101
|
+
version_requirements: *2154604900
|
|
102
102
|
- !ruby/object:Gem::Dependency
|
|
103
103
|
name: yard
|
|
104
|
-
requirement: &
|
|
104
|
+
requirement: &2154603840 !ruby/object:Gem::Requirement
|
|
105
105
|
none: false
|
|
106
106
|
requirements:
|
|
107
107
|
- - ~>
|
|
@@ -109,32 +109,32 @@ dependencies:
|
|
|
109
109
|
version: 0.6.0
|
|
110
110
|
type: :development
|
|
111
111
|
prerelease: false
|
|
112
|
-
version_requirements: *
|
|
112
|
+
version_requirements: *2154603840
|
|
113
113
|
- !ruby/object:Gem::Dependency
|
|
114
114
|
name: bundler
|
|
115
|
-
requirement: &
|
|
115
|
+
requirement: &2154603180 !ruby/object:Gem::Requirement
|
|
116
116
|
none: false
|
|
117
117
|
requirements:
|
|
118
|
-
- -
|
|
118
|
+
- - ! '>='
|
|
119
119
|
- !ruby/object:Gem::Version
|
|
120
|
-
version: 1.
|
|
120
|
+
version: 1.1.0
|
|
121
121
|
type: :development
|
|
122
122
|
prerelease: false
|
|
123
|
-
version_requirements: *
|
|
123
|
+
version_requirements: *2154603180
|
|
124
124
|
- !ruby/object:Gem::Dependency
|
|
125
125
|
name: jeweler
|
|
126
|
-
requirement: &
|
|
126
|
+
requirement: &2154602680 !ruby/object:Gem::Requirement
|
|
127
127
|
none: false
|
|
128
128
|
requirements:
|
|
129
129
|
- - ~>
|
|
130
130
|
- !ruby/object:Gem::Version
|
|
131
|
-
version: 1.
|
|
131
|
+
version: 1.8.3
|
|
132
132
|
type: :development
|
|
133
133
|
prerelease: false
|
|
134
|
-
version_requirements: *
|
|
134
|
+
version_requirements: *2154602680
|
|
135
135
|
- !ruby/object:Gem::Dependency
|
|
136
136
|
name: simplecov
|
|
137
|
-
requirement: &
|
|
137
|
+
requirement: &2154601680 !ruby/object:Gem::Requirement
|
|
138
138
|
none: false
|
|
139
139
|
requirements:
|
|
140
140
|
- - ! '>='
|
|
@@ -142,10 +142,10 @@ dependencies:
|
|
|
142
142
|
version: 0.3.8
|
|
143
143
|
type: :development
|
|
144
144
|
prerelease: false
|
|
145
|
-
version_requirements: *
|
|
145
|
+
version_requirements: *2154601680
|
|
146
146
|
- !ruby/object:Gem::Dependency
|
|
147
147
|
name: capybara
|
|
148
|
-
requirement: &
|
|
148
|
+
requirement: &2154601180 !ruby/object:Gem::Requirement
|
|
149
149
|
none: false
|
|
150
150
|
requirements:
|
|
151
151
|
- - ! '>='
|
|
@@ -153,10 +153,10 @@ dependencies:
|
|
|
153
153
|
version: 1.1.2
|
|
154
154
|
type: :development
|
|
155
155
|
prerelease: false
|
|
156
|
-
version_requirements: *
|
|
156
|
+
version_requirements: *2154601180
|
|
157
157
|
- !ruby/object:Gem::Dependency
|
|
158
158
|
name: mongoid
|
|
159
|
-
requirement: &
|
|
159
|
+
requirement: &2154600680 !ruby/object:Gem::Requirement
|
|
160
160
|
none: false
|
|
161
161
|
requirements:
|
|
162
162
|
- - ~>
|
|
@@ -164,10 +164,10 @@ dependencies:
|
|
|
164
164
|
version: 2.4.4
|
|
165
165
|
type: :development
|
|
166
166
|
prerelease: false
|
|
167
|
-
version_requirements: *
|
|
167
|
+
version_requirements: *2154600680
|
|
168
168
|
- !ruby/object:Gem::Dependency
|
|
169
169
|
name: timecop
|
|
170
|
-
requirement: &
|
|
170
|
+
requirement: &2154600040 !ruby/object:Gem::Requirement
|
|
171
171
|
none: false
|
|
172
172
|
requirements:
|
|
173
173
|
- - ! '>='
|
|
@@ -175,10 +175,21 @@ dependencies:
|
|
|
175
175
|
version: '0'
|
|
176
176
|
type: :development
|
|
177
177
|
prerelease: false
|
|
178
|
-
version_requirements: *
|
|
178
|
+
version_requirements: *2154600040
|
|
179
|
+
- !ruby/object:Gem::Dependency
|
|
180
|
+
name: bundler
|
|
181
|
+
requirement: &2154599100 !ruby/object:Gem::Requirement
|
|
182
|
+
none: false
|
|
183
|
+
requirements:
|
|
184
|
+
- - =
|
|
185
|
+
- !ruby/object:Gem::Version
|
|
186
|
+
version: 1.1.0
|
|
187
|
+
type: :runtime
|
|
188
|
+
prerelease: false
|
|
189
|
+
version_requirements: *2154599100
|
|
179
190
|
- !ruby/object:Gem::Dependency
|
|
180
191
|
name: bcrypt-ruby
|
|
181
|
-
requirement: &
|
|
192
|
+
requirement: &2153883240 !ruby/object:Gem::Requirement
|
|
182
193
|
none: false
|
|
183
194
|
requirements:
|
|
184
195
|
- - ~>
|
|
@@ -186,10 +197,10 @@ dependencies:
|
|
|
186
197
|
version: 3.0.0
|
|
187
198
|
type: :runtime
|
|
188
199
|
prerelease: false
|
|
189
|
-
version_requirements: *
|
|
200
|
+
version_requirements: *2153883240
|
|
190
201
|
- !ruby/object:Gem::Dependency
|
|
191
202
|
name: oauth
|
|
192
|
-
requirement: &
|
|
203
|
+
requirement: &2153881960 !ruby/object:Gem::Requirement
|
|
193
204
|
none: false
|
|
194
205
|
requirements:
|
|
195
206
|
- - ~>
|
|
@@ -197,10 +208,10 @@ dependencies:
|
|
|
197
208
|
version: 0.4.4
|
|
198
209
|
type: :runtime
|
|
199
210
|
prerelease: false
|
|
200
|
-
version_requirements: *
|
|
211
|
+
version_requirements: *2153881960
|
|
201
212
|
- !ruby/object:Gem::Dependency
|
|
202
213
|
name: oauth2
|
|
203
|
-
requirement: &
|
|
214
|
+
requirement: &2153881420 !ruby/object:Gem::Requirement
|
|
204
215
|
none: false
|
|
205
216
|
requirements:
|
|
206
217
|
- - ~>
|
|
@@ -208,7 +219,7 @@ dependencies:
|
|
|
208
219
|
version: 0.5.1
|
|
209
220
|
type: :runtime
|
|
210
221
|
prerelease: false
|
|
211
|
-
version_requirements: *
|
|
222
|
+
version_requirements: *2153881420
|
|
212
223
|
description: Provides common authentication needs such as signing in/out, activating
|
|
213
224
|
by email and resetting password.
|
|
214
225
|
email: nbenari@gmail.com
|
|
@@ -301,6 +312,7 @@ files:
|
|
|
301
312
|
- spec/rails3/app/views/sorcery_mailer/activation_success_email.text.erb
|
|
302
313
|
- spec/rails3/app/views/sorcery_mailer/reset_password_email.html.erb
|
|
303
314
|
- spec/rails3/app/views/sorcery_mailer/reset_password_email.text.erb
|
|
315
|
+
- spec/rails3/app/views/sorcery_mailer/send_unlock_token_email.text.erb
|
|
304
316
|
- spec/rails3/config.ru
|
|
305
317
|
- spec/rails3/config/application.rb
|
|
306
318
|
- spec/rails3/config/boot.rb
|
|
@@ -523,122 +535,4 @@ rubygems_version: 1.8.10
|
|
|
523
535
|
signing_key:
|
|
524
536
|
specification_version: 3
|
|
525
537
|
summary: Magical authentication for Rails 3 applications
|
|
526
|
-
test_files:
|
|
527
|
-
- spec/rails3/app/controllers/application_controller.rb
|
|
528
|
-
- spec/rails3/app/helpers/application_helper.rb
|
|
529
|
-
- spec/rails3/app/mailers/sorcery_mailer.rb
|
|
530
|
-
- spec/rails3/app/models/authentication.rb
|
|
531
|
-
- spec/rails3/app/models/user.rb
|
|
532
|
-
- spec/rails3/config/application.rb
|
|
533
|
-
- spec/rails3/config/boot.rb
|
|
534
|
-
- spec/rails3/config/environment.rb
|
|
535
|
-
- spec/rails3/config/environments/development.rb
|
|
536
|
-
- spec/rails3/config/environments/in_memory.rb
|
|
537
|
-
- spec/rails3/config/environments/production.rb
|
|
538
|
-
- spec/rails3/config/environments/test.rb
|
|
539
|
-
- spec/rails3/config/initializers/backtrace_silencers.rb
|
|
540
|
-
- spec/rails3/config/initializers/inflections.rb
|
|
541
|
-
- spec/rails3/config/initializers/mime_types.rb
|
|
542
|
-
- spec/rails3/config/initializers/secret_token.rb
|
|
543
|
-
- spec/rails3/config/initializers/session_store.rb
|
|
544
|
-
- spec/rails3/config/routes.rb
|
|
545
|
-
- spec/rails3/db/migrate/activation/20101224223622_add_activation_to_users.rb
|
|
546
|
-
- spec/rails3/db/migrate/activity_logging/20101224223624_add_activity_logging_to_users.rb
|
|
547
|
-
- spec/rails3/db/migrate/brute_force_protection/20101224223626_add_brute_force_protection_to_users.rb
|
|
548
|
-
- spec/rails3/db/migrate/core/20101224223620_create_users.rb
|
|
549
|
-
- spec/rails3/db/migrate/external/20101224223628_create_authentications.rb
|
|
550
|
-
- spec/rails3/db/migrate/remember_me/20101224223623_add_remember_me_token_to_users.rb
|
|
551
|
-
- spec/rails3/db/migrate/reset_password/20101224223622_add_reset_password_to_users.rb
|
|
552
|
-
- spec/rails3/db/schema.rb
|
|
553
|
-
- spec/rails3/db/seeds.rb
|
|
554
|
-
- spec/rails3/spec/controller_activity_logging_spec.rb
|
|
555
|
-
- spec/rails3/spec/controller_brute_force_protection_spec.rb
|
|
556
|
-
- spec/rails3/spec/controller_http_basic_auth_spec.rb
|
|
557
|
-
- spec/rails3/spec/controller_oauth2_spec.rb
|
|
558
|
-
- spec/rails3/spec/controller_oauth_spec.rb
|
|
559
|
-
- spec/rails3/spec/controller_remember_me_spec.rb
|
|
560
|
-
- spec/rails3/spec/controller_session_timeout_spec.rb
|
|
561
|
-
- spec/rails3/spec/controller_spec.rb
|
|
562
|
-
- spec/rails3/spec/integration_spec.rb
|
|
563
|
-
- spec/rails3/spec/spec_helper.orig.rb
|
|
564
|
-
- spec/rails3/spec/spec_helper.rb
|
|
565
|
-
- spec/rails3/spec/user_activation_spec.rb
|
|
566
|
-
- spec/rails3/spec/user_activity_logging_spec.rb
|
|
567
|
-
- spec/rails3/spec/user_brute_force_protection_spec.rb
|
|
568
|
-
- spec/rails3/spec/user_oauth_spec.rb
|
|
569
|
-
- spec/rails3/spec/user_remember_me_spec.rb
|
|
570
|
-
- spec/rails3/spec/user_reset_password_spec.rb
|
|
571
|
-
- spec/rails3/spec/user_spec.rb
|
|
572
|
-
- spec/rails3_mongo_mapper/app/controllers/application_controller.rb
|
|
573
|
-
- spec/rails3_mongo_mapper/app/helpers/application_helper.rb
|
|
574
|
-
- spec/rails3_mongo_mapper/app/mailers/sorcery_mailer.rb
|
|
575
|
-
- spec/rails3_mongo_mapper/app/models/authentication.rb
|
|
576
|
-
- spec/rails3_mongo_mapper/app/models/user.rb
|
|
577
|
-
- spec/rails3_mongo_mapper/config/application.rb
|
|
578
|
-
- spec/rails3_mongo_mapper/config/boot.rb
|
|
579
|
-
- spec/rails3_mongo_mapper/config/environment.rb
|
|
580
|
-
- spec/rails3_mongo_mapper/config/environments/development.rb
|
|
581
|
-
- spec/rails3_mongo_mapper/config/environments/in_memory.rb
|
|
582
|
-
- spec/rails3_mongo_mapper/config/environments/production.rb
|
|
583
|
-
- spec/rails3_mongo_mapper/config/environments/test.rb
|
|
584
|
-
- spec/rails3_mongo_mapper/config/initializers/backtrace_silencers.rb
|
|
585
|
-
- spec/rails3_mongo_mapper/config/initializers/inflections.rb
|
|
586
|
-
- spec/rails3_mongo_mapper/config/initializers/mime_types.rb
|
|
587
|
-
- spec/rails3_mongo_mapper/config/initializers/mongo.rb
|
|
588
|
-
- spec/rails3_mongo_mapper/config/initializers/secret_token.rb
|
|
589
|
-
- spec/rails3_mongo_mapper/config/initializers/session_store.rb
|
|
590
|
-
- spec/rails3_mongo_mapper/config/routes.rb
|
|
591
|
-
- spec/rails3_mongo_mapper/db/schema.rb
|
|
592
|
-
- spec/rails3_mongo_mapper/db/seeds.rb
|
|
593
|
-
- spec/rails3_mongo_mapper/spec/controller_spec.rb
|
|
594
|
-
- spec/rails3_mongo_mapper/spec/spec_helper.orig.rb
|
|
595
|
-
- spec/rails3_mongo_mapper/spec/spec_helper.rb
|
|
596
|
-
- spec/rails3_mongo_mapper/spec/user_activation_spec.rb
|
|
597
|
-
- spec/rails3_mongo_mapper/spec/user_activity_logging_spec.rb
|
|
598
|
-
- spec/rails3_mongo_mapper/spec/user_brute_force_protection_spec.rb
|
|
599
|
-
- spec/rails3_mongo_mapper/spec/user_oauth_spec.rb
|
|
600
|
-
- spec/rails3_mongo_mapper/spec/user_remember_me_spec.rb
|
|
601
|
-
- spec/rails3_mongo_mapper/spec/user_reset_password_spec.rb
|
|
602
|
-
- spec/rails3_mongo_mapper/spec/user_spec.rb
|
|
603
|
-
- spec/rails3_mongoid/app/controllers/application_controller.rb
|
|
604
|
-
- spec/rails3_mongoid/app/helpers/application_helper.rb
|
|
605
|
-
- spec/rails3_mongoid/app/mailers/sorcery_mailer.rb
|
|
606
|
-
- spec/rails3_mongoid/app/models/authentication.rb
|
|
607
|
-
- spec/rails3_mongoid/app/models/user.rb
|
|
608
|
-
- spec/rails3_mongoid/config/application.rb
|
|
609
|
-
- spec/rails3_mongoid/config/boot.rb
|
|
610
|
-
- spec/rails3_mongoid/config/environment.rb
|
|
611
|
-
- spec/rails3_mongoid/config/environments/development.rb
|
|
612
|
-
- spec/rails3_mongoid/config/environments/in_memory.rb
|
|
613
|
-
- spec/rails3_mongoid/config/environments/production.rb
|
|
614
|
-
- spec/rails3_mongoid/config/environments/test.rb
|
|
615
|
-
- spec/rails3_mongoid/config/initializers/backtrace_silencers.rb
|
|
616
|
-
- spec/rails3_mongoid/config/initializers/inflections.rb
|
|
617
|
-
- spec/rails3_mongoid/config/initializers/mime_types.rb
|
|
618
|
-
- spec/rails3_mongoid/config/initializers/secret_token.rb
|
|
619
|
-
- spec/rails3_mongoid/config/initializers/session_store.rb
|
|
620
|
-
- spec/rails3_mongoid/config/routes.rb
|
|
621
|
-
- spec/rails3_mongoid/db/schema.rb
|
|
622
|
-
- spec/rails3_mongoid/db/seeds.rb
|
|
623
|
-
- spec/rails3_mongoid/spec/controller_activity_logging_spec.rb
|
|
624
|
-
- spec/rails3_mongoid/spec/controller_spec.rb
|
|
625
|
-
- spec/rails3_mongoid/spec/spec_helper.orig.rb
|
|
626
|
-
- spec/rails3_mongoid/spec/spec_helper.rb
|
|
627
|
-
- spec/rails3_mongoid/spec/user_activation_spec.rb
|
|
628
|
-
- spec/rails3_mongoid/spec/user_activity_logging_spec.rb
|
|
629
|
-
- spec/rails3_mongoid/spec/user_brute_force_protection_spec.rb
|
|
630
|
-
- spec/rails3_mongoid/spec/user_oauth_spec.rb
|
|
631
|
-
- spec/rails3_mongoid/spec/user_remember_me_spec.rb
|
|
632
|
-
- spec/rails3_mongoid/spec/user_reset_password_spec.rb
|
|
633
|
-
- spec/rails3_mongoid/spec/user_spec.rb
|
|
634
|
-
- spec/shared_examples/controller_oauth2_shared_examples.rb
|
|
635
|
-
- spec/shared_examples/controller_oauth_shared_examples.rb
|
|
636
|
-
- spec/shared_examples/user_activation_shared_examples.rb
|
|
637
|
-
- spec/shared_examples/user_activity_logging_shared_examples.rb
|
|
638
|
-
- spec/shared_examples/user_brute_force_protection_shared_examples.rb
|
|
639
|
-
- spec/shared_examples/user_oauth_shared_examples.rb
|
|
640
|
-
- spec/shared_examples/user_remember_me_shared_examples.rb
|
|
641
|
-
- spec/shared_examples/user_reset_password_shared_examples.rb
|
|
642
|
-
- spec/shared_examples/user_shared_examples.rb
|
|
643
|
-
- spec/sorcery_crypto_providers_spec.rb
|
|
644
|
-
- spec/spec_helper.rb
|
|
538
|
+
test_files: []
|