sorcery 0.7.4 → 0.7.6

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.
Files changed (46) hide show
  1. data/Gemfile +1 -1
  2. data/Gemfile.lock +41 -41
  3. data/README.rdoc +1 -1
  4. data/Rakefile +1 -1
  5. data/VERSION +1 -1
  6. data/lib/generators/sorcery/install_generator.rb +6 -3
  7. data/lib/generators/sorcery/templates/initializer.rb +25 -4
  8. data/lib/generators/sorcery/templates/migration/reset_password.rb +1 -1
  9. data/lib/sorcery/controller/submodules/activity_logging.rb +3 -3
  10. data/lib/sorcery/controller/submodules/external/protocols/oauth2.rb +19 -19
  11. data/lib/sorcery/controller/submodules/external/providers/facebook.rb +5 -2
  12. data/lib/sorcery/controller/submodules/external/providers/github.rb +12 -3
  13. data/lib/sorcery/controller/submodules/external/providers/google.rb +90 -0
  14. data/lib/sorcery/controller/submodules/external/providers/liveid.rb +91 -0
  15. data/lib/sorcery/controller/submodules/external/providers/twitter.rb +2 -1
  16. data/lib/sorcery/controller/submodules/external.rb +6 -0
  17. data/lib/sorcery/model/adapters/active_record.rb +16 -1
  18. data/lib/sorcery/model/adapters/mongo_mapper.rb +6 -1
  19. data/lib/sorcery/model/adapters/mongoid.rb +12 -1
  20. data/lib/sorcery/model/submodules/activity_logging.rb +4 -4
  21. data/lib/sorcery/model/submodules/brute_force_protection.rb +5 -5
  22. data/lib/sorcery/model/submodules/reset_password.rb +4 -5
  23. data/lib/sorcery/model/submodules/user_activation.rb +1 -2
  24. data/lib/sorcery/model.rb +17 -4
  25. data/lib/sorcery.rb +2 -0
  26. data/sorcery.gemspec +131 -9
  27. data/spec/Gemfile +1 -1
  28. data/spec/Gemfile.lock +14 -14
  29. data/spec/rails3/Gemfile +2 -3
  30. data/spec/rails3/Gemfile.lock +45 -26
  31. data/spec/rails3/app/controllers/application_controller.rb +31 -2
  32. data/spec/rails3/config/environments/in_memory.rb +35 -0
  33. data/spec/rails3/spec/controller_activity_logging_spec.rb +7 -0
  34. data/spec/rails3/spec/controller_oauth2_spec.rb +111 -11
  35. data/spec/rails3/spec/controller_spec.rb +30 -2
  36. data/spec/rails3/spec/integration_spec.rb +15 -15
  37. data/spec/rails3/spec/spec_helper.rb +1 -1
  38. data/spec/rails3_mongo_mapper/Gemfile.lock +22 -22
  39. data/spec/rails3_mongo_mapper/spec/controller_spec.rb +34 -1
  40. data/spec/rails3_mongoid/Gemfile.lock +18 -18
  41. data/spec/rails3_mongoid/app/controllers/application_controller.rb +5 -0
  42. data/spec/rails3_mongoid/spec/controller_activity_logging_spec.rb +10 -3
  43. data/spec/rails3_mongoid/spec/controller_spec.rb +34 -1
  44. data/spec/shared_examples/user_reset_password_shared_examples.rb +9 -1
  45. data/spec/sorcery_crypto_providers_spec.rb +5 -1
  46. metadata +235 -120
@@ -19,9 +19,14 @@ module Sorcery
19
19
  end
20
20
 
21
21
  module ClassMethods
22
+ def credential_regex(credential)
23
+ return { :$regex => /^#{credential}$/i } if (@sorcery_config.downcase_username_before_authenticating)
24
+ return credential
25
+ end
26
+
22
27
  def find_by_credentials(credentials)
23
28
  @sorcery_config.username_attribute_names.each do |attribute|
24
- @user = where(attribute => credentials[0]).first
29
+ @user = where(attribute => credential_regex(credentials[0])).first
25
30
  break if @user
26
31
  end
27
32
  @user
@@ -11,12 +11,23 @@ module Sorcery
11
11
  def increment(attr)
12
12
  self.inc(attr,1)
13
13
  end
14
+
15
+ def update_single_attribute(name, value)
16
+ value = value.utc if value.is_a?(ActiveSupport::TimeWithZone)
17
+ self.send(:"#{name}=", value)
18
+ self.class.where(:_id => self.id).update_all(name => value)
19
+ end
14
20
  end
15
21
 
16
22
  module ClassMethods
23
+ def credential_regex(credential)
24
+ return { :$regex => /^#{credential}$/i } if (@sorcery_config.downcase_username_before_authenticating)
25
+ return credential
26
+ end
27
+
17
28
  def find_by_credentials(credentials)
18
29
  @sorcery_config.username_attribute_names.each do |attribute|
19
- @user = where(attribute => credentials[0]).first
30
+ @user = where(attribute => credential_regex(credentials[0])).first
20
31
  break if @user
21
32
  end
22
33
  @user
@@ -39,12 +39,12 @@ module Sorcery
39
39
  protected
40
40
 
41
41
  def define_activity_logging_mongoid_fields
42
- field sorcery_config.last_login_at_attribute_name, :type => DateTime
43
- field sorcery_config.last_logout_at_attribute_name, :type => DateTime
44
- field sorcery_config.last_activity_at_attribute_name, :type => DateTime
42
+ field sorcery_config.last_login_at_attribute_name, :type => Time
43
+ field sorcery_config.last_logout_at_attribute_name, :type => Time
44
+ field sorcery_config.last_activity_at_attribute_name, :type => Time
45
45
  end
46
46
  end
47
47
  end
48
48
  end
49
49
  end
50
- end
50
+ end
@@ -38,12 +38,12 @@ module Sorcery
38
38
 
39
39
  def define_brute_force_protection_mongoid_fields
40
40
  field sorcery_config.failed_logins_count_attribute_name, :type => Integer
41
- field sorcery_config.lock_expires_at_attribute_name, :type => DateTime
41
+ field sorcery_config.lock_expires_at_attribute_name, :type => Time
42
42
  end
43
43
 
44
44
  def define_brute_force_protection_mongo_mapper_fields
45
45
  key sorcery_config.failed_logins_count_attribute_name, Integer
46
- key sorcery_config.lock_expires_at_attribute_name, DateTime
46
+ key sorcery_config.lock_expires_at_attribute_name, Time
47
47
  end
48
48
  end
49
49
 
@@ -54,7 +54,7 @@ module Sorcery
54
54
  config = sorcery_config
55
55
  return if !unlocked?
56
56
  self.increment(config.failed_logins_count_attribute_name)
57
- save!(:validate => false)
57
+ self.save!(:validate => false)
58
58
  self.lock! if self.send(config.failed_logins_count_attribute_name) >= config.consecutive_login_retries_amount_limit
59
59
  end
60
60
 
@@ -63,14 +63,14 @@ module Sorcery
63
63
  def lock!
64
64
  config = sorcery_config
65
65
  self.send(:"#{config.lock_expires_at_attribute_name}=", Time.now.in_time_zone + config.login_lock_time_period)
66
- self.save!(validate: false)
66
+ self.save!(:validate => false)
67
67
  end
68
68
 
69
69
  def unlock!
70
70
  config = sorcery_config
71
71
  self.send(:"#{config.lock_expires_at_attribute_name}=", nil)
72
72
  self.send(:"#{config.failed_logins_count_attribute_name}=", 0)
73
- self.save!(validate: false)
73
+ self.save!(:validate => false)
74
74
  end
75
75
 
76
76
  def unlocked?
@@ -72,13 +72,12 @@ module Sorcery
72
72
 
73
73
  def define_reset_password_mongoid_fields
74
74
  field sorcery_config.reset_password_token_attribute_name, :type => String
75
- field sorcery_config.reset_password_token_expires_at_attribute_name, :type => DateTime
76
- field sorcery_config.reset_password_email_sent_at_attribute_name, :type => DateTime
75
+ field sorcery_config.reset_password_token_expires_at_attribute_name, :type => Time
76
+ field sorcery_config.reset_password_email_sent_at_attribute_name, :type => Time
77
77
  end
78
78
 
79
79
  def define_reset_password_mongo_mapper_fields
80
80
  key sorcery_config.reset_password_token_attribute_name, String
81
- # no DateTime in MM
82
81
  key sorcery_config.reset_password_token_expires_at_attribute_name, Time
83
82
  key sorcery_config.reset_password_email_sent_at_attribute_name, Time
84
83
  end
@@ -89,7 +88,7 @@ module Sorcery
89
88
  def deliver_reset_password_instructions!
90
89
  config = sorcery_config
91
90
  # hammering protection
92
- return if config.reset_password_time_between_emails && self.send(config.reset_password_email_sent_at_attribute_name) && self.send(config.reset_password_email_sent_at_attribute_name) > config.reset_password_time_between_emails.ago.utc
91
+ return false if config.reset_password_time_between_emails && self.send(config.reset_password_email_sent_at_attribute_name) && self.send(config.reset_password_email_sent_at_attribute_name) > config.reset_password_time_between_emails.ago.utc
93
92
  self.send(:"#{config.reset_password_token_attribute_name}=", TemporaryToken.generate_random_token)
94
93
  self.send(:"#{config.reset_password_token_expires_at_attribute_name}=", Time.now.in_time_zone + config.reset_password_expiration_period) if config.reset_password_expiration_period
95
94
  self.send(:"#{config.reset_password_email_sent_at_attribute_name}=", Time.now.in_time_zone)
@@ -119,4 +118,4 @@ module Sorcery
119
118
  end
120
119
  end
121
120
  end
122
- end
121
+ end
@@ -84,7 +84,7 @@ module Sorcery
84
84
  self.class_eval do
85
85
  field sorcery_config.activation_state_attribute_name, :type => String
86
86
  field sorcery_config.activation_token_attribute_name, :type => String
87
- field sorcery_config.activation_token_expires_at_attribute_name, :type => DateTime
87
+ field sorcery_config.activation_token_expires_at_attribute_name, :type => Time
88
88
  end
89
89
  end
90
90
 
@@ -92,7 +92,6 @@ module Sorcery
92
92
  self.class_eval do
93
93
  key sorcery_config.activation_state_attribute_name, String
94
94
  key sorcery_config.activation_token_attribute_name, String
95
- # no DateTime in MM
96
95
  key sorcery_config.activation_token_expires_at_attribute_name, Time
97
96
  end
98
97
  end
data/lib/sorcery/model.rb CHANGED
@@ -104,7 +104,11 @@ module Sorcery
104
104
  # returns the user if success, nil otherwise.
105
105
  def authenticate(*credentials)
106
106
  raise ArgumentError, "at least 2 arguments required" if credentials.size < 2
107
+ credentials[0].downcase! if @sorcery_config.downcase_username_before_authenticating
107
108
  user = find_by_credentials(credentials)
109
+
110
+ set_encryption_attributes()
111
+
108
112
  _salt = user.send(@sorcery_config.salt_attribute_name) if user && !@sorcery_config.salt_attribute_name.nil? && !@sorcery_config.encryption_provider.nil?
109
113
  user if user && @sorcery_config.before_authenticate.all? {|c| user.send(c)} && credentials_match?(user.send(@sorcery_config.crypted_password_attribute_name),credentials[1],_salt)
110
114
  end
@@ -113,14 +117,19 @@ module Sorcery
113
117
  def encrypt(*tokens)
114
118
  return tokens.first if @sorcery_config.encryption_provider.nil?
115
119
 
116
- @sorcery_config.encryption_provider.stretches = @sorcery_config.stretches if @sorcery_config.encryption_provider.respond_to?(:stretches) && @sorcery_config.stretches
117
- @sorcery_config.encryption_provider.join_token = @sorcery_config.salt_join_token if @sorcery_config.encryption_provider.respond_to?(:join_token) && @sorcery_config.salt_join_token
120
+ set_encryption_attributes()
121
+
118
122
  CryptoProviders::AES256.key = @sorcery_config.encryption_key
119
123
  @sorcery_config.encryption_provider.encrypt(*tokens)
120
124
  end
121
125
 
122
126
  protected
123
-
127
+
128
+ def set_encryption_attributes()
129
+ @sorcery_config.encryption_provider.stretches = @sorcery_config.stretches if @sorcery_config.encryption_provider.respond_to?(:stretches) && @sorcery_config.stretches
130
+ @sorcery_config.encryption_provider.join_token = @sorcery_config.salt_join_token if @sorcery_config.encryption_provider.respond_to?(:join_token) && @sorcery_config.salt_join_token
131
+ end
132
+
124
133
  # Calls the configured encryption provider to compare the supplied password with the encrypted one.
125
134
  def credentials_match?(crypted, *tokens)
126
135
  return crypted == tokens.join if @sorcery_config.encryption_provider.nil?
@@ -193,6 +202,9 @@ module Sorcery
193
202
  # until an encrypted one is generated.
194
203
 
195
204
  :email_attribute_name, # change default email attribute.
205
+
206
+ :downcase_username_before_authenticating, # downcase the username before trying to authenticate, default is false
207
+
196
208
  :crypted_password_attribute_name, # change default crypted_password attribute.
197
209
  :salt_join_token, # what pattern to use to join the password with the salt
198
210
  :salt_attribute_name, # change default salt attribute.
@@ -220,6 +232,7 @@ module Sorcery
220
232
  :@submodules => [],
221
233
  :@username_attribute_names => [:username],
222
234
  :@password_attribute_name => :password,
235
+ :@downcase_username_before_authenticating => false,
223
236
  :@email_attribute_name => :email,
224
237
  :@crypted_password_attribute_name => :crypted_password,
225
238
  :@encryption_algorithm => :bcrypt,
@@ -268,4 +281,4 @@ module Sorcery
268
281
  end
269
282
 
270
283
  end
271
- end
284
+ end
data/lib/sorcery.rb CHANGED
@@ -34,6 +34,8 @@ module Sorcery
34
34
  autoload :Twitter, 'sorcery/controller/submodules/external/providers/twitter'
35
35
  autoload :Facebook, 'sorcery/controller/submodules/external/providers/facebook'
36
36
  autoload :Github, 'sorcery/controller/submodules/external/providers/github'
37
+ autoload :Google, 'sorcery/controller/submodules/external/providers/google'
38
+ autoload :Liveid, 'sorcery/controller/submodules/external/providers/liveid'
37
39
  end
38
40
  end
39
41
  end
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.4"
8
+ s.version = "0.7.6"
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 = "2011-10-29"
12
+ s.date = "2012-01-03"
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 = [
@@ -45,6 +45,8 @@ Gem::Specification.new do |s|
45
45
  "lib/sorcery/controller/submodules/external/protocols/oauth2.rb",
46
46
  "lib/sorcery/controller/submodules/external/providers/facebook.rb",
47
47
  "lib/sorcery/controller/submodules/external/providers/github.rb",
48
+ "lib/sorcery/controller/submodules/external/providers/google.rb",
49
+ "lib/sorcery/controller/submodules/external/providers/liveid.rb",
48
50
  "lib/sorcery/controller/submodules/external/providers/twitter.rb",
49
51
  "lib/sorcery/controller/submodules/http_basic_auth.rb",
50
52
  "lib/sorcery/controller/submodules/remember_me.rb",
@@ -298,15 +300,135 @@ Gem::Specification.new do |s|
298
300
  s.homepage = "http://github.com/NoamB/sorcery"
299
301
  s.licenses = ["MIT"]
300
302
  s.require_paths = ["lib"]
301
- s.rubygems_version = "1.8.11"
303
+ s.rubygems_version = "1.8.10"
302
304
  s.summary = "Magical authentication for Rails 3 applications"
305
+ s.test_files = [
306
+ "spec/rails3/app/controllers/application_controller.rb",
307
+ "spec/rails3/app/helpers/application_helper.rb",
308
+ "spec/rails3/app/mailers/sorcery_mailer.rb",
309
+ "spec/rails3/app/models/authentication.rb",
310
+ "spec/rails3/app/models/user.rb",
311
+ "spec/rails3/config/application.rb",
312
+ "spec/rails3/config/boot.rb",
313
+ "spec/rails3/config/environment.rb",
314
+ "spec/rails3/config/environments/development.rb",
315
+ "spec/rails3/config/environments/in_memory.rb",
316
+ "spec/rails3/config/environments/production.rb",
317
+ "spec/rails3/config/environments/test.rb",
318
+ "spec/rails3/config/initializers/backtrace_silencers.rb",
319
+ "spec/rails3/config/initializers/inflections.rb",
320
+ "spec/rails3/config/initializers/mime_types.rb",
321
+ "spec/rails3/config/initializers/secret_token.rb",
322
+ "spec/rails3/config/initializers/session_store.rb",
323
+ "spec/rails3/config/routes.rb",
324
+ "spec/rails3/db/migrate/activation/20101224223622_add_activation_to_users.rb",
325
+ "spec/rails3/db/migrate/activity_logging/20101224223624_add_activity_logging_to_users.rb",
326
+ "spec/rails3/db/migrate/brute_force_protection/20101224223626_add_brute_force_protection_to_users.rb",
327
+ "spec/rails3/db/migrate/core/20101224223620_create_users.rb",
328
+ "spec/rails3/db/migrate/external/20101224223628_create_authentications.rb",
329
+ "spec/rails3/db/migrate/remember_me/20101224223623_add_remember_me_token_to_users.rb",
330
+ "spec/rails3/db/migrate/reset_password/20101224223622_add_reset_password_to_users.rb",
331
+ "spec/rails3/db/schema.rb",
332
+ "spec/rails3/db/seeds.rb",
333
+ "spec/rails3/spec/controller_activity_logging_spec.rb",
334
+ "spec/rails3/spec/controller_brute_force_protection_spec.rb",
335
+ "spec/rails3/spec/controller_http_basic_auth_spec.rb",
336
+ "spec/rails3/spec/controller_oauth2_spec.rb",
337
+ "spec/rails3/spec/controller_oauth_spec.rb",
338
+ "spec/rails3/spec/controller_remember_me_spec.rb",
339
+ "spec/rails3/spec/controller_session_timeout_spec.rb",
340
+ "spec/rails3/spec/controller_spec.rb",
341
+ "spec/rails3/spec/integration_spec.rb",
342
+ "spec/rails3/spec/spec_helper.orig.rb",
343
+ "spec/rails3/spec/spec_helper.rb",
344
+ "spec/rails3/spec/user_activation_spec.rb",
345
+ "spec/rails3/spec/user_activity_logging_spec.rb",
346
+ "spec/rails3/spec/user_brute_force_protection_spec.rb",
347
+ "spec/rails3/spec/user_oauth_spec.rb",
348
+ "spec/rails3/spec/user_remember_me_spec.rb",
349
+ "spec/rails3/spec/user_reset_password_spec.rb",
350
+ "spec/rails3/spec/user_spec.rb",
351
+ "spec/rails3_mongo_mapper/app/controllers/application_controller.rb",
352
+ "spec/rails3_mongo_mapper/app/helpers/application_helper.rb",
353
+ "spec/rails3_mongo_mapper/app/mailers/sorcery_mailer.rb",
354
+ "spec/rails3_mongo_mapper/app/models/authentication.rb",
355
+ "spec/rails3_mongo_mapper/app/models/user.rb",
356
+ "spec/rails3_mongo_mapper/config/application.rb",
357
+ "spec/rails3_mongo_mapper/config/boot.rb",
358
+ "spec/rails3_mongo_mapper/config/environment.rb",
359
+ "spec/rails3_mongo_mapper/config/environments/development.rb",
360
+ "spec/rails3_mongo_mapper/config/environments/in_memory.rb",
361
+ "spec/rails3_mongo_mapper/config/environments/production.rb",
362
+ "spec/rails3_mongo_mapper/config/environments/test.rb",
363
+ "spec/rails3_mongo_mapper/config/initializers/backtrace_silencers.rb",
364
+ "spec/rails3_mongo_mapper/config/initializers/inflections.rb",
365
+ "spec/rails3_mongo_mapper/config/initializers/mime_types.rb",
366
+ "spec/rails3_mongo_mapper/config/initializers/mongo.rb",
367
+ "spec/rails3_mongo_mapper/config/initializers/secret_token.rb",
368
+ "spec/rails3_mongo_mapper/config/initializers/session_store.rb",
369
+ "spec/rails3_mongo_mapper/config/routes.rb",
370
+ "spec/rails3_mongo_mapper/db/schema.rb",
371
+ "spec/rails3_mongo_mapper/db/seeds.rb",
372
+ "spec/rails3_mongo_mapper/spec/controller_spec.rb",
373
+ "spec/rails3_mongo_mapper/spec/spec_helper.orig.rb",
374
+ "spec/rails3_mongo_mapper/spec/spec_helper.rb",
375
+ "spec/rails3_mongo_mapper/spec/user_activation_spec.rb",
376
+ "spec/rails3_mongo_mapper/spec/user_activity_logging_spec.rb",
377
+ "spec/rails3_mongo_mapper/spec/user_brute_force_protection_spec.rb",
378
+ "spec/rails3_mongo_mapper/spec/user_oauth_spec.rb",
379
+ "spec/rails3_mongo_mapper/spec/user_remember_me_spec.rb",
380
+ "spec/rails3_mongo_mapper/spec/user_reset_password_spec.rb",
381
+ "spec/rails3_mongo_mapper/spec/user_spec.rb",
382
+ "spec/rails3_mongoid/app/controllers/application_controller.rb",
383
+ "spec/rails3_mongoid/app/helpers/application_helper.rb",
384
+ "spec/rails3_mongoid/app/mailers/sorcery_mailer.rb",
385
+ "spec/rails3_mongoid/app/models/authentication.rb",
386
+ "spec/rails3_mongoid/app/models/user.rb",
387
+ "spec/rails3_mongoid/config/application.rb",
388
+ "spec/rails3_mongoid/config/boot.rb",
389
+ "spec/rails3_mongoid/config/environment.rb",
390
+ "spec/rails3_mongoid/config/environments/development.rb",
391
+ "spec/rails3_mongoid/config/environments/in_memory.rb",
392
+ "spec/rails3_mongoid/config/environments/production.rb",
393
+ "spec/rails3_mongoid/config/environments/test.rb",
394
+ "spec/rails3_mongoid/config/initializers/backtrace_silencers.rb",
395
+ "spec/rails3_mongoid/config/initializers/inflections.rb",
396
+ "spec/rails3_mongoid/config/initializers/mime_types.rb",
397
+ "spec/rails3_mongoid/config/initializers/secret_token.rb",
398
+ "spec/rails3_mongoid/config/initializers/session_store.rb",
399
+ "spec/rails3_mongoid/config/routes.rb",
400
+ "spec/rails3_mongoid/db/schema.rb",
401
+ "spec/rails3_mongoid/db/seeds.rb",
402
+ "spec/rails3_mongoid/spec/controller_activity_logging_spec.rb",
403
+ "spec/rails3_mongoid/spec/controller_spec.rb",
404
+ "spec/rails3_mongoid/spec/spec_helper.orig.rb",
405
+ "spec/rails3_mongoid/spec/spec_helper.rb",
406
+ "spec/rails3_mongoid/spec/user_activation_spec.rb",
407
+ "spec/rails3_mongoid/spec/user_activity_logging_spec.rb",
408
+ "spec/rails3_mongoid/spec/user_brute_force_protection_spec.rb",
409
+ "spec/rails3_mongoid/spec/user_oauth_spec.rb",
410
+ "spec/rails3_mongoid/spec/user_remember_me_spec.rb",
411
+ "spec/rails3_mongoid/spec/user_reset_password_spec.rb",
412
+ "spec/rails3_mongoid/spec/user_spec.rb",
413
+ "spec/shared_examples/controller_oauth2_shared_examples.rb",
414
+ "spec/shared_examples/controller_oauth_shared_examples.rb",
415
+ "spec/shared_examples/user_activation_shared_examples.rb",
416
+ "spec/shared_examples/user_activity_logging_shared_examples.rb",
417
+ "spec/shared_examples/user_brute_force_protection_shared_examples.rb",
418
+ "spec/shared_examples/user_oauth_shared_examples.rb",
419
+ "spec/shared_examples/user_remember_me_shared_examples.rb",
420
+ "spec/shared_examples/user_reset_password_shared_examples.rb",
421
+ "spec/shared_examples/user_shared_examples.rb",
422
+ "spec/sorcery_crypto_providers_spec.rb",
423
+ "spec/spec_helper.rb"
424
+ ]
303
425
 
304
426
  if s.respond_to? :specification_version then
305
427
  s.specification_version = 3
306
428
 
307
429
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
308
430
  s.add_runtime_dependency(%q<oauth>, ["~> 0.4.4"])
309
- s.add_runtime_dependency(%q<oauth2>, ["~> 0.4.1"])
431
+ s.add_runtime_dependency(%q<oauth2>, ["~> 0.5.1"])
310
432
  s.add_development_dependency(%q<rails>, [">= 3.0.0"])
311
433
  s.add_development_dependency(%q<json>, [">= 1.5.1"])
312
434
  s.add_development_dependency(%q<rspec>, ["~> 2.5.0"])
@@ -320,10 +442,10 @@ Gem::Specification.new do |s|
320
442
  s.add_development_dependency(%q<timecop>, [">= 0"])
321
443
  s.add_runtime_dependency(%q<bcrypt-ruby>, ["~> 3.0.0"])
322
444
  s.add_runtime_dependency(%q<oauth>, ["~> 0.4.4"])
323
- s.add_runtime_dependency(%q<oauth2>, ["~> 0.4.1"])
445
+ s.add_runtime_dependency(%q<oauth2>, ["~> 0.5.1"])
324
446
  else
325
447
  s.add_dependency(%q<oauth>, ["~> 0.4.4"])
326
- s.add_dependency(%q<oauth2>, ["~> 0.4.1"])
448
+ s.add_dependency(%q<oauth2>, ["~> 0.5.1"])
327
449
  s.add_dependency(%q<rails>, [">= 3.0.0"])
328
450
  s.add_dependency(%q<json>, [">= 1.5.1"])
329
451
  s.add_dependency(%q<rspec>, ["~> 2.5.0"])
@@ -337,11 +459,11 @@ Gem::Specification.new do |s|
337
459
  s.add_dependency(%q<timecop>, [">= 0"])
338
460
  s.add_dependency(%q<bcrypt-ruby>, ["~> 3.0.0"])
339
461
  s.add_dependency(%q<oauth>, ["~> 0.4.4"])
340
- s.add_dependency(%q<oauth2>, ["~> 0.4.1"])
462
+ s.add_dependency(%q<oauth2>, ["~> 0.5.1"])
341
463
  end
342
464
  else
343
465
  s.add_dependency(%q<oauth>, ["~> 0.4.4"])
344
- s.add_dependency(%q<oauth2>, ["~> 0.4.1"])
466
+ s.add_dependency(%q<oauth2>, ["~> 0.5.1"])
345
467
  s.add_dependency(%q<rails>, [">= 3.0.0"])
346
468
  s.add_dependency(%q<json>, [">= 1.5.1"])
347
469
  s.add_dependency(%q<rspec>, ["~> 2.5.0"])
@@ -355,7 +477,7 @@ Gem::Specification.new do |s|
355
477
  s.add_dependency(%q<timecop>, [">= 0"])
356
478
  s.add_dependency(%q<bcrypt-ruby>, ["~> 3.0.0"])
357
479
  s.add_dependency(%q<oauth>, ["~> 0.4.4"])
358
- s.add_dependency(%q<oauth2>, ["~> 0.4.1"])
480
+ s.add_dependency(%q<oauth2>, ["~> 0.5.1"])
359
481
  end
360
482
  end
361
483
 
data/spec/Gemfile CHANGED
@@ -4,7 +4,7 @@ gem "rails", '3.0.3'
4
4
  gem 'bcrypt-ruby', :require => 'bcrypt'
5
5
  gem "sorcery", '>= 0.1.0', :path => '../'
6
6
  gem 'oauth', "~> 0.4.4"
7
- gem 'oauth2', "~> 0.4.1"
7
+ gem 'oauth2', "~> 0.5.1"
8
8
  group :development do
9
9
  gem "rspec", "~> 2.5.0"
10
10
  gem 'ruby-debug19'
data/spec/Gemfile.lock CHANGED
@@ -1,12 +1,12 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- sorcery (0.7.2)
4
+ sorcery (0.7.5)
5
5
  bcrypt-ruby (~> 3.0.0)
6
6
  oauth (~> 0.4.4)
7
7
  oauth (~> 0.4.4)
8
- oauth2 (~> 0.4.1)
9
- oauth2 (~> 0.4.1)
8
+ oauth2 (~> 0.5.1)
9
+ oauth2 (~> 0.5.1)
10
10
 
11
11
  GEM
12
12
  remote: http://rubygems.org/
@@ -43,13 +43,13 @@ GEM
43
43
  arel (2.0.10)
44
44
  bcrypt-ruby (3.0.1)
45
45
  builder (2.1.2)
46
- columnize (0.3.4)
46
+ columnize (0.3.5)
47
47
  diff-lcs (1.1.3)
48
48
  erubis (2.6.6)
49
49
  abstract (>= 1.0.0)
50
- faraday (0.6.1)
51
- addressable (~> 2.2.4)
52
- multipart-post (~> 1.1.0)
50
+ faraday (0.7.5)
51
+ addressable (~> 2.2.6)
52
+ multipart-post (~> 1.1.3)
53
53
  rack (>= 1.1.0, < 2)
54
54
  i18n (0.6.0)
55
55
  linecache19 (0.5.12)
@@ -61,12 +61,12 @@ GEM
61
61
  treetop (~> 1.4.8)
62
62
  mime-types (1.17.2)
63
63
  multi_json (1.0.3)
64
- multipart-post (1.1.3)
64
+ multipart-post (1.1.4)
65
65
  oauth (0.4.5)
66
- oauth2 (0.4.1)
67
- faraday (~> 0.6.1)
68
- multi_json (>= 0.0.5)
69
- polyglot (0.3.2)
66
+ oauth2 (0.5.1)
67
+ faraday (~> 0.7.4)
68
+ multi_json (~> 1.0.3)
69
+ polyglot (0.3.3)
70
70
  rack (1.2.4)
71
71
  rack-mount (0.6.14)
72
72
  rack (>= 1.0.0)
@@ -112,7 +112,7 @@ GEM
112
112
  treetop (1.4.10)
113
113
  polyglot
114
114
  polyglot (>= 0.3.1)
115
- tzinfo (0.3.30)
115
+ tzinfo (0.3.31)
116
116
 
117
117
  PLATFORMS
118
118
  ruby
@@ -120,7 +120,7 @@ PLATFORMS
120
120
  DEPENDENCIES
121
121
  bcrypt-ruby
122
122
  oauth (~> 0.4.4)
123
- oauth2 (~> 0.4.1)
123
+ oauth2 (~> 0.5.1)
124
124
  rails (= 3.0.3)
125
125
  rspec (~> 2.5.0)
126
126
  ruby-debug19
data/spec/rails3/Gemfile CHANGED
@@ -5,11 +5,10 @@ gem 'sqlite3-ruby', :require => 'sqlite3'
5
5
  gem "sorcery", '>= 0.1.0', :path => '../../'
6
6
 
7
7
  group :development, :test do
8
- gem "rspec", "~> 2.5.0"
9
- gem 'rspec-rails', "~> 2.5.0"
8
+ gem 'rspec-rails', "~> 2.7.0"
10
9
  gem 'ruby-debug19'
11
10
  gem 'simplecov', '>= 0.3.8', :require => false # Will install simplecov-html as a dependency
12
11
  gem 'timecop'
13
- # gem 'capybara', '~> 1.1.1'
12
+ gem 'capybara', '~> 1.1.1'
14
13
  gem 'launchy', '~> 2.0.5'
15
14
  end
@@ -1,12 +1,12 @@
1
1
  PATH
2
2
  remote: ../../
3
3
  specs:
4
- sorcery (0.7.2)
4
+ sorcery (0.7.5)
5
5
  bcrypt-ruby (~> 3.0.0)
6
6
  oauth (~> 0.4.4)
7
7
  oauth (~> 0.4.4)
8
- oauth2 (~> 0.4.1)
9
- oauth2 (~> 0.4.1)
8
+ oauth2 (~> 0.5.1)
9
+ oauth2 (~> 0.5.1)
10
10
 
11
11
  GEM
12
12
  remote: http://rubygems.org/
@@ -43,14 +43,24 @@ GEM
43
43
  arel (2.0.10)
44
44
  bcrypt-ruby (3.0.1)
45
45
  builder (2.1.2)
46
- columnize (0.3.4)
46
+ capybara (1.1.2)
47
+ mime-types (>= 1.16)
48
+ nokogiri (>= 1.3.3)
49
+ rack (>= 1.0.0)
50
+ rack-test (>= 0.5.4)
51
+ selenium-webdriver (~> 2.0)
52
+ xpath (~> 0.1.4)
53
+ childprocess (0.2.3)
54
+ ffi (~> 1.0.6)
55
+ columnize (0.3.6)
47
56
  diff-lcs (1.1.3)
48
57
  erubis (2.6.6)
49
58
  abstract (>= 1.0.0)
50
- faraday (0.6.1)
51
- addressable (~> 2.2.4)
52
- multipart-post (~> 1.1.0)
59
+ faraday (0.7.5)
60
+ addressable (~> 2.2.6)
61
+ multipart-post (~> 1.1.3)
53
62
  rack (>= 1.1.0, < 2)
63
+ ffi (1.0.11)
54
64
  i18n (0.6.0)
55
65
  launchy (2.0.5)
56
66
  addressable (~> 2.2.6)
@@ -62,13 +72,14 @@ GEM
62
72
  mime-types (~> 1.16)
63
73
  treetop (~> 1.4.8)
64
74
  mime-types (1.17.2)
65
- multi_json (1.0.3)
66
- multipart-post (1.1.3)
75
+ multi_json (1.0.4)
76
+ multipart-post (1.1.4)
77
+ nokogiri (1.5.0)
67
78
  oauth (0.4.5)
68
- oauth2 (0.4.1)
69
- faraday (~> 0.6.1)
70
- multi_json (>= 0.0.5)
71
- polyglot (0.3.2)
79
+ oauth2 (0.5.1)
80
+ faraday (~> 0.7.4)
81
+ multi_json (~> 1.0.3)
82
+ polyglot (0.3.3)
72
83
  rack (1.2.4)
73
84
  rack-mount (0.6.14)
74
85
  rack (>= 1.0.0)
@@ -88,19 +99,19 @@ GEM
88
99
  rake (>= 0.8.7)
89
100
  thor (~> 0.14.4)
90
101
  rake (0.9.2.2)
91
- rspec (2.5.0)
92
- rspec-core (~> 2.5.0)
93
- rspec-expectations (~> 2.5.0)
94
- rspec-mocks (~> 2.5.0)
95
- rspec-core (2.5.2)
96
- rspec-expectations (2.5.0)
102
+ rspec (2.7.0)
103
+ rspec-core (~> 2.7.0)
104
+ rspec-expectations (~> 2.7.0)
105
+ rspec-mocks (~> 2.7.0)
106
+ rspec-core (2.7.1)
107
+ rspec-expectations (2.7.0)
97
108
  diff-lcs (~> 1.1.2)
98
- rspec-mocks (2.5.0)
99
- rspec-rails (2.5.0)
109
+ rspec-mocks (2.7.0)
110
+ rspec-rails (2.7.0)
100
111
  actionpack (~> 3.0)
101
112
  activesupport (~> 3.0)
102
113
  railties (~> 3.0)
103
- rspec (~> 2.5.0)
114
+ rspec (~> 2.7.0)
104
115
  ruby-debug-base19 (0.11.25)
105
116
  columnize (>= 0.3.1)
106
117
  linecache19 (>= 0.5.11)
@@ -111,11 +122,17 @@ GEM
111
122
  ruby-debug-base19 (>= 0.11.19)
112
123
  ruby_core_source (0.1.5)
113
124
  archive-tar-minitar (>= 0.5.2)
125
+ rubyzip (0.9.5)
126
+ selenium-webdriver (2.15.0)
127
+ childprocess (>= 0.2.1)
128
+ ffi (~> 1.0.9)
129
+ multi_json (~> 1.0.4)
130
+ rubyzip
114
131
  simplecov (0.5.4)
115
132
  multi_json (~> 1.0.3)
116
133
  simplecov-html (~> 0.5.3)
117
134
  simplecov-html (0.5.3)
118
- sqlite3 (1.3.4)
135
+ sqlite3 (1.3.5)
119
136
  sqlite3-ruby (1.3.3)
120
137
  sqlite3 (>= 1.3.3)
121
138
  thor (0.14.6)
@@ -123,16 +140,18 @@ GEM
123
140
  treetop (1.4.10)
124
141
  polyglot
125
142
  polyglot (>= 0.3.1)
126
- tzinfo (0.3.30)
143
+ tzinfo (0.3.31)
144
+ xpath (0.1.4)
145
+ nokogiri (~> 1.3)
127
146
 
128
147
  PLATFORMS
129
148
  ruby
130
149
 
131
150
  DEPENDENCIES
151
+ capybara (~> 1.1.1)
132
152
  launchy (~> 2.0.5)
133
153
  rails (= 3.0.3)
134
- rspec (~> 2.5.0)
135
- rspec-rails (~> 2.5.0)
154
+ rspec-rails (~> 2.7.0)
136
155
  ruby-debug19
137
156
  simplecov (>= 0.3.8)
138
157
  sorcery (>= 0.1.0)!